diff --git a/payphone/cogs/calls/cog.py b/payphone/cogs/calls/cog.py index 97cf297..9791689 100644 --- a/payphone/cogs/calls/cog.py +++ b/payphone/cogs/calls/cog.py @@ -479,17 +479,29 @@ class Calls(base.Cog): blocked_section = censorship.censor(payload.data["content"]) if blocked_section: - return ( - await self.bot.get_partial_messageable(payload.channel_id) - .get_partial_message(payload.message_id) - .reply( + try: + await self.bot.get_partial_messageable( + payload.channel_id + ).get_partial_message(payload.message_id).reply( ( "❌ Your message wasn't sent because it contained a blocked word or " f"pattern: `{blocked_section}`" ), delete_after=10, ) - ) + + except discord.errors.Forbidden: + await self.bot.get_partial_messageable(payload.channel_id).send( + ( + f"❌ **{payload.data["member"]["nick"] or payload.data["member"]["user"]["global_name"] or payload.data["member"]["user"]["username"]}** " + f"your message wasn't sent because it contained a blocked message or " + "pattern: `{blocked_section}`\n-# Payphone doesn't have read message history " + "permission? Make sure to keep that one enabled." + ), + delete_after=10, + ) + + return propagation = await call.get_message_propagation(payload.message_id)