mirror of
https://github.com/Nick80835/microbot
synced 2025-09-01 06:55:51 +00:00
fix inline
This commit is contained in:
@@ -60,7 +60,7 @@ class CommandHandler():
|
|||||||
pattern_match = search(self.inline_pattern_template.format(key), event.text)
|
pattern_match = search(self.inline_pattern_template.format(key), event.text)
|
||||||
|
|
||||||
if pattern_match:
|
if pattern_match:
|
||||||
if self.is_blacklisted(event):
|
if self.is_blacklisted(event, True):
|
||||||
print(f"Attempted command ({event.text}) from blacklisted ID {event.from_id}")
|
print(f"Attempted command ({event.text}) from blacklisted ID {event.from_id}")
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ class CommandHandler():
|
|||||||
pattern_match = search(self.inline_pattern_template.format(key), event.text)
|
pattern_match = search(self.inline_pattern_template.format(key), event.text)
|
||||||
|
|
||||||
if pattern_match:
|
if pattern_match:
|
||||||
if self.is_blacklisted(event):
|
if self.is_blacklisted(event, True):
|
||||||
print(f"Attempted command ({event.text}) from blacklisted ID {event.from_id}")
|
print(f"Attempted command ({event.text}) from blacklisted ID {event.from_id}")
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -164,8 +164,13 @@ class CommandHandler():
|
|||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def is_blacklisted(self, event):
|
def is_blacklisted(self, event, inline=False):
|
||||||
if str(event.from_id) in self.settings.get_list("blacklisted_users"):
|
if inline:
|
||||||
|
user_id = event.query.user_id
|
||||||
|
else:
|
||||||
|
user_id = event.from_id
|
||||||
|
|
||||||
|
if user_id in self.settings.get_list("blacklisted_users"):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
Reference in New Issue
Block a user