Webhook messages can now be edited (https://github.com/Rapptz/discord.py/issues/6058)
This commit is contained in:
parent
fb7ecf1537
commit
cf2358dbe8
3 changed files with 12 additions and 2 deletions
|
@ -21,5 +21,5 @@ NOTE: [Privileged Intents](https://discordpy.readthedocs.io/en/latest/intents.ht
|
|||
- [x] Attachments (Converted to URLs)
|
||||
- [x] Typing status (Not very accurate)
|
||||
- [x] Redacting messages
|
||||
- [x] Editing messages (Partial, see [this issue](https://github.com/Rapptz/discord.py/issues/6058))
|
||||
- [x] Editing messages
|
||||
- [x] Replies
|
||||
|
|
10
main.py
10
main.py
|
@ -255,6 +255,16 @@ class Callbacks(object):
|
|||
homeserver = event.sender.split(":")[-1]
|
||||
url = "https://matrix.org/_matrix/media/r0/download"
|
||||
|
||||
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_store[edited_event]
|
||||
await webhook_message.edit(content=edited_content)
|
||||
return
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
if content_dict["m.relates_to"]["m.in_reply_to"]["event_id"] in \
|
||||
message_store.values():
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
discord.py==1.5.1
|
||||
git+git://github.com/rapptz/discord.py@44dc7a8
|
||||
matrix-nio==0.15.2
|
||||
|
|
Loading…
Reference in a new issue