hi, im working on a bot but im trying to minimize memory leaks and boost performance because it will be listening to tons of events
I dont know whats the best way to handle events and interactions in this case, so whats the best way?
Ive seen people use a 'command dispatcher' that basically sends interactions to the respective file, so for example
if you have a button with custom id 'hi123' then your button file would like like
export default {
customId: 'hi123',
async execute(interaction: ButtonInteraction, client: CustomClient) {
then you put the code here and the dispatcher automatically runs this code when a button with customId 'hi123' is clicked, I can show the full files is needed
}
}
to sum everything, I'm asking whats the best way performance-wise to handle interactions?