mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-25 03:29:51 +01:00
feat: bug fixes and error safety
This commit is contained in:
1 parent
0b6b2ecedc
commit
780d9d5f8e
25 files changed
+136
-182
No files matched your search
@@ -7,7 +7,7 @@ import listClansPanServer from './listClansPanServer.js';
|
||||
export default async function getBlitzClan(
|
||||
interaction: ChatInputCommandInteraction<CacheType>,
|
||||
clan: string,
|
||||
): Promise<{ server: BlitzServer; id: number } | null> {
|
||||
) {
|
||||
if (serverAndIdPattern.test(clan)) {
|
||||
const [server, accountId] = clan.split('/');
|
||||
return { server: server as BlitzServer, id: Number(accountId) };
|
||||
@@ -20,13 +20,13 @@ export default async function getBlitzClan(
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
errorEmbed(
|
||||
'Could not find user',
|
||||
'Could not find clan',
|
||||
`I couldn't find clan \`${clan}\`. Try selecting a username from the search result.`,
|
||||
),
|
||||
],
|
||||
});
|
||||
|
||||
return null;
|
||||
throw new Error(`Could not find clan "${clan}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user