3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

fetch fix

This commit is contained in:
almeidx 2021-07-29 00:55:03 +01:00
parent de7c721c0e
commit cfe3bff742
No known key found for this signature in database
GPG key ID: 8558FBFF849BD664

View file

@ -21,7 +21,7 @@ export async function applyBotSlowmodeToUserId(
await channel.permissionOverwrites.create(userId as Snowflake, { SEND_MESSAGES: false }, { type: 1 });
}
} catch (e) {
const user = (await pluginData.client.users.fetch(userId as Snowflake)) || new UnknownUser({ id: userId });
const user = await pluginData.client.users.fetch(userId as Snowflake).catch(() => new UnknownUser({ id: userId }));
if (isDiscordAPIError(e) && e.code === 50013) {
logger.warn(