Last active
March 6, 2024 06:13
-
-
Save dipto-008/9429880a3262f12d2b267d1241d7c8ba 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 axios = require('axios'); | |
const path = require('path'); | |
const fs = require('fs'); | |
module.exports.config = { | |
name: "album", | |
version: "1.0.0", | |
hasPermssion: 0, | |
credits: "Dipto", | |
description: "Displays album options for selection.", | |
usePrefix: true, | |
commandCategory: "Media", | |
usages: "Only or add [cartoon/photo/lofi/sad/islamic/funny/horny/anime/aesthetic/cat/lyrics/love/sigma]", | |
cooldowns: 5 | |
}; | |
module.exports.run = async function ({ api, event, args}) { | |
if (!args[0]){ | |
{ api.setMessageReaction("๐", event.messageID, (err) => {}, true); | |
} | |
const albumOptions = [ | |
"๐๐๐ป๐ป๐ ๐๐ถ๐ฑ๐ฒ๐ผ", | |
"๐๐๐น๐ฎ๐บ๐ถ๐ฐ ๐๐ถ๐ฑ๐ฒ๐ผ", | |
"๐ฆ๐ฎ๐ฑ ๐๐ถ๐ฑ๐ฒ๐ผ", | |
"๐๐ป๐ถ๐บ๐ฒ ๐๐ถ๐ฑ๐ฒ๐ผ", | |
"๐๐ฎ๐ฟ๐๐ผ๐ผ๐ป ๐๐ถ๐ฑ๐ฒ๐ผ", | |
"๐๐ผ๐๐ถ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ", | |
"๐๐ผ๐ฟ๐ป๐ ๐๐ถ๐ฑ๐ฒ๐ผ", | |
"๐๐ผ๐๐ฝ๐น๐ฒ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ", | |
"๐๐น๐ผ๐๐ฒ๐ฟ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ", | |
"๐ฅ๐ฎ๐ป๐ฑ๐ผ๐บ ๐ฃ๐ต๐ผ๐๐ผ" | |
]; | |
const message = "โค๏ธโ๐ฉน ๐๐ต๐ผ๐ผ๐๐ฒ ๐ฎ๐ป ๐ผ๐ฝ๐๐ถ๐ผ๐ป๐ ๐๐ฎ๐ฏ๐ <๐\n"+"โฟโโโโโโโโโโโโโโโโโโโโโโโโฟ\n"+ albumOptions.map((option, index) => `๐ | ${index + 1}. ${option} ๐ค`).join("\n")+`\nโฟโโโโโโโโโโโโโโโโโโโโโโโโฟ\n๐ฐ | ๐๐๐ ๐ [ ๐/๐ ]\nโน | ๐๐ฒ๐ฉ๐ ${global.config.PREFIX}album 2 - ๐ญ๐จ ๐ฌ๐๐ ๐ง๐๐ฑ๐ญ ๐ฉ๐๐ ๐.\nโฟโโโโโโโโโโโโโโโโโโโโโโโโฟ`; | |
await api.sendMessage({body: message,},event.threadID,(error, info) => { | |
global.client.handleReply.push({ | |
name: this.config.name, | |
type: 'reply', | |
messageID: info.messageID, | |
author: event.senderID, | |
link: albumOptions | |
})},event.messageID); | |
}else if (args[0] === "2"){ | |
{ api.setMessageReaction("๐", event.messageID, (err) => {}, true); | |
} | |
const albumOptions = [ | |
"๐๐ฒ๐๐๐ต๐ฒ๐๐ถ๐ฐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ", | |
"๐ฆ๐ถ๐ด๐บ๐ฎ ๐ฅ๐๐น๐ฒ", | |
"๐๐๐ฟ๐ถ๐ฐ๐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ", | |
"๐๐ฎ๐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ", | |
"18+ ๐๐ถ๐ฑ๐ฒ๐ผ", | |
"๐๐ฟ๐ฒ๐ฒ ๐๐ถ๐ฟ๐ฒ ๐๐ถ๐ฑ๐ฒ๐ผ", | |
"๐๐ผ๐ผ๐๐๐ฎ๐น๐น ๐๐ถ๐ฑ๐ฒ๐ผ", | |
"๐๐ถ๐ฟ๐น ๐๐ถ๐ฑ๐ฒ๐ผ", | |
"๐๐ฟ๐ถ๐ฒ๐ป๐ฑ๐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ" | |
]; | |
const message = "โค๏ธโ๐ฉน ๐๐ต๐ผ๐ผ๐๐ฒ ๐ฎ๐ป ๐ผ๐ฝ๐๐ถ๐ผ๐ป๐ ๐๐ฎ๐ฏ๐ <๐\n"+"โฟโโโโโโโโโโโโโโโโโโโโโโโโฟ\n"+ albumOptions.map((option, index) => `๐ | ${index + 11}. ${option} ๐ค`).join("\n")+"\nโฟโโโโโโโโโโโโโโโโโโโโโโโโฟ\n๐ฐ | ๐๐๐ ๐ [ ๐/๐ ]\nโฟโโโโโโโโโโโโโโโโโโโโโโโโฟ"; | |
await api.sendMessage({body: message,},event.threadID,(error, info) => { | |
global.client.handleReply.push({ | |
name: this.config.name, | |
type: 'reply', | |
messageID: info.messageID, | |
author: event.senderID, | |
link: albumOptions | |
})},event.messageID); | |
} | |
//------------Video Add--------------// | |
const validCommands = ['cartoon', 'photo', 'lofi', 'sad', 'islamic','funny','horny','anime','love','baby','lyrics','sigma','photo','aesthetic','cat','flower','ff','sex','girl','football','friend']; | |
{ api.setMessageReaction("๐", event.messageID, (err) => {}, true); | |
} | |
if (args[0] === 'list'){ | |
try { | |
const lRes = await axios.get(`https://all-image-genator-d1p.onrender.com/dipto/album?list=dipto`); | |
const data = lRes.data; | |
api.sendMessage(`๐ค ๐ง๐ผ๐๐ฎ๐น ๐๐ถ๐ฑ๐ฒ๐ผ ๐ฎ๐๐ฎ๐ถ๐น๐ฎ๐ฏ๐น๐ฒ ๐ถ๐ป ๐ฎ๐น๐ฏ๐๐บ ๐ฉต\n\n${data.data}`, event.threadID, event.messageID); | |
} catch (error) { | |
api.sendMessage(`${error}`,event.threadID,event.messageID) | |
} | |
} | |
const d1 = args[1]?args[1].toLowerCase() : '' ; | |
if (!d1 || !validCommands.includes(d1))return; | |
if (!event.messageReply || !event.messageReply.attachments) return; | |
const attachment = event.messageReply.attachments[0].url; | |
const URL = attachment; | |
let query; | |
switch (d1) { | |
case 'cartoon': | |
query = 'addVideo'; | |
break; | |
case 'photo': | |
query = 'addPhoto'; | |
break; | |
case 'lofi': | |
query = 'addLofi'; | |
break; | |
case 'sad': | |
query = 'addSad'; | |
break; | |
case 'funny': | |
query = 'addFunny'; | |
break; | |
case 'islamic': | |
query = 'addIslamic'; | |
break; | |
case 'horny': | |
query = 'addHorny'; | |
break; | |
case 'anime': | |
query = 'addAnime'; | |
break; | |
case 'love': | |
query = 'addLove'; | |
break; | |
case 'lyrics': | |
query = 'addLyrics'; | |
break; | |
case 'flower': | |
query = 'addBaby'; | |
break; | |
case 'photo': | |
query = 'addPhoto'; | |
break; | |
case 'sigma': | |
query = 'addSigma'; | |
break; | |
case 'aesthetic': | |
query = 'addAesthetic'; | |
break; | |
case 'cat': | |
query = 'addCat'; | |
break; | |
case 'ff': | |
query = 'addFf'; | |
break; | |
case 'sex': | |
query = 'addSex'; | |
break; | |
case 'football': | |
query = 'addFootball'; | |
break; | |
case 'girl': | |
query = 'addGirl'; | |
break; | |
case 'friend': | |
query = 'addFriend'; | |
break; | |
default: | |
break; | |
} | |
try { | |
const response = await axios.get(`https://all-image-genator-d1p.onrender.com/dipto/imgur?url=${encodeURIComponent(URL)}`); | |
const imgurLink = response.data.data; | |
const fileExtension = path.extname(imgurLink); | |
let query2; | |
if (fileExtension === '.jpg' || fileExtension === '.jpeg' || fileExtension === '.png') {query2 = 'addPhoto';} | |
else if (fileExtension === '.mp4') { | |
query2 = query;} else { | |
api.sendMessage('Invalid file format.', event.threadID, event.messageID); | |
return; | |
} | |
const svRes = await axios.get(`https://all-image-genator-d1p.onrender.com/dipto/album?add=${query2}&url=${imgurLink}`); | |
const data = svRes.data; | |
// console.log(data); | |
api.sendMessage(`โ | ${data.data}\n\n๐ฐ | ${data.data2}`, event.threadID, event.messageID); | |
} catch (error) {console.error('Error:', error);api.sendMessage(`Failed to convert image.\n${error}`, event.threadID, event.messageID); | |
} | |
}; | |
module.exports.handleReply = async function ({ api, event, handleReply }) { | |
api.unsendMessage(handleReply.messageID); | |
const admin = "100044327656712"; | |
if (event.type == "message_reply") { | |
const reply = parseInt(event.body); | |
if (isNaN(reply)) { | |
return api.sendMessage("Please reply with either 1 - 13", event.threadID, event.messageID); | |
} | |
let query; | |
let cp; | |
if (reply === 1) { | |
query = "funny"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐๐ป๐ป๐ ๐๐ถ๐ฑ๐ฒ๐ผ <๐คฃ"; | |
} else if (reply === 2) { | |
query = "islamic"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐๐น๐ฎ๐บ๐ถ๐ฐ ๐๐ถ๐ฑ๐ฒ๐ผ <๐"; | |
}else if (reply === 3) { | |
query = "sad"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐ฆ๐ฎ๐ฑ ๐๐ถ๐ฑ๐ฒ๐ผ <๐ฅบ"; | |
}else if (reply === 4) { | |
query = "anime"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐ฎ๐ป๐ถ๐บ ๐๐ถ๐ฑ๐ฒ๐ผ <๐"; | |
}else if (reply === 5) { | |
query = "video"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ฎ๐ฟ๐๐ผ๐ผ๐ป ๐๐ถ๐ฑ๐ฒ๐ผ <๐"; | |
}else if (reply === 6) { | |
query = "lofi"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ผ๐ณ๐ถ ๐๐ถ๐ฑ๐ฒ๐ผ <๐"; | |
} | |
else if (reply === 7 && event.senderID == admin) { | |
query = "horny"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ผ๐ฟ๐ป๐ ๐๐ถ๐ฑ๐ฒ๐ผ <๐ฅต"; | |
} | |
else if (reply === 7 && event.senderID !== admin) { | |
return api.sendMessage("Hop beda luccha ",event.threadID, event.messageID); | |
} | |
else if (reply === 8) { | |
query = "love"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ผ๐๐ฒ ๐๐ถ๐ฑ๐ฒ๐ผ <๐"; | |
} | |
else if (reply === 9) { | |
query = "flower"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐น๐ผ๐๐ฒ๐ฟ ๐๐ถ๐ฑ๐ฒ๐ผ < ๐ท๐ธ"; | |
} | |
else if (reply === 10) { | |
query = "photo"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐ฅ๐ฎ๐ป๐ฑ๐ผ๐บ ๐ฃ๐ต๐ผ๐๐ผ <๐"; | |
} | |
else if (reply === 11) { | |
query = "aesthetic"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ฒ๐๐๐ต๐ฒ๐๐ถ๐ฐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ <๐"; | |
} | |
else if (reply === 12) { | |
query = "sigma"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐ฆ๐ถ๐ด๐บ๐ฎ ๐๐ถ๐ฑ๐ฒ๐ผ <๐ค"; | |
} | |
else if (reply === 13) { | |
query = "lyrics"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐๐ฟ๐ถ๐ฐ๐ ๐๐ถ๐ฑ๐ฒ๐ผ <๐ฅฐ"; | |
} | |
else if (reply === 14) { | |
query = "cat"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ฎ๐ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ <๐"; | |
} | |
else if (reply === 15 && event.senderID === admin) { | |
query = "sex"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐ฆ๐ฒ๐ ๐๐ถ๐ฑ๐ฒ๐ผ <๐"; | |
} | |
else if (reply === 16) { | |
query = "ff"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ฟ๐ฒ๐ฒ ๐๐ถ๐ฟ๐ฒ ๐ฉ๐ถ๐ฑ๐ฒ๐ผ <๐"; | |
} | |
else if (reply === 17) { | |
query = "football"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ผ๐ผ๐๐ฏ๐ฎ๐น๐น ๐๐ถ๐ฑ๐ฒ๐ผ<๐"; | |
} | |
else if (reply === 18) { | |
query = "girl"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ถ๐ฟ๐น ๐๐ถ๐ฑ๐ฒ๐ผ<๐"; | |
}else if (reply === 19) { | |
query = "friend"; | |
cp = "๐ก๐ฎ๐ ๐๐ฎ๐ฏ๐ ๐๐ฟ๐ถ๐ฒ๐ป๐ฑ๐ ๐๐ถ๐ฑ๐ฒ๐ผ<๐"; | |
} | |
try { | |
const res = await axios.get(`https://all-image-genator-d1p.onrender.com/dipto/album?type=${query}`); | |
const imgUrl = res.data.data; | |
const imgRes = await axios.get(imgUrl, { responseType: 'arraybuffer' }); | |
const ex = path.extname(imgUrl); | |
const filename = __dirname + `/cache/d1p${ex}`; | |
fs.writeFileSync(filename, Buffer.from(imgRes.data, 'binary')); | |
api.sendMessage({ | |
body: cp, | |
attachment: fs.createReadStream(filename), | |
}, | |
event.threadID, | |
() => fs.unlinkSync(filename), event.messageID); | |
} catch (error) { | |
api.sendMessage('An error occurred while fetching the media.', event.threadID, event.messageID); | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment