You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 {})"
The text was updated successfully, but these errors were encountered:
evstar3
changed the title
Blank lines in module USAGE produce unwanted behavior with !help
Blank lines in USAGE produce unwanted behavior with !help
Feb 10, 2023
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 bemessage.copy(body='')
. In thecopy
method, the body evaluates tofalse
and 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
The text was updated successfully, but these errors were encountered: