From bef83719ea10ac5522517dbd182569d2e4dc6816 Mon Sep 17 00:00:00 2001 From: Gnome Date: Fri, 17 Sep 2021 20:30:49 +0100 Subject: [PATCH] Fix slash command quoting for *args --- discord/ext/commands/bot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index 8973e8ec..7abd6c8a 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -1290,7 +1290,11 @@ class BotBase(GroupMixin): raise errors.MissingRequiredArgument(param) else: ignore_params.append(param) - elif option["type"] == 3 and param.kind != param.KEYWORD_ONLY and not isinstance(param.annotation, Greedy): + elif ( + option["type"] == 3 + and not isinstance(param.annotation, Greedy) + and param.kind in {param.POSITIONAL_OR_KEYWORD, param.POSITIONAL_ONLY} + ): # String with space in without "consume rest" option = cast(_ApplicationCommandInteractionDataOptionString, option) message.content += f"{_quote_string_safe(option['value'])} "