Learn-Build-Teach / learn-build-teach-discord-bot

53 stars 17 forks source link

Fix issue where users with no username will cause kudos to not display. #50

Closed mhuggins7278 closed 2 years ago

mhuggins7278 commented 2 years ago

Currently if a user doesn't have a profile and they give or receive a kudo we create a profile for them but we don't know their username. This causes the leaderboard to throw an error when building the embed. All fields must have a value.

For now I think showing Unknow or something similiar is probably best.

We should fix the user upsert to look up the user to at least get the name. Or use the id to get the names here so we don't need to store them at all.

mhuggins7278 commented 2 years ago

Actually went with just looking the users up using the discord API that way if someone changes their name we don't show the old one