Delete old webhook message on edit
This commit is contained in:
parent
2e6b979ffa
commit
d4551a5c61
1 changed files with 8 additions and 10 deletions
18
main.py
18
main.py
|
@ -239,16 +239,14 @@ class Callbacks(object):
|
|||
return
|
||||
|
||||
# https://github.com/Rapptz/discord.py/issues/6058
|
||||
# content_dict = event.source.get("content")
|
||||
# try:
|
||||
# if content_dict["m.relates_to"]["rel_type"] == "m.replace":
|
||||
# edited_event = content_dict["m.relates_to"]["event_id"]
|
||||
# edited_content = content_dict["m.new_content"]["body"]
|
||||
# webhook_message = message_cache[edited_event]
|
||||
# await something_edit_webhook(webhook_message, edited_content)
|
||||
# return
|
||||
# except KeyError:
|
||||
# pass
|
||||
content_dict = event.source.get("content")
|
||||
try:
|
||||
if content_dict["m.relates_to"]["rel_type"] == "m.replace":
|
||||
edited_event = content_dict["m.relates_to"]["event_id"]
|
||||
webhook_message = message_store[edited_event]
|
||||
await webhook_message.delete()
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
message = event.body
|
||||
|
||||
|
|
Loading…
Reference in a new issue