[commands] Split process_commands into lower level bits.

This commit is contained in:
Rapptz
2017-01-14 19:15:32 -05:00
parent 87dc2f4dd3
commit ce9d5b4f4a
2 changed files with 108 additions and 59 deletions

View File

@ -117,6 +117,11 @@ class Context(discord.abc.Messageable):
ret = yield from command.callback(*arguments, **kwargs)
return ret
@property
def valid(self):
"""Checks if the invocation context is valid to be invoked with."""
return self.prefix is not None and self.command is not None
@asyncio.coroutine
def _get_channel(self):
return self.channel