Up the timeout for the help command

This commit is contained in:
Michael 2022-12-18 00:59:16 -06:00
parent fb7b87c291
commit 611633ce8c

View file

@ -35,13 +35,19 @@ module.exports = {
const numberOfCommands = Object.keys(helpFile).length; const numberOfCommands = Object.keys(helpFile).length;
const pageTotal = String(Math.ceil(numberOfCommands / commandsPerPage)); const pageTotal = String(Math.ceil(numberOfCommands / commandsPerPage));
let userRoleColor = Number('0x' + interaction.member.displayHexColor.split('#')[1]);
// This will also unintentionally catch roles with full black color (#000000), but it should be fine.
if (userRoleColor == 0) {
userRoleColor = Number(0x55ffff);
}
if (pageNumber > pageTotal) { if (pageNumber > pageTotal) {
pageNumber = 1; pageNumber = 1;
} }
let embedPartOne = { let embedPartOne = {
color: 0x0099ff, color: userRoleColor,
title: 'Help Text', title: 'Help Text',
description: `Page ${pageNumber} of ${pageTotal}`, description: `Page ${pageNumber} of ${pageTotal}`,
}; };
@ -142,7 +148,7 @@ module.exports = {
} }
// Button code // Button code
const collector = interaction.channel.createMessageComponentCollector({ time: 60000 }); const collector = interaction.channel.createMessageComponentCollector({ time: 300000 });
collector.on('collect', async i => { collector.on('collect', async i => {
@ -155,7 +161,7 @@ module.exports = {
// Replicate the above code to remake the help model for the new page. Again, there has to be an easier way to do this. // Replicate the above code to remake the help model for the new page. Again, there has to be an easier way to do this.
embedPartOne = { embedPartOne = {
color: 0x0099ff, color: userRoleColor,
title: 'Help Text', title: 'Help Text',
description: `Page ${pageNumber} of ${pageTotal}`, description: `Page ${pageNumber} of ${pageTotal}`,
}; };
@ -257,5 +263,6 @@ module.exports = {
}); });
await interaction.reply({ embeds: [Object.assign({}, embedPartOne, JSON.parse(embedPartTwo))], components: [ buttonList ], ephemeral: true }); await interaction.reply({ embeds: [Object.assign({}, embedPartOne, JSON.parse(embedPartTwo))], components: [ buttonList ], ephemeral: true });
}, },
}; };