discordconsole-team / DiscordConsole

Control your Discord & Discord bot accounts and Webhooks through the command line.
GNU General Public License v3.0
90 stars 8 forks source link

Can't use double quotes with the command-line argument "-x" #58

Open Thefakewhitefang opened 1 year ago

Thefakewhitefang commented 1 year ago

DiscordConsole does not treat strings enclosed in double quotes as such. So when I run the command: DiscordConsole.exe -x "game listening "A B C" "D E F" "G H I""

It runs the executable but gives the output

> game listening A
> ^C
exit

Whereas the expected output would be > game listening "A B C" "D E F" "G H I"

Is this the expected result? I have also tried using double-double-quotes but it seems to remove them too.

Mnpn commented 1 year ago

Hi there! The quote before the A in "A B C" ends up closing the first quote before game, this results in what you're seeing with only "game listening "A being counted as the argument to -x. Perhaps the following image explains it better:

Screenshot 2023-03-07 at 20 22 07

You can work around this by mixing single and double quotes like this: DiscordConsole.exe -x "game listening 'A B C' 'D E F' 'G H I'", or by escaping the inner quotes with backslashes like this: DiscordConsole.exe -x "game listening \"A B C\" \"D E F\" \"G H I\"".

Screenshot 2023-03-07 at 20 24 18 Screenshot 2023-03-07 at 20 42 51

However, I should note that I'm afraid Discord's API has changed too much since DiscordConsole was last actively maintained & updated, and game statuses might no longer work since they has been updated to "activities" - YMMV unfortunately.