Skip to content
This repository was archived by the owner on May 22, 2024. It is now read-only.

Commit e73f24b

Browse files
author
krazykirby99999
committed
Fix messagemath.mention.
"body" is now a tuple instead of a list
1 parent d6a3a34 commit e73f24b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

simplematrixbotlib/match.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ def mention(self):
156156
Returns True if the message begins with the bot's username, MXID, or pill targeting the MXID, and False otherwise.
157157
"""
158158

159-
for i in [self._display_name, self._disambiguated_name, self.room.own_user_id, self._pill]:
160-
body = self.event.formatted_body or self.event.body
161-
if body.startswith(i):
162-
return True
163-
159+
for body in (self.event.formatted_body, self.event.body):
160+
for id in [self._display_name, self._disambiguated_name, self.room.own_user_id, self._pill]:
161+
if body.startswith(id):
162+
return True
163+
164164
return False
165165

166166
def args(self):

0 commit comments

Comments
 (0)