Download scripts/cmds/emojimix.js from sweet2004/bot: direct link, hf CLI and curl.
- Browser
- Download file 1.67 kB
-
https://huggingface.co/spaces/sweet2004/bot/resolve/main/scripts/cmds/emojimix.js
- Command line
-
hf download hf://spaces/sweet2004/bot/scripts/cmds/emojimix.js
-
curl -L -o emojimix.js https://huggingface.co/spaces/sweet2004/bot/resolve/main/scripts/cmds/emojimix.js
1.67 kB
| const axios = require("axios"); | |
| module.exports = { | |
| config: { | |
| name: "emojimix", | |
| version: "1.3", | |
| author: "NTKhang", | |
| countDown: 5, | |
| role: 0, | |
| shortDescription: "Mix 2 emoji", | |
| longDescription: { | |
| vi: "Mix 2 emoji lại với nhau", | |
| en: "Mix 2 emoji together" | |
| }, | |
| guide: { | |
| vi: " {pn} <emoji1> <emoji2>" | |
| + "\n Ví dụ: {pn} 🤣 🥰", | |
| en: " {pn} <emoji1> <emoji2>" | |
| + "\n Example: {pn} 🤣 🥰" | |
| }, | |
| category: "fun" | |
| }, | |
| langs: { | |
| vi: { | |
| error: "Rất tiếc, emoji %1 và %2 không mix được", | |
| success: "Emoji %1 và %2 mix được %3 ảnh" | |
| }, | |
| en: { | |
| error: "Sorry, emoji %1 and %2 can't mix", | |
| success: "Emoji %1 and %2 mix %3 images" | |
| } | |
| }, | |
| onStart: async function ({ message, args, getLang }) { | |
| const readStream = []; | |
| const emoji1 = args[0]; | |
| const emoji2 = args[1]; | |
| if (!emoji1 || !emoji2) | |
| return message.SyntaxError(); | |
| const generate1 = await generateEmojimix(emoji1, emoji2); | |
| const generate2 = await generateEmojimix(emoji2, emoji1); | |
| if (generate1) | |
| readStream.push(generate1); | |
| if (generate2) | |
| readStream.push(generate2); | |
| if (readStream.length == 0) | |
| return message.reply(getLang("error", emoji1, emoji2)); | |
| message.reply({ | |
| body: getLang("success", emoji1, emoji2, readStream.length), | |
| attachment: readStream | |
| }); | |
| } | |
| }; | |
| async function generateEmojimix(emoji1, emoji2) { | |
| try { | |
| const { data: response } = await axios.get("https://goatbotserver.onrender.com/taoanhdep/emojimix", { | |
| params: { | |
| emoji1, | |
| emoji2 | |
| }, | |
| responseType: "stream" | |
| }); | |
| response.path = `emojimix${Date.now()}.png`; | |
| return response; | |
| } | |
| catch (e) { | |
| return null; | |
| } | |
| } |