TwitchIO
TwitchIO copied to clipboard
User input is not properly tokenized
The ext.commands.stringparser.StringParser.process_string
method doesn't properly tokenize input if there is no space before a "
. This is due to setting the start of the word after the "
, dropping everything before it. As such, something like foo"bar"
will be tokenized as ["bar"]
-- it should be tokenized as ["foo", "bar"]
.
I believe the following code will fix this, though I haven't been able to test it yet:
elif loc == '"':
if not self.ignore:
if self.start != self.count:
self.words[self.index] = msg[self.start : self.count]
self.index += 1
self.start = self.count + 1
self.ignore = True
If I get some time this week, I'll attempt to PR this.
Thank you!
Hello! Thanks for the issue. If this is a general help question, for a faster response consider joining the official Discord Server
Else if you have an issue with the library please wait for someone to help you here.