Renommage types any et fix /crack

This commit is contained in:
Angels-dev
2024-09-12 00:31:52 +02:00
parent e2e980bc47
commit f9d592ebc2
13 changed files with 32 additions and 30 deletions

View File

@@ -28,14 +28,14 @@ export default {
for (let i = 0; i < games.length; i++) await message.react(emojis[i])
// Wait for a reaction to be added by the interaction author.
const filter: any = (reaction: MessageReaction, user: User) => { if (reaction.emoji.name) return emojis.includes(reaction.emoji.name) && user.id === interaction.user.id }
const filter = (reaction: MessageReaction, user: User) => { if (reaction.emoji.name) { return emojis.includes(reaction.emoji.name) && user.id === interaction.user.id } return false }
await message.awaitReactions({ filter, max: 1, time: 5000, errors: ['time'] }).then(collected => {
console.log(collected)
if (!collected.first) return
let reaction = collected.first()
let index = emojis.indexOf(reaction?.emoji.name ?? '')
game = games[index]
}).catch(() => { return interaction.followUp({ content: 'T\'as mis trop de temps à choisir !' }) })
}).catch(() => { return interaction.followUp({ content: "T'as mis trop de temps à choisir !" }) })
}
else game = games[0]