fix(shard): 🐛 Fix not found in on_message() when replying to a bot within the same channel.
This commit is contained in:
@@ -285,10 +285,15 @@ class Calls(base.Cog):
|
||||
original_message_id is not None
|
||||
and original_message_id != replied_message.id
|
||||
):
|
||||
try:
|
||||
replied_message = await self.bot.get_partial_messageable(
|
||||
other_channel
|
||||
).fetch_message(original_message_id)
|
||||
|
||||
except discord.errors.NotFound:
|
||||
replied_message = None
|
||||
|
||||
if replied_message is not None:
|
||||
replied_message_content = self.bot.clean_message(replied_message)
|
||||
replied_participant = await call.get_participant(
|
||||
replied_message.author.id
|
||||
@@ -326,6 +331,11 @@ class Calls(base.Cog):
|
||||
"\n-# ⓘ In reply to a message from outside this call."
|
||||
)
|
||||
|
||||
else:
|
||||
message_content += (
|
||||
"\n-# ⓘ In reply to a message from outside this call."
|
||||
)
|
||||
|
||||
if was_mask_toggled:
|
||||
if not participant.is_masked:
|
||||
if participant.user.flag & models.UserFlag.SUPPORTER:
|
||||
@@ -367,7 +377,9 @@ class Calls(base.Cog):
|
||||
for _ in range(3):
|
||||
try:
|
||||
webhook = discord.Webhook.from_url(
|
||||
await self.bot.call_handler.get_channel_webhook_url(other_channel),
|
||||
await self.bot.call_handler.get_channel_webhook_url(
|
||||
other_channel
|
||||
),
|
||||
session=session,
|
||||
bot_token=constants.TOKEN,
|
||||
)
|
||||
@@ -390,7 +402,9 @@ class Calls(base.Cog):
|
||||
break
|
||||
|
||||
except discord.errors.DiscordException:
|
||||
await self.bot.call_handler.refresh_channel_webhook_url(other_channel)
|
||||
await self.bot.call_handler.refresh_channel_webhook_url(
|
||||
other_channel
|
||||
)
|
||||
|
||||
@commands.Cog.listener()
|
||||
async def on_raw_message_delete(
|
||||
|
||||
Reference in New Issue
Block a user