aboutsummaryrefslogtreecommitdiff
path: root/discord/ext/commands
diff options
context:
space:
mode:
Diffstat (limited to 'discord/ext/commands')
-rw-r--r--discord/ext/commands/context.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py
index efaa5b43..ff78c562 100644
--- a/discord/ext/commands/context.py
+++ b/discord/ext/commands/context.py
@@ -27,14 +27,14 @@ import asyncio
import discord.abc
import discord.utils
-class Context(discord.abc.MessageChannel):
+class Context(discord.abc.Messageable):
"""Represents the context in which a command is being invoked under.
This class contains a lot of meta data to help you understand more about
the invocation context. This class is not created manually and is instead
passed around to commands by passing in :attr:`Command.pass_context`.
- This class implements the :class:`abc.MessageChannel` ABC.
+ This class implements the :class:`abc.Messageable` ABC.
Attributes
-----------
@@ -117,8 +117,12 @@ class Context(discord.abc.MessageChannel):
ret = yield from command.callback(*arguments, **kwargs)
return ret
- def _get_destination(self):
- return self.channel.id, getattr(self.guild, 'id', None)
+ def _get_channel(self):
+ return self.channel
+
+ def _get_guild_id(self):
+ g = self.guild
+ return g.id if g is not None else None
@property
def cog(self):
@@ -129,13 +133,6 @@ class Context(discord.abc.MessageChannel):
return self.command.instance
@discord.utils.cached_property
- def id(self):
- # we need this to meet MessageChannel abc
- # it is purposefully undocumented because it makes no logistic sense
- # outside of providing the sugar of the main class.
- return self.channel.id
-
- @discord.utils.cached_property
def guild(self):
"""Returns the guild associated with this context's command. None if not available."""
return self.message.guild