Skip to content

Error when checking starboard message #456

@ToxicPie

Description

@ToxicPie

If check_exists_starboard_message is called when the message to check is on the starboard, it will throw the following error:

Ignoring exception in on_raw_reaction_add
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.9/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "/home/user/tle/cogs/starboard.py", line 35, in on_raw_reaction_add
    await self.check_and_add_to_starboard(starboard_channel_id, payload)
  File "/home/user/tle/cogs/starboard.py", line 99, in check_and_add_to_starboard
    if self.db.check_exists_starboard_message(message.id):
  File "/home/user/tle/util/db/user_db_conn.py", line 481, in check_exists_starboard_message
    res = self.conn.execute(query, (original_msg_id,)).fetchone()
  File "/home/user/tle/util/db/user_db_conn.py", line 60, in namedtuple_factory
    return Row(*row)
TypeError: <lambda>() takes 1 positional argument but 2 were given

This is probably caused by the query SELECT 1 FROM starboard_message WHERE original_msg_id = ? (source): if it returns a row, then there would have a column named 1, which is not an identifier and makes namedtuple_factory create an incorrect number of fields.

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