Skip to content
This repository has been archived by the owner on Jun 10, 2023. It is now read-only.

Commit

Permalink
Update client.py
Browse files Browse the repository at this point in the history
  • Loading branch information
spookybear0 committed Oct 6, 2020
1 parent 918d250 commit 96bba73
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions gdpys/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
from config import user_config
from exceptions import GDPySCommandError
from objects.levels import Level, Rating, DailyLevel
global name
global permission

COMMANDS = {}

Expand Down Expand Up @@ -75,10 +73,10 @@ def command(self, name: str=None, permission: Permissions=None):
def decorator(coro):
if not coro.__code__.co_flags & 0x0080 or getattr(coro, '_is_coroutine', False):
raise Exception("Function is not a coroutine function!")
if name is None:
name = coro.__name__.lower()
if name is None: # noqa
name = coro.__name__.lower() # noqa
loop = asyncio.get_event_loop()
loop.create_task(self.create_command(name, coro, permission))
loop.create_task(self.create_command(name, coro, permission)) # noqa

return decorator

Expand Down

0 comments on commit 96bba73

Please sign in to comment.