Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion cogs/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,19 @@ def on_member_update_check(m_before, m_after):
f"~~User {refreshed_author.mention} has potentially sent a message with their native "
f"language and is still untagged~~:\n"
f">>> ~~[{msg_content}](<{reaction.message.jump_url}>)~~")
await sent_msg.edit(content=new_msg)
if getattr(sent_msg.channel, "last_message_id", None) == sent_msg.id:
try:
await sent_msg.edit(content=new_msg)
return
except discord.HTTPException as e:
# Discord returns error code 30046 when a message is too old to keep editing.
if e.code != 30046:
raise
Comment thread
r-hensley marked this conversation as resolved.

try:
await sent_msg.delete()
except (discord.Forbidden, discord.NotFound, discord.HTTPException):
pass

utils.asyncio_task(check_untagged_jho_users)

Expand Down