This commit is contained in:
git-bruh 2020-12-10 17:56:00 +05:30
parent fb7ecf1537
commit cf2358dbe8
No known key found for this signature in database
GPG key ID: E1475C50075ADCE6
3 changed files with 12 additions and 2 deletions

View file

@ -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
View file

@ -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():

View file

@ -1,2 +1,2 @@
discord.py==1.5.1
git+git://github.com/rapptz/discord.py@44dc7a8
matrix-nio==0.15.2