aboutsummaryrefslogtreecommitdiff
path: root/discord/ext/commands/context.py
diff options
context:
space:
mode:
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