aboutsummaryrefslogtreecommitdiff
path: root/discord/ext
diff options
context:
space:
mode:
authorDice <[email protected]>2018-12-05 18:57:07 -0500
committerRapptz <[email protected]>2018-12-14 18:59:47 -0500
commitbda690c32fb7825676c253fd9ec9ad2734b637d4 (patch)
treec6d74ef6658c75104890ebc40f190050d641ef8d /discord/ext
parentHandle implicit perms in discord.VoiceChannel.permissions_for (diff)
downloaddiscord.py-bda690c32fb7825676c253fd9ec9ad2734b637d4.tar.xz
discord.py-bda690c32fb7825676c253fd9ec9ad2734b637d4.zip
[commands] Remove message being required from Role/Member converters.
This allows for easier "mock" context objects, for those who use converters as utility functions outside of commands, and it's more straightforward with the rest of the file.
Diffstat (limited to 'discord/ext')
-rw-r--r--discord/ext/commands/converter.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py
index dbd76c10..49fd3228 100644
--- a/discord/ext/commands/converter.py
+++ b/discord/ext/commands/converter.py
@@ -98,10 +98,9 @@ class MemberConverter(IDConverter):
"""
async def convert(self, ctx, argument):
- message = ctx.message
bot = ctx.bot
match = self._get_id_match(argument) or re.match(r'<@!?([0-9]+)>$', argument)
- guild = message.guild
+ guild = ctx.guild
result = None
if match is None:
# not a mention...
@@ -316,7 +315,7 @@ class RoleConverter(IDConverter):
3. Lookup by name
"""
async def convert(self, ctx, argument):
- guild = ctx.message.guild
+ guild = ctx.guild
if not guild:
raise NoPrivateMessage()