Ajout /lyrics, /papa et /parle + Fix /crack

This commit is contained in:
Zachary Guénot
2023-06-11 01:14:49 +02:00
parent 7593c183ba
commit 432198c4f7
10 changed files with 166 additions and 14 deletions

View File

@@ -34,10 +34,13 @@ module.exports = {
let query = interaction.options.getString('jeu')
let games = await search(query, headers1)
if (!Array.isArray(games)) {
if (games.toString() == "TypeError: Cannot read properties of undefined (reading 'split')") return interaction.followUp({ content: `J'ai rien trouvé pour "${query}" !` })
else return interaction.followUp({ content: "Une erreur s'est produite ! ```" + games + "```" })
}
let game
if (games.length === 0) return await interaction.followUp({ content: `J'ai rien trouvé pour "${query}" !` })
else if (games.length > 1) {
if (games.length > 1) {
games = games.slice(0, 9)
let list = ''
for (let i = 0; i < games.length; i++) list += `\n${i + 1}. ${games[i].name} (${games[i].link})`
@@ -59,7 +62,6 @@ module.exports = {
game = games[index]
}
else game = games[0]
console.log(interaction.user.id)
let url = await repo(game, headers2)
let file = await torrent(url, headers2)