Skip to content

Commit

Permalink
🐐 🔵
Browse files Browse the repository at this point in the history
  • Loading branch information
franceking1 authored Jul 5, 2024
1 parent 93dab54 commit 13fedc7
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions commands/Quote.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const { king } = require('../france/king');

king({ nomCom: 'quote', categorie: 'Group' }, async (dest, zk, commandeOptions) => {
const { ms, repondre, verifGroupe, arg } = commandeOptions;
if (!verifGroupe) {
repondre('Commande réservée au groupe uniquement');
return;
}

if (!arg[0]) {
try {
fetch('https://animechan.xyz/api/random')
.then((response) => response.json())
.then(async (quote) => {
repondre(`*FLASH-MD Quotes*
🎬 Anime: ${quote.anime}
👤 Character: ${quote.character}
💬 Quote: ${quote.quote}
Powered by *France King*`);
});
} catch (e) {
repondre('Erreur lors de la génération de la citation : ' + e.message);
}
} else {
const query = arg.join(' ');

try {
fetch('https://animechan.xyz/api/random/character?name=' + query)
.then((response) => response.json())
.then(async (quote) => {
repondre(`FLASH-MD
🎬 Anime: ${quote.anime}
👤 Character: ${quote.character}
💬 Quote: ${quote.quote}
Powered by FLASH-MD`);
});
} catch (e) {
repondre('Erreur lors de la génération de la citation : ' + e.message);
}
}
});

0 comments on commit 13fedc7

Please sign in to comment.