mirror of
https://github.com/Nick80835/microbot
synced 2025-08-30 22:16:05 +00:00
small fixup and implement nsfw filtering
This commit is contained in:
@@ -33,6 +33,10 @@ class CommandHandler():
|
||||
print(f"Attempted admin command ({event.text}) from ID {event.from_id}")
|
||||
continue
|
||||
|
||||
if value["nsfw"] and str(event.chat.id) in self.settings.get_list("nsfw_blacklist"):
|
||||
print(f"Attempted NSFW command ({event.text}) in blacklisted chat ({event.chat_id}) from ID {event.from_id}")
|
||||
continue
|
||||
|
||||
event.pattern_match = pattern_match
|
||||
event.args = pattern_match.groups()[-1]
|
||||
event.extras = value["extras"]
|
||||
|
@@ -33,7 +33,8 @@ class Settings():
|
||||
else:
|
||||
config_list = []
|
||||
|
||||
config_list.append(value)
|
||||
if value not in config_list:
|
||||
config_list.append(value)
|
||||
|
||||
self.config.set("DEFAULT", key, "|".join(config_list))
|
||||
self.write_changes()
|
||||
|
Reference in New Issue
Block a user