mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-05 15:52:55 +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
@@ -8,7 +8,7 @@ export const serverAndIdPattern = /(com|eu|asia)\/[0-9]+/;
|
||||
export default async function getBlitzAccount(
|
||||
interaction: ChatInputCommandInteraction<CacheType>,
|
||||
username: string,
|
||||
): Promise<{ server: BlitzServer; id: number } | null> {
|
||||
) {
|
||||
if (serverAndIdPattern.test(username)) {
|
||||
const [server, accountId] = username.split('/');
|
||||
return { server: server as BlitzServer, id: Number(accountId) };
|
||||
@@ -27,7 +27,7 @@ export default async function getBlitzAccount(
|
||||
],
|
||||
});
|
||||
|
||||
return null;
|
||||
throw new Error(`Could not find user "${username}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user