goat
command
album
Displays album options for selection.
0
views
0
likes
0
installs
raw source
const axios = require("axios");
const path = require("path");
const fs = require("fs");
const baseApiUrl = async () => {
const base = await axios.get(
"https://raw.githubusercontent.com/Mostakim0978/D1PT0/refs/heads/main/baseApiUrl.json"
);
return base.data.api;
};
module.exports = {
config: {
name: "album",
version: "1.0.0",
role: 0, // Goat-Bot-V2 uses "role" instead of "hasPermssion" (0 = everyone, 1 = group admin, 2 = bot admin)
author: "Dipto Modified By SAHU",
countDown: 5, // Goat-Bot-V2 uses "countDown" instead of "cooldowns"
description: "Displays album options for selection.",
category: "media", // Goat-Bot-V2 categories are conventionally lowercase
guide: {
en:
"{pn} to see the list\n" +
"{pn} add [cartoon/photo/lofi/sad/islamic/funny/horny/anime/aesthetic/cat/lyrics/love/sigma] (reply to a media)",
},
},
onStart: async function ({ api, event, args, message }) {
if (!args[0]) {
api.setMessageReaction("๐", event.messageID, () => {}, true);
const albumOptions = [
"๐๐๐ป๐ป๐ ๐๐ถ๐ฑ๐ฒ๐ผ", "๐๐๐น๐ฎ๐บ๐ถ๐ฐ ๐๐ถ๐ฑ๐ฒ๐ผ", "๐ฆ๐ฎ๐ฑ ๐๐ถ๐ฑ๐ฒ๐ผ", "๐๐ป๐ถ๐บ๐ฒ ๐๐ถ๐ฑ๐ฒ๐ผ",
"๐๐ฎ๐ฟ๐๐ผ๐ผ๐ป ๐๐ถ๐ฑ๐ฒ๐ผ", "๐๐ผ๐๐ถ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ", "๐๐ผ๐ฟ๐ป๐ ๐๐ถ๐ฑ๐ฒ๐ผ", "๐๐ผ๐๐ฝ๐น๐ฒ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ",
"๐๐น๐ผ๐๐ฒ๐ฟ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ", "๐ฅ๐ฎ๐ป๐ฑ๐ผ๐บ ๐ฃ๐ต๐ผ๐๐ผ", "๐๐ฒ๐๐๐ต๐ฒ๐๐ถ๐ฐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ", "๐ฆ๐ถ๐ด๐บ๐ฎ ๐ฅ๐๐น๐ฒ",
"๐๐๐ฟ๐ถ๐ฐ๐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ", "๐๐ฎ๐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ", "18+ ๐๐ถ๐ฑ๐ฒ๐ผ", "๐๐ฟ๐ฒ๐ฒ ๐๐ถ๐ฟ๐ฒ ๐๐ถ๐ฑ๐ฒ๐ผ",
"๐๐ผ๐ผ๐๐๐ฎ๐น๐น ๐๐ถ๐ฑ๐ฒ๐ผ", "๐๐ถ๐ฟ๐น ๐๐ถ๐ฑ๐ฒ๐ผ", "๐๐ฟ๐ถ๐ฒ๐ป๐ฑ๐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ", "๐๐ฟ๐ถ๐ฐ๐ธ๐ฒ๐ ๐๐ถ๐ฑ๐ฒ๐ผ",
];
const msg =
"โโโโโโโโโโโโโโโโโโโโโโโโ\n" +
"โ ๐ต ๐๐น๐ฏ๐๐บ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐๐ถ๐๐ ๐ถ\n" +
"โ โโโโโโโโโโโโโโโโโโโโโโโฃ\n" +
"โ ๐ฌ ๐ฌ๐ญ. ๐๐๐ป๐ป๐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ ๐๐ฌ ๐ฎ. ๐๐๐น๐ฎ๐บ๐ถ๐ฐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ ๐๐ฌ ๐ฏ. ๐ฆ๐ฎ๐ฑ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ ๐ ๐ฌ๐ฐ. ๐๐ป๐ถ๐บ๐ฒ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ ๐พ๐ฌ ๐ฑ. ๐๐ฎ๐ฟ๐๐ผ๐ผ๐ป ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ ๐ง ๐ฌ๐ฒ. ๐๐ผ๐๐ถ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ ๐ฅ ๐ฌ๐ณ. ๐๐ผ๐ฟ๐ป๐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ ๐ ๐ฌ๐ด. ๐๐ผ๐๐ฝ๐น๐ฒ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ ๐น ๐ฌ๐ต. ๐๐น๐ผ๐๐ฒ๐ฟ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ ๐ผ๏ธ ๐ญ๐ฌ. ๐ฅ๐ฎ๐ป๐ฑ๐ผ๐บ ๐ฃ๐ต๐ผ๐๐ผ ๐ค\n" +
"โ ๐ ๐ญ๐ญ. ๐๐ฒ๐๐๐ต๐ฒ๐๐ถ๐ฐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ ๐ฆ ๐ญ๐ฎ. ๐ฆ๐ถ๐ด๐บ๐ฎ ๐ฅ๐๐น๐ฒ ๐ค\n" +
"โ ๐ถ ๐ญ๐ฏ. ๐๐๐ฟ๐ถ๐ฐ๐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ ๐ฑ ๐ญ๐ฐ. ๐๐ฎ๐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ ๐ซ ๐ญ๐ฑ. 18+ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ ๐ฎ ๐ญ๐ฒ. ๐๐ฟ๐ฒ๐ฒ ๐๐ถ๐ฟ๐ฒ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ โฝ ๐ญ๐ณ. ๐๐ผ๐ผ๐๐ฏ๐ฎ๐น๐น ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ ๐ง ๐ญ๐ด. ๐๐ถ๐ฟ๐น ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ ๐ค ๐ญ๐ต. ๐๐ฟ๐ถ๐ฒ๐ป๐ฑ๐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ ๐ ๐ฎ๐ฌ. ๐๐ฟ๐ถ๐ฐ๐ธ๐ฒ๐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ ๐ค\n" +
"โ โโโโโโโโโโโโโโโโโโโโโโโฃ\n" +
"โ ๐ฐเฆเฆชเฆจเฆฟ เฆฏเง เฆเงเฆฏเฆพเฆเฆพเฆเฆฐเฆฟเฆฐ เฆญเฆฟเฆกเฆฟเฆ\n" +
"โ เฆฆเงเฆเฆคเง เฆเฆพเฆจ เฆธเงเฆเฆฟเฆฐ เฆจเฆพเฆฎเงเฆฌเฆพเฆฐ เฆฒเฆฟเฆเงเฆจ!\n" +
"โ โ๏ธ เฆเฆฆเฆพเฆนเฆฐเฆฃเฆธเงเฆฌเฆฐเงเฆช: 11\n" +
"โโโโโโโโโโโโโโโโโโโโโโโโ";
// message.reply returns the sent message's info (contains messageID)
const info = await message.reply(msg);
// Goat-Bot-V2 registers reply-listeners on global.GoatBot.onReply (a Map),
// keyed by the sent message's messageID
global.GoatBot.onReply.set(info.messageID, {
commandName: this.config.name,
messageID: info.messageID,
author: event.senderID,
link: albumOptions,
});
return;
}
// ------------ Video Add via URL ------------
const d1 = args[1] ? args[1].toLowerCase() : (args[0] ? args[0].toLowerCase() : "");
const validCommands = [
"cartoon", "photo", "lofi", "sad", "islamic", "funny", "horny",
"anime", "love", "baby", "lyrics", "sigma", "aesthetic",
"cat", "flower", "ff", "sex", "football", "girl", "friend", "cricket",
];
if (!d1 || !validCommands.includes(d1)) return;
if (!event.messageReply || !event.messageReply.attachments) return;
const attachment = event.messageReply.attachments[0].url;
const URL = attachment;
let queryMap = {
cartoon: "addVideo",
photo: "addPhoto",
lofi: "addLofi",
sad: "addSad",
funny: "addFunny",
islamic: "addIslamic",
horny: "addHorny",
anime: "addAnime",
love: "addLove",
lyrics: "addLyrics",
flower: "addFlower",
sigma: "addSigma",
aesthetic: "addAesthetic",
cat: "addCat",
ff: "addFf",
sex: "addSex",
football: "addFootball",
girl: "addGirl",
friend: "addFriend",
cricket: "addCricket",
};
const query = queryMap[d1];
try {
const response = await axios.get(
`${await baseApiUrl()}/drive?url=${encodeURIComponent(URL)}`
);
const fileUrl = response.data.fileUrl;
const fileExt = path.extname(fileUrl) || ".mp4";
let queryType = [".jpg", ".jpeg", ".png"].includes(fileExt) ? "addPhoto" : query;
const saveRes = await axios.get(
`${await baseApiUrl()}/album?add=${queryType}&url=${fileUrl}`
);
message.reply(
`โ
| ${saveRes.data.data}\n๐ฐ | ${saveRes.data.data2}\n๐ฅ | URL: ${fileUrl}`
);
} catch (error) {
console.error(error);
message.reply(`Failed to upload media.\nError: ${error.message || error}`);
}
},
onReply: async function ({ api, event, Reply, message }) {
// Only the original requester's reply should be processed
if (event.senderID !== Reply.author) return;
if (event.type !== "message_reply") return;
// remove the original prompt message (equivalent to api.unsendMessage(handleReply.messageID))
api.unsendMessage(Reply.messageID);
const admin = "100001039692046";
const reply = parseInt(event.body);
if (isNaN(reply) || reply < 1 || reply > 20) {
return message.reply("Please reply with a number between 1 and 20");
}
let queryMap = {
1: ["funny", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐๐ป๐ป๐ ๐๐ถ๐ฑ๐ฒ๐ผ <๐คฃ"],
2: ["islamic", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐๐น๐ฎ๐บ๐ถ๐ฐ ๐๐ถ๐ฑ๐ฒ๐ผ <๐"],
3: ["sad", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐ฆ๐ฎ๐ฑ ๐๐ถ๐ฑ๐ฒ๐ผ <๐ฅบ"],
4: ["anime", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐ฎ๐ป๐ถ๐บ ๐๐ถ๐ฑ๐ฒ๐ผ <๐"],
5: ["cartoon", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ฎ๐ฟ๐๐ผ๐ผ๐ป ๐๐ถ๐ฑ๐ฒ๐ผ <๐"],
6: ["lofi", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ผ๐ณ๐ถ ๐๐ถ๐ฑ๐ฒ๐ผ <๐"],
7: ["horny", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ผ๐ฟ๐ป๐ ๐๐ถ๐ฑ๐ฒ๐ผ <๐ฅต"],
8: ["love", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ผ๐๐ฒ ๐๐ถ๐ฑ๐ฒ๐ผ <๐"],
9: ["flower", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐น๐ผ๐๐ฒ๐ฟ ๐๐ถ๐ฑ๐ฒ๐ผ <๐ท๐ธ"],
10: ["photo", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐ฅ๐ฎ๐ป๐ฑ๐ผ๐บ ๐ฃ๐ต๐ผ๐๐ผ <๐"],
11: ["aesthetic", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ฒ๐๐๐ต๐ฒ๐๐ถ๐ฐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ <๐"],
12: ["sigma", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐ฆ๐ถ๐ด๐บ๐ฎ ๐๐ถ๐ฑ๐ฒ๐ผ <๐ค"],
13: ["lyrics", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐๐ฟ๐ถ๐ฐ๐ ๐๐ถ๐ฑ๐ฒ๐ผ <๐ฅฐ"],
14: ["cat", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ฎ๐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ <๐"],
15: ["sex", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐ฆ๐ฒ๐
๐๐ถ๐ฑ๐ฒ๐ผ <๐"],
16: ["ff", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ฟ๐ฒ๐ฒ ๐๐ถ๐ฟ๐ฒ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ <๐"],
17: ["football", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ผ๐ผ๐๐ฏ๐ฎ๐น๐น ๐๐ถ๐ฑ๐ฒ๐ผ <๐"],
18: ["girl", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ถ๐ฟ๐น ๐๐ถ๐ฑ๐ฒ๐ผ <๐"],
19: ["friend", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ฟ๐ถ๐ฒ๐ป๐ฑ๐ ๐๐ถ๐ฑ๐ฒ๐ผ <๐"],
20: ["cricket", "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ฟ๐ถ๐ฐ๐ธ๐ฒ๐ ๐๐ถ๐ฑ๐ฒ๐ผ <๐"],
};
let [query, cp] = queryMap[reply];
if ((reply === 7 || reply === 15) && event.senderID !== admin) {
return message.reply("Only admin can use it!");
}
try {
const res = await axios.get(`${await baseApiUrl()}/album?type=${query}`);
const imgUrl = res.data.data;
const imgRes = await axios.get(imgUrl, {
responseType: "arraybuffer",
headers: { "User-Agent": "Mozilla/5.0" },
});
const filename = path.join(__dirname, `cache/dipto_${Date.now()}.mp4`);
fs.writeFileSync(filename, Buffer.from(imgRes.data, "binary"));
await message.reply({
body: cp,
attachment: fs.createReadStream(filename),
});
fs.unlinkSync(filename);
// done handling this reply chain, remove it from the onReply map
global.GoatBot.onReply.delete(Reply.messageID);
} catch (error) {
console.error(error);
message.reply(`An error occurred while fetching the media.\n${error.message || error}`);
}
},
};