fix(shard): 🐛 Edits not responding when Payphone doesn't have Read Message History permissions.

This commit is contained in:
2025-03-16 11:43:31 -03:00
parent 4360d0b053
commit 513b52f940
+17 -5
View File
@@ -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)