codewars / discord-bot

Codewars Discord Bot
MIT License
21 stars 11 forks source link

CW Discord Bot failed to track number of server users for almost a month's time #78

Closed ejini6969 closed 1 year ago

ejini6969 commented 1 year ago

Same count of user is displayed throughout this period of time!

In 13th December 2022

image

In 31st December 2022

image

In 8th January 2023

image

kazk commented 1 year ago

It's returning a cached value. When we had the bot on Heroku, this wasn't as noticeable because Heroku restarted the bot once a day.

If anyone wants to contribute, I'd start from https://discordjs.guide/miscellaneous/cache-customization.html#sweeping-caches

kazk commented 1 year ago

Maybe we just need to call guild.fetch() in

https://github.com/codewars/discord-bot/blob/c5017021634155e4c14963c06ca0c2f395b9616e/src/commands/info.ts#L25-L29

kazk commented 1 year ago

Fixed with #81.