This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async def on_command_error(self, ctx, error): | |
# if command has local error handler, return | |
if hasattr(ctx.command, 'on_error'): | |
return | |
# get the original exception | |
error = getattr(error, 'original', error) | |
if isinstance(error, commands.CommandNotFound): | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
def pausable(pause, resume_check=None, delay_start=None, delay_resume=None): | |
def inner_wrapper(coro): | |
@asyncio.coroutine | |
def replacement_coro(*args, **kwargs): | |
for x in coro(*args, **kwargs): | |
try: | |
if delay_start is not None: | |
if asyncio.iscoroutinefunction(delay_start): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import types | |
import asyncio | |
import inspect | |
import time | |
class API: | |
# def __new__(cls, | |
def self_reference(function): |