-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfancy.js
24 lines (21 loc) · 943 Bytes
/
fancy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const { zokou } = require("../framework/zokou");
const fancy = require("../commandes/style");
zokou({ nomCom: "fancy", categorie: "Fun", reaction: "〽️" }, async (dest, zk, commandeOptions) => {
const { arg, repondre, prefixe } = commandeOptions;
const id = arg[0]?.match(/\d+/)?.join('');
const text = arg.slice(1).join(" ");
try {
if (id === undefined || text === undefined) {
return await repondre(`\nExemple : ${prefixe}fancy 10 Anyway-Md\n` + String.fromCharCode(8206).repeat(4001) + fancy.list('ANYWAY-MD', fancy));
}
const selectedStyle = fancy[parseInt(id) - 1];
if (selectedStyle) {
return await repondre(fancy.apply(selectedStyle, text));
} else {
return await repondre('_Style introuvable :(_');
}
} catch (error) {
console.error(error);
return await repondre('_Une erreur s\'est produite :(_');
}
});