mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: no embed errors
This commit is contained in:
1 parent
6094875ffb
commit
8946f115c0
8 files changed
+15
-33
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { ChatInputCommandInteraction } from 'discord.js';
|
||||
import markdownEscape from 'markdown-escape';
|
||||
import { Region } from '../../constants/regions';
|
||||
import searchClansAcrossRegions from '../blitz/searchClansAcrossRegions';
|
||||
import { UserError } from '../blitzkrieg/userError';
|
||||
@@ -19,8 +20,7 @@ export default async function resolveClanFromCommand(
|
||||
return { region: accounts[0].region, id: accounts[0].clan_id };
|
||||
} else {
|
||||
throw new UserError(
|
||||
'Could not find clan',
|
||||
`\`${clan}\` was not found. Try selecting a clan from the search result.`,
|
||||
`# Could not find clan\nCouldn't find "${markdownEscape(clan)}". Try selecting a clan from the search result.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,8 +35,7 @@ export default async function resolvePlayerFromCommand(
|
||||
} satisfies ResolvedPlayer;
|
||||
} else {
|
||||
throw new UserError(
|
||||
'Could not find user',
|
||||
`I couldn't find user "${markdownEscape(
|
||||
`# Could not find user\nI couldn't find user "${markdownEscape(
|
||||
commandUsername,
|
||||
)}". Try picking an user from the search result, typing in a valid username, or using the \`/link\` command.`,
|
||||
);
|
||||
@@ -49,8 +48,7 @@ export default async function resolvePlayerFromCommand(
|
||||
return { region: account.region, id: account.blitz };
|
||||
} else {
|
||||
throw new UserError(
|
||||
"You're account isn't linked with Blitzkrieg yet",
|
||||
'Use the `/link` command to get started.',
|
||||
"# I don't know who you are\nUse the `/link` command to get started.",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user