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

Commit

Permalink
Fix messagemath.mention.
Browse files Browse the repository at this point in the history
"body" is now a tuple instead of a list
  • Loading branch information
krazykirby99999 committed Nov 25, 2021
1 parent d6a3a34 commit e73f24b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions simplematrixbotlib/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ def mention(self):
Returns True if the message begins with the bot's username, MXID, or pill targeting the MXID, and False otherwise.
"""

for i in [self._display_name, self._disambiguated_name, self.room.own_user_id, self._pill]:
body = self.event.formatted_body or self.event.body
if body.startswith(i):
return True

for body in (self.event.formatted_body, self.event.body):
for id in [self._display_name, self._disambiguated_name, self.room.own_user_id, self._pill]:
if body.startswith(id):
return True
return False

def args(self):
Expand Down

0 comments on commit e73f24b

Please sign in to comment.