From e73f24b727d60b557c20ecd76abf56127dd802fd Mon Sep 17 00:00:00 2001 From: krazykirby99999 Date: Wed, 24 Nov 2021 18:49:23 -0600 Subject: [PATCH] Fix messagemath.mention. "body" is now a tuple instead of a list --- simplematrixbotlib/match.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/simplematrixbotlib/match.py b/simplematrixbotlib/match.py index 4807cce..6a44de1 100644 --- a/simplematrixbotlib/match.py +++ b/simplematrixbotlib/match.py @@ -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):