fix(shard): 🐛 Payphone not sending messages when missing webhook permissions.

This commit is contained in:
2025-03-16 11:24:16 -03:00
parent e24e7fcb6d
commit 5c4248c749
+13 -2
View File
@@ -7,6 +7,8 @@ from discord.ext import commands
import aiohttp import aiohttp
import sentry_sdk
from payphone.db import models from payphone.db import models
from payphone.bot import Payphone from payphone.bot import Payphone
from payphone.cogs import base from payphone.cogs import base
@@ -157,7 +159,7 @@ class Calls(base.Cog):
if user.is_masked: if user.is_masked:
if participant is not None: 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)}**." message += f" You're currently being displayed as **{masks.get_mask_emoji(participant.mask)} {masks.get_mask_name(participant.mask)}**."
else: else:
message += " Participate in the call to see your mask." message += " Participate in the call to see your mask."
@@ -415,11 +417,20 @@ class Calls(base.Cog):
break break
except discord.errors.DiscordException: except discord.errors.NotFound:
await self.bot.call_handler.refresh_channel_webhook_url( await self.bot.call_handler.refresh_channel_webhook_url(
other_channel 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() @commands.Cog.listener()
async def on_raw_message_delete( async def on_raw_message_delete(
self, payload: discord.RawMessageDeleteEvent self, payload: discord.RawMessageDeleteEvent