From ce9d5b4f4aeed4b7d586c4afe1e566a9548d9cf9 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 14 Jan 2017 19:15:32 -0500 Subject: [commands] Split process_commands into lower level bits. --- discord/ext/commands/context.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'discord/ext/commands/context.py') 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 -- cgit v1.2.3