From 5c4248c7497f6b5245a45aef4a27bc4128e7bd85 Mon Sep 17 00:00:00 2001 From: Rafael Bradley Date: Sun, 16 Mar 2025 11:24:16 -0300 Subject: [PATCH] fix(shard): :bug: Payphone not sending messages when missing webhook permissions. --- payphone/cogs/calls/cog.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/payphone/cogs/calls/cog.py b/payphone/cogs/calls/cog.py index e445afe..0ad87f8 100644 --- a/payphone/cogs/calls/cog.py +++ b/payphone/cogs/calls/cog.py @@ -7,6 +7,8 @@ from discord.ext import commands import aiohttp +import sentry_sdk + from payphone.db import models from payphone.bot import Payphone from payphone.cogs import base @@ -157,7 +159,7 @@ class Calls(base.Cog): if user.is_masked: if participant is not None: message += f" You're currently being displayed as **{masks.get_mask_emoji(participant.mask)} {masks.get_mask_name(participant.mask)}**." - + else: message += " Participate in the call to see your mask." @@ -415,11 +417,20 @@ class Calls(base.Cog): break - except discord.errors.DiscordException: + except discord.errors.NotFound: await self.bot.call_handler.refresh_channel_webhook_url( other_channel ) + except discord.errors.Forbidden: + await self.bot.get_partial_messageable(other_channel).send( + "❌ **Payphone** is missing `Manage Webhooks` permissions. You won't see any messages while that permission is not set." + ) + break + + except discord.errors.DiscordException as exc: + sentry_sdk.capture_exception(exc) + @commands.Cog.listener() async def on_raw_message_delete( self, payload: discord.RawMessageDeleteEvent