Remove bot username if replying

This commit is contained in:
git-bruh 2020-12-07 18:48:45 +05:30
parent 3d84ce1143
commit 3b2945ee26
No known key found for this signature in database
GPG key ID: E1475C50075ADCE6

View file

@ -243,6 +243,15 @@ class Callbacks(object):
if not message: if not message:
return return
content_dict = event.source.get("content")
try:
if content_dict["m.relates_to"]["m.in_reply_to"]["event_id"] in \
message_store.values():
message = message.replace(f"<{config['username']}>", "", 1)
except KeyError:
pass
author = event.sender[1:] author = event.sender[1:]
avatar = None avatar = None