aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drutils/converters.py2
-rw-r--r--examples/main.py16
2 files changed, 17 insertions, 1 deletions
diff --git a/drutils/converters.py b/drutils/converters.py
index 640a7a6..4354af1 100644
--- a/drutils/converters.py
+++ b/drutils/converters.py
@@ -21,7 +21,7 @@ class AugmentedConverter(Converter):
if isinstance(converter, Converter):
converter = converter.convert
result = await converter(ctx, argument)
- if await maybe_coroutine(self.filter_function(result)):
+ if await maybe_coroutine(self.filter_function, result):
return result
raise UserInputError()
diff --git a/examples/main.py b/examples/main.py
new file mode 100644
index 0000000..617b4aa
--- /dev/null
+++ b/examples/main.py
@@ -0,0 +1,16 @@
+from os import environ
+
+from discord.ext.commands import Bot, Greedy, MemberConverter
+
+from drutils import non_nullable
+
+bot = Bot(command_prefix="!")
+
+
+@bot.command()
+async def converter_test(ctx, members: Greedy[non_nullable(MemberConverter)]):
+ await ctx.send('\n'.join(member.name for member in members))
+
+
+if __name__ == '__main__':
+ bot.run(environ['TOKEN'])