Skip to content

Blank lines in USAGE produce unwanted behavior with !help #71

@evstar3

Description

@evstar3

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions