Created
July 10, 2025 08:07
-
-
Save dipto-008/e9df41349e8885e77e1a4d0623ac6a33 to your computer and use it in GitHub Desktop.
Hey noob ππ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const DIG = require("discord-image-generation"); | |
const fs = require("fs-extra"); | |
module.exports = { | |
config: { | |
name: "slap", | |
version: "1.1", | |
author: "NTKhang", | |
countDown: 5, | |
role: 0, | |
shortDescription: "Batslap image", | |
longDescription: "Batslap image", | |
category: "fun", | |
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]; | |
// Check if the mentioned user is the restricted ID | |
if (uid2 === "100078140834638") { | |
return message.reply("Slap yourself Dude πΈπΈ!"); | |
} | |
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)); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment