fix(shard): 🐛 Edits not responding when Payphone doesn't have Read Message History permissions.
This commit is contained in:
@@ -479,17 +479,29 @@ class Calls(base.Cog):
|
|||||||
blocked_section = censorship.censor(payload.data["content"])
|
blocked_section = censorship.censor(payload.data["content"])
|
||||||
|
|
||||||
if blocked_section:
|
if blocked_section:
|
||||||
return (
|
try:
|
||||||
await self.bot.get_partial_messageable(payload.channel_id)
|
await self.bot.get_partial_messageable(
|
||||||
.get_partial_message(payload.message_id)
|
payload.channel_id
|
||||||
.reply(
|
).get_partial_message(payload.message_id).reply(
|
||||||
(
|
(
|
||||||
"❌ Your message wasn't sent because it contained a blocked word or "
|
"❌ Your message wasn't sent because it contained a blocked word or "
|
||||||
f"pattern: `{blocked_section}`"
|
f"pattern: `{blocked_section}`"
|
||||||
),
|
),
|
||||||
delete_after=10,
|
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)
|
propagation = await call.get_message_propagation(payload.message_id)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user