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

Commit

Permalink
fix coro stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
spookybear0 committed Oct 5, 2020
1 parent 89f8a04 commit a8e7f02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gdpys/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def get_daily_level(self) -> DailyLevel:
def command(self, name: str=None, permission: Permissions=None):
"""Decorator to create commands"""
def decorator(coro):
if not asyncio.iscoroutine(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()
Expand Down Expand Up @@ -120,4 +120,4 @@ async def _execute_command(self, command_obj : Comment):
)
return True

client = Client()
client = Client()

0 comments on commit a8e7f02

Please sign in to comment.