serenity-rs / poise

Discord bot command framework for serenity, with advanced features like edit tracking and flexible argument parsing
MIT License
624 stars 111 forks source link

paginate: use saved ID instead of regenerating each time #201

Closed seqre closed 12 months ago

seqre commented 12 months ago

poise::builtins::paginate uses ctx.id() to generate one common prefix for unique button IDs. However, instead of using that prefix, it generates a new ID for each button. This PR fixes this and uses the prefix ID generated once at the beginning.

kangalio commented 12 months ago

Good catch

kangalio commented 12 months ago

Actually, ctx.id() always gives the same result so this wasn't a bug fix but purely a source code aesthetics change. Still good tho