Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
xditya authored Apr 30, 2020
1 parent 2e51930 commit 0d54f8d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions userbot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import inspect

def command(**args):
args["func"] = lambda e: e.via_bot_id is None

stack = inspect.stack()
previous_stack_frame = stack[1]
file_test = Path(previous_stack_frame.filename)
Expand Down Expand Up @@ -130,6 +132,8 @@ def remove_plugin(shortname):
raise ValueError

def admin_cmd(pattern=None, **args):
args["func"] = lambda e: e.via_bot_id is None

stack = inspect.stack()
previous_stack_frame = stack[1]
file_test = Path(previous_stack_frame.filename)
Expand Down Expand Up @@ -189,6 +193,8 @@ def admin_cmd(pattern=None, **args):

def register(**args):
""" Register a new event. """
args["func"] = lambda e: e.via_bot_id is None

stack = inspect.stack()
previous_stack_frame = stack[1]
file_test = Path(previous_stack_frame.filename)
Expand Down

0 comments on commit 0d54f8d

Please sign in to comment.