Handle /me messages properly
This commit is contained in:
parent
6d34130f7f
commit
0815ac170f
1 changed files with 8 additions and 5 deletions
13
main.py
13
main.py
|
@ -246,6 +246,12 @@ class Callbacks(object):
|
||||||
|
|
||||||
content_dict = event.source.get("content")
|
content_dict = event.source.get("content")
|
||||||
|
|
||||||
|
author = event.sender[1:]
|
||||||
|
avatar = None
|
||||||
|
|
||||||
|
homeserver = author.split(":")[-1]
|
||||||
|
url = "https://matrix.org/_matrix/media/r0/download"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if content_dict["m.relates_to"]["m.in_reply_to"]["event_id"] in \
|
if content_dict["m.relates_to"]["m.in_reply_to"]["event_id"] in \
|
||||||
message_store.values():
|
message_store.values():
|
||||||
|
@ -253,11 +259,8 @@ class Callbacks(object):
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
author = event.sender[1:]
|
if content_dict["msgtype"] == "m.emote":
|
||||||
avatar = None
|
message = f"* {author.split(':')[0]} {message}"
|
||||||
|
|
||||||
homeserver = author.split(":")[-1]
|
|
||||||
url = "https://matrix.org/_matrix/media/r0/download"
|
|
||||||
|
|
||||||
message = await self.process_message(message)
|
message = await self.process_message(message)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue