Skip to content
This repository was archived by the owner on May 25, 2021. It is now read-only.

Commit 7a0090d

Browse files
author
dragdev
committed
Fix global converter
1 parent 91c6a8d commit 7a0090d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

riftgun/converters.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def convertSync(ctx, argument: str) -> discord.TextChannel:
3939
"""Converts a provided argument to a text channel."""
4040
if argument.isdigit(): argument = int(argument)
4141

42-
def match(channel: typing.Union[discord.TextChannel, discord.VoiceChannel, discord.CategoryChannel]):
42+
def match(channel: discord.TextChannel):
4343
if channel.id == argument:
4444
return True
4545
else:
@@ -50,10 +50,7 @@ def match(channel: typing.Union[discord.TextChannel, discord.VoiceChannel, disco
5050
elif argument in channel.name:
5151
return True
5252

53-
channel = discord.utils.find(match, sorted(ctx.bot.channels, key=lambda x: x.last_message))
53+
channel = discord.utils.find(match, sorted(ctx.bot.text_channels, key=lambda x: x.last_message))
5454

5555
if channel: return channel
56-
else: raise commands.BadArgument(f"Unable to convert \"{argument}\" to TextChannel, globally or locally.")
57-
58-
def __call__(self, *args, **kwargs):
59-
self.convertSync(args[0], args[1])
56+
else: raise commands.BadArgument(f"Unable to convert \"{argument}\" to TextChannel, globally or locally.")

0 commit comments

Comments
 (0)