diff --git a/backend/src/plugins/InternalPoster/functions/getOrCreateWebhookForChannel.ts b/backend/src/plugins/InternalPoster/functions/getOrCreateWebhookForChannel.ts index ec05f473..9d2fb029 100644 --- a/backend/src/plugins/InternalPoster/functions/getOrCreateWebhookForChannel.ts +++ b/backend/src/plugins/InternalPoster/functions/getOrCreateWebhookForChannel.ts @@ -35,12 +35,13 @@ export async function getOrCreateWebhookForChannel( }); return [webhook.id, webhook.token!]; } catch (err) { + console.warn(`Error when trying to create webhook for ${pluginData.guild.id}/${channel.id}: ${err.message}`); + if (isDiscordAPIError(err) && err.code === 50013) { pluginData.state.missingPermissions = true; - console.warn(`Error ${err.code} when trying to create webhook for ${pluginData.guild.id}`); - return null; } - throw err; + + return null; } }