decorators.py 539 B

1234567891011121314
  1. def author_is_not_bot(func):
  2. async def wrapper(self, message, *args, **kwargs):
  3. if message.author == self.user:
  4. return None
  5. return await func(self, message, *args, **kwargs)
  6. return wrapper
  7. def notify_if_wrong_command(func):
  8. async def wrapper(self, message, *args, **kwargs):
  9. function_return = func(self, message, *args, **kwargs)
  10. if await function_return:
  11. await message.channel.send('I cant understand you :(\nType !help for available command list')
  12. return wrapper