mirror of
https://github.com/Nick80835/microbot
synced 2025-09-02 15:35:43 +00:00
improve raw_pattern
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user