Skip to content

bot.db.get_channel_value(chan, key, False) is returning a string instead of a bool #2672

@myano

Description

@myano

Description

If you have data in the default database and you try to pull it out using:

bot.db.get_channel_value(chan, key, False)

The docs say, https://sopel.chat/docs/package/db.html#sopel.db.SopelDB.get_channel_value

"default – value to return if key does not have a value set (optional)"

If you put in False as the third parameter, I'd expect a bool to be returned, but rather it is a string of "False"

Relevant code snippets:

Thank you for taking a look. I love what Sopel as become!

Reproduction steps

  1. bot.db.set_channel_value("##test", "blah")
  2. bot.db.get_channel_value("##test", "blah", False)

Expected behavior

I expect to get a type of bool of False rather than a string of "False"

Relevant logs

Notes

No response

Sopel version

8.0.2

Installation method

pip install

Python version

3.11.2

Operating system

Debian 12

IRCd

Libera.Chat

Relevant plugins

custom plugin

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugThings to squish; generally used for issuesMedium Priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions