2
0
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:
Nick80835
2020-06-09 21:16:18 -04:00
parent eb8c20cffb
commit f7b01bcebc
2 changed files with 6 additions and 1 deletions

View File

@@ -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"]

View File

@@ -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()