Closed alexraskin closed 7 months ago
Invocation-Based Syncing: The bot now syncs its command tree with Discord exclusively when the
sync
command is invoked, aligning with best practices guidance.
Hi, I can't help but notice that your best practices link is to a discord channel - those who aren't in the channel can't view it. Would appreciate if you could link us publicly viewable sources on this! Thanks!
That's great! Would appreciate if Danny put things like this into his official docs next time...
This PR looks good to me, but if we're switching to invoc-based syncing, the repo docs will need to be updated to include that. I'll merge it for now, and think about how to represent this in the docs after.
Yeah, I agree, strange it's not included.
I can work on updating the docs tomorrow.
I've updated a section about updating code in the README - not sure if it helps
Thanks for the contribution!
Invocation-Based Syncing: The bot now syncs its command tree with Discord exclusively when the
sync
command is invoked, aligning with best practices guidance.The
on_ready
function is triggered each time the bot connects or reconnects to Discord. If command syncing is placed within this function, it might lead to duplicate syncs, especially in cases of network instability or bot reconnections. This can result in redundant API calls and potential rate limit issues. Excessive command syncing can waste limited API resources and might even temporarily disable bot functionality if rate limits are exceeded. It also risks inconsistency in command availability if syncs are inadvertently triggered multiple times.TL;DR: Updated command syncing to trigger only on command invocation, optimizing API usage and enhancing user experience.
Also this