aboutsummaryrefslogtreecommitdiff
path: root/discord/ext/commands/context.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-01-14 19:15:32 -0500
committerRapptz <[email protected]>2017-01-14 19:17:08 -0500
commitce9d5b4f4aeed4b7d586c4afe1e566a9548d9cf9 (patch)
tree125395e21a67555ad8f1c9ea98ddc52063fc81c8 /discord/ext/commands/context.py
parentShow inherited members in the docs for User and Member. (diff)
downloaddiscord.py-ce9d5b4f4aeed4b7d586c4afe1e566a9548d9cf9.tar.xz
discord.py-ce9d5b4f4aeed4b7d586c4afe1e566a9548d9cf9.zip
[commands] Split process_commands into lower level bits.
Diffstat (limited to 'discord/ext/commands/context.py')
-rw-r--r--discord/ext/commands/context.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py
index 59f09117..c1d120f3 100644
--- a/discord/ext/commands/context.py
+++ b/discord/ext/commands/context.py
@@ -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