Skip to content

not accessing firestore data correctly #85

@KCreek1

Description

@KCreek1

I was going to work on having the bot not respond in bug reports. But I noticed that there are firestore_user errors for all messages and the bot is responding nowhere. This is on main without any of my changes on my branch.

Weezer"español"<the_nosiest_man_on_the_frontier 625964330223009792>:'A veure, sembla que tenim de tenir un xat per catala?'add_time_based_roles
check_firestore_and_add_roles_and_nick
Querying Firestore directly for user with Discord ID: 625964330223009792
add_og_role_from_firestore_user
add_roles_from_firestore_badges
ERROR:discord.client:Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\User\cuomputer\.k\Lib\site-packages\discord\client.py", line 449, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\User\cuomputer\bot\on_message\on_message.py", line 107, in on_message
    author, nick, firestore_user = await check_firestore_and_add_roles_and_nick(
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\cuomputer\bot\scripts\add_roles.py", line 207, in check_firestore_and_add_roles_and_nick
    await add_roles_from_firestore_badges(member, firestore_user, roles)
  File "C:\Users\User\cuomputer\bot\scripts\add_roles.py", line 291, in add_roles_from_firestore_badges
    badges = [x for x in firestore_user["badges"] if x != "Visitor"]
                         ~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'badges'
Weezer"🌟-general"<riversofstars 539068747466407936>:'i agree.'
add_time_based_roles
check_firestore_and_add_roles_and_nick
Querying Firestore directly for user with Discord ID: 539068747466407936
add_og_role_from_firestore_user
add_roles_from_firestore_badges
ERROR:discord.client:Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\User\cuomputer\.k\Lib\site-packages\discord\client.py", line 449, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\User\cuomputer\bot\on_message\on_message.py", line 107, in on_message
    author, nick, firestore_user = await check_firestore_and_add_roles_and_nick(
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\cuomputer\bot\scripts\add_roles.py", line 207, in check_firestore_and_add_roles_and_nick
    await add_roles_from_firestore_badges(member, firestore_user, roles)
  File "C:\Users\User\cuomputer\bot\scripts\add_roles.py", line 291, in add_roles_from_firestore_badges       
    badges = [x for x in firestore_user["badges"] if x != "Visitor"]
                         ~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'badges'
Weezer"RC-talk"<kristina_creek 1033109842778398883>:'Rivers?'
add_time_based_roles
check_firestore_and_add_roles_and_nick
Querying Firestore directly for user with Discord ID: 1033109842778398883
add_og_role_from_firestore_user
add_roles_from_firestore_badges
add_roles_from_firestore_bundles

ERROR:discord.client:Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\User\cuomputer\.k\Lib\site-packages\discord\client.py", line 449, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\User\cuomputer\bot\on_message\on_message.py", line 138, in on_message
    message.user_score = firestore_user["score"]
                         ~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'score'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions