2
0
mirror of https://github.com/Nick80835/microbot synced 2025-09-02 15:35:43 +00:00

improve raw_pattern

This commit is contained in:
Nick80835
2020-10-03 15:34:26 -04:00
parent a3a2e7fe60
commit a17651d70f
2 changed files with 9 additions and 5 deletions

View File

@@ -52,15 +52,20 @@ class CommandHandler():
if command.pass_nsfw:
event.nsfw_disabled = str(event.chat.id) in self.settings.get_list("nsfw_blacklist")
event.command = pattern_match.groups()[1]
if command.raw_pattern:
event.command = command.pattern
else:
event.command = pattern_match.groups()[1]
if event.chat and not command.not_disableable and event.command in self.loader.db.get_disabled_commands(event.chat.id):
print(f"Attempted command ({event.raw_text}) in chat which disabled it ({event.chat.id}) from ID {event.sender_id}")
return
if not command.raw_pattern:
event.args = pattern_match.groups()[-1].strip()
event.other_args = pattern_match.groups()[2:-1]
event.pattern_match = pattern_match
event.args = pattern_match.groups()[-1].strip()
event.other_args = pattern_match.groups()[2:-1]
event.extra = command.extra
event.object = command