Download scripts/cmds/batslap.js from bot512/5121512: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/spaces/bot512/5121512/resolve/main/scripts/cmds/batslap.js
- Command line
-
hf download hf://spaces/bot512/5121512/scripts/cmds/batslap.js
-
curl -L -o batslap.js https://huggingface.co/spaces/bot512/5121512/resolve/main/scripts/cmds/batslap.js
1.23 kB
| const DIG = require("discord-image-generation"); | |
| const fs = require("fs-extra"); | |
| module.exports = { | |
| config: { | |
| name: "batslap", | |
| version: "1.1", | |
| author: "NTKhang", | |
| countDown: 5, | |
| role: 0, | |
| shortDescription: "Batslap image", | |
| longDescription: "Batslap image", | |
| category: "image", | |
| guide: { | |
| en: " {pn} @tag" | |
| } | |
| }, | |
| langs: { | |
| vi: { | |
| noTag: "Bạn phải tag người bạn muốn tát" | |
| }, | |
| en: { | |
| noTag: "You must tag the person you want to slap" | |
| } | |
| }, | |
| onStart: async function ({ event, message, usersData, args, getLang }) { | |
| const uid1 = event.senderID; | |
| const uid2 = Object.keys(event.mentions)[0]; | |
| if (!uid2) | |
| return message.reply(getLang("noTag")); | |
| const avatarURL1 = await usersData.getAvatarUrl(uid1); | |
| const avatarURL2 = await usersData.getAvatarUrl(uid2); | |
| const img = await new DIG.Batslap().getImage(avatarURL1, avatarURL2); | |
| const pathSave = `${__dirname}/tmp/${uid1}_${uid2}Batslap.png`; | |
| fs.writeFileSync(pathSave, Buffer.from(img)); | |
| const content = args.join(' ').replace(Object.keys(event.mentions)[0], ""); | |
| message.reply({ | |
| body: `${(content || "Bópppp 😵💫😵")}`, | |
| attachment: fs.createReadStream(pathSave) | |
| }, () => fs.unlinkSync(pathSave)); | |
| } | |
| }; |