Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when checking starboard message #456

Open
ToxicPie opened this issue May 3, 2021 · 0 comments
Open

Error when checking starboard message #456

ToxicPie opened this issue May 3, 2021 · 0 comments

Comments

@ToxicPie
Copy link
Contributor

ToxicPie commented May 3, 2021

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.

ToxicPie added a commit to ToxicPie/TLE that referenced this issue May 3, 2021
algmyr pushed a commit that referenced this issue Jul 18, 2021
algmyr added a commit that referenced this issue Jul 18, 2021
This reverts commit 2c0e2e8.
algmyr added a commit that referenced this issue Jul 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant