mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-18 23:09:59 +00:00
fix: log all errors when attempting to create a webhook and gracefully return
This commit is contained in:
parent
0064d8fe3e
commit
a7d71e0762
1 changed files with 4 additions and 3 deletions
|
@ -35,12 +35,13 @@ export async function getOrCreateWebhookForChannel(
|
||||||
});
|
});
|
||||||
return [webhook.id, webhook.token!];
|
return [webhook.id, webhook.token!];
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
console.warn(`Error when trying to create webhook for ${pluginData.guild.id}/${channel.id}: ${err.message}`);
|
||||||
|
|
||||||
if (isDiscordAPIError(err) && err.code === 50013) {
|
if (isDiscordAPIError(err) && err.code === 50013) {
|
||||||
pluginData.state.missingPermissions = true;
|
pluginData.state.missingPermissions = true;
|
||||||
console.warn(`Error ${err.code} when trying to create webhook for ${pluginData.guild.id}`);
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
throw err;
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue