codinglab-io / discord-bot

Discord bot for Codinglab's server.
https://discord.com/invite/codinglab-174169014568878080
MIT License
18 stars 14 forks source link

The bot do not work after ~40min dev time #121

Open neolectron opened 9 months ago

neolectron commented 9 months ago

After working on the bot for a while, the function that push the commands do stale indefinitely.

The Rest.put call that push all commands blocks, and I believe we do get timeout by discord for doing that so often. (each code reload)

Proposal

Use Rest.get to get all commands schemas and diff with the one we have locally, if nothing change: don't push, if a command schema change: push only the changed command.

potb commented 9 months ago

I suggest we store that result in a database so we don't even have to request for the latest commands