Overview
Calling !help on a module with a blank line in its USAGE produces unwanted behavior.
Okay, why?
When !help is called, Bobbit produces a message with message.copy() for each line in USAGE. When there is a blank line in USAGE, one of these calls will be message.copy(body=''). In the copy method, the body evaluates to false and the original body of the !help command is copied. Because message.copy() also copies the nick, Bobbit sees this message as a command invocation and replies to it.
Affected Modules
Note: this list was made with the following dope one-liner
find src/bobbit/modules -maxdepth 1 -type f | xargs -I {} sh -c "sed -ne \"/USAGE[^=]*=/,/'''/p\" {} | grep -qE '^$' && echo \$(basename {})"
archive.py
bodule.py
brainfuck.py
clap.py
copypasta.py
googletranslate.py
grab.py
humanity.py
karma.py
metar.py
mock.py
rpcs.py
weather.py
wttr.py
Overview
Calling
!helpon a module with a blank line in its USAGE produces unwanted behavior.Okay, why?
When !help is called, Bobbit produces a message with
message.copy()for each line in USAGE. When there is a blank line in USAGE, one of these calls will bemessage.copy(body=''). In thecopymethod, the body evaluates tofalseand the original body of the !help command is copied. Becausemessage.copy()also copies thenick, Bobbit sees this message as a command invocation and replies to it.Affected Modules
archive.py
bodule.py
brainfuck.py
clap.py
copypasta.py
googletranslate.py
grab.py
humanity.py
karma.py
metar.py
mock.py
rpcs.py
weather.py
wttr.py