Untitled
unknown
plain_text
3 years ago
66 kB
5
Indexable
Never
const fs = require("fs"); const http = require('https'); // or 'https' for https:// URLs const login = require("fca-unofficial"); const axios = require("axios"); const request = require('request'); const YoutubeMusicApi = require('youtube-music-api'); // GLOBAL MESSAGE STORAGE let msgs = {}; let vips = ['100027361171519', '100078603683526']; //TO MAKE YOUR SELF EXEMPTION FROM UNSENDING ENTER YOUR FACEBOOK IDS HERE /*==================================== LEECH tiktok FUNC ====================================*/ async function leechTT(link) { out = await axios.get("https://www.tiktokdownloader.org/check.php?v=" + link).then((response) => { return response.data.download_url }).catch((error) => { return "err" }) return out } async function sendVc(message) { out = await axios.get("https://api.mobilelegends.com/mlweb/sendMail?roleId=" + data + "&language=en").then((response) => { return response.data}).catch((error) => { return error }) return out } /*==================================== LEECH tiktok FUNC ====================================*/ async function covd(response) { out = await axios.get("https://disease.sh/v3/covid-19/countries/Philippines").then((response) => { return response.data.cases }).catch((cases) => { return "err" }) return out } async function downloadfile(url, path) { const { createWriteStream } = require('fs'); const axios = require('axios'); const response = await axios({ method: 'GET', responseType: 'stream', url }); const writer = createWriteStream(path); response.data.pipe(writer); return new Promise((resolve, reject) => { writer.on('finish', resolve); writer.on('error', reject); }); }; /*==================================== LEECH MP3 FUNC ====================================*/ async function conv(v, t, e) { const headers = { 'Content-Type': 'application/x-www-form-urlencoded', 'X-Requested-Key': 'de0cfuirtgf67a' } results = await axios.post("https://backend.svcenter.xyz/api/convert-by-45fc4be8916916ba3b8d61dd6e0d6994", "v_id=" + v + "&ftype=mp3&fquality=128&token=" + t + "&timeExpire=" + e + "&client=yt5s.com", { headers: headers }).then((response) => { return response.data.d_url }).catch((error) => { return error.message }); return results } async function fetch(query) { const headers = { 'Content-Type': 'application/x-www-form-urlencoded' } results = await axios.post("https://yt5s.com/api/ajaxSearch", "q=" + query + "&vt=mp3", { headers: headers }).then((response) => { return response.data }).catch((error) => { return error.message }); return results } async function slp(query) { const headers = { 'Content-Type': 'application/x-www-form-urlencoded' } results = await axios.post("https://api.coingecko.com/api/v3/simple/price?ids=smooth-love-potion&vs_currencies=ph", { headers: headers }).then((response) => { return response.data }).catch((error) => { return error.message }); return results } async function leechmp3(query) { var songs = fetch(query); let resp = await songs.then((response) => { let slist = response; if (slist == "err") { return "err" } else if (slist.t < 1300) { let d_url = conv(slist.vid, slist.token, slist.timeExpires).then((response) => { return [response, slist.title] }); return d_url } else if (slist.p == "search") { return 'err' } else if (slist.mess.startsWith("The video you want to download is posted on TikTok.")) { return 'tiktok' } else { return 'pakyo' } }); return resp } /*==================================== AUTOREACT MP3 FUNC ====================================*/ login({ appState: JSON.parse(fs.readFileSync('appstate.json', 'utf8')) }, (err, api) => { if (err) return console.error(err); api.setOptions({ listenEvents: true, selfListen:true }); var listenEmitter = api.listen((err, event) => { if (err) return console.error(err); switch (event.type) { case "message_reply": if (vips.includes(event.senderID)) { api.setMessageReaction("😎", event.messageID, (err) => { }, true); } else { api.setMessageReaction("😝", event.messageID, (err) => { }, true); } let msgid = event.messageID let input = event.body; msgs[msgid] = input; break case "message": if (vips.includes(event.senderID)) { api.setMessageReaction("😎", event.messageID, (err) => { }, true); } else { api.setMessageReaction("😝", event.messageID, (err) => { }, true); } if (event.attachments.length != 0) { if (event.attachments[0].type == "photo") { msgs[event.messageID] = ['img', event.attachments[0].url] } else if (event.attachments[0].type == "video") { msgs[event.messageID] = ['vid', event.attachments[0].url] } else if (event.attachments[0].type == "audio") { msgs[event.messageID] = ['vm', event.attachments[0].url] } else if (event.attachments[0].type == "animated_image") { msgs[event.messageID] = ['gif', event.attachments[0].url] } else if (event.attachments[0].type == "sticker") { msgs[event.messageID] = ['sticker', event.attachments[0].url] } else if (event.attachments[0].type == "file") { msgs[event.messageID] = ['file', event.attachments[0].url] } } else { msgs[event.messageID] = event.body } /*==================================== AUTOGREET FUNC ====================================*/ if (event.body != null) { let input = event.body; if (input.includes("morning")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Morning " + '@'+data[event.senderID]['name'] + ", have a nice day❤️\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Good Morning")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Morning " + '@'+data[event.senderID]['name'] + ", have a nice day❤️\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Good morning")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Morning " + '@'+data[event.senderID]['name'] + ", have a nice day❤️\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Goodmorning")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Morning " + '@'+data[event.senderID]['name'] + ", have a nice day❤️\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("good morning")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Morning " + '@'+data[event.senderID]['name'] + ", have a nice day❤️\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("goodmorning")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Morning " + '@'+data[event.senderID]['name'] + ", have a nice day❤️\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Good Afternoon")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Afternoon " + '@'+data[event.senderID]['name'] + "\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Good afternoon")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Afternoon " + '@'+data[event.senderID]['name'] + "\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Goodafternoon")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Afternoon " + '@'+data[event.senderID]['name'] + "\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("good afternoon")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Afternoon " + '@'+data[event.senderID]['name'] + "\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("goodafternoon")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Afternoon " + '@'+data[event.senderID]['name'] + "\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Good Evening")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Evening " + '@'+data[event.senderID]['name'] + ", how's your day?\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Good Evening")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Evening " + '@'+data[event.senderID]['name'] + ", how's your day?\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Goodevening")){ api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Evening " + '@'+data[event.senderID]['name'] + ", how's your day?\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("good evening")){ api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Evening " + '@'+data[event.senderID]['name'] + ", how's your day?\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("goodevening")){ api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Evening " + '@'+data[event.senderID]['name'] + ", how's your day?\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Goodnight")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Night " + '@'+data[event.senderID]['name'] + ", have a nice sleep😴.\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Magandang Umaga")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Magandang Umaga rin sayo " + '@'+data[event.senderID]['name'] + ", \n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Magandang umaga")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Magandang Umaga rin sayo " + '@'+data[event.senderID]['name'] + ", \n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Magandangumaga")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Magandang Umaga rin sayo " + '@'+data[event.senderID]['name'] + ", \n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("magandang umaga")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Magandang Umaga rin sayo " + '@'+data[event.senderID]['name'] + ", \n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("magandangumaga")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Morning " + '@'+data[event.senderID]['name'] + ", have a nice day❤️\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Magandang Hapon")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Magandang Hapon din sayo " + '@'+data[event.senderID]['name'] + ", \n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Magandang hapon")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Magandang Hapon din sayo " + '@'+data[event.senderID]['name'] + ", \n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Magandanghapon")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Magandang Hapon din sayo " + '@'+data[event.senderID]['name'] + ", \n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("magandang hapon")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Magandang Hapon din sayo " + '@'+data[event.senderID]['name'] + ", \n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("magandanghapon")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Good Afternoon " + '@'+data[event.senderID]['name'] + "\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Magandang Gabi")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Magandang Gabi sayo " + '@'+data[event.senderID]['name'] + "\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Magandang gabi")) { api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Magandang Gabi sayo " + '@'+data[event.senderID]['name'] + "\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Magandanggabi")){ api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Magandang Gabi sayo " + '@'+data[event.senderID]['name'] + "\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("magandang gabi")){ api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Magandang Gabi sayo " + '@'+data[event.senderID]['name'] + "\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("magandanggabi")){ api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: "Magandang Gabi sayo " + '@'+data[event.senderID]['name'] + "\n\n-KenBot AutoGreet", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Salamat")){ api.sendMessage("Walang Anuman, Salamat din..." + "\n\n-KenBot AutoGreet", event.threadID, event.messageID); api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("salamat")){ api.sendMessage("Walang Anuman, Salamat din..." + "\n\n-KenBot AutoGreet", event.threadID, event.messageID); api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Thankyou")){ api.sendMessage("You're Welcome!!" + "\n\n-KenBot AutoGreet ", event.threadID, event.messageID); api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("thankyou")){ api.sendMessage("You're Welcome!!" + "\n\n-KenBot AutoGreet", event.threadID, event.messageID); api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Thank you")){ api.sendMessage("You're Welcome!!" + "\n\n-KenBot AutoGreet", event.threadID, event.messageID); api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("thank you")){ api.sendMessage("You're Welcome!!" + "\n\n-KenBot AutoGreet", event.threadID, event.messageID); api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Happy Birthday")) { api.sendMessage("Happy Birthday! Another adventure filled year awaits you. Welcome it by celebrating your birthday with pomp and splendor. Wishing you a very happy and fun-filled birthday!", event.threadID); api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Happy birthday")) { api.sendMessage("Happy Birthday! Another adventure filled year awaits you. Welcome it by celebrating your birthday with pomp and splendor. Wishing you a very happy and fun-filled birthday!", event.threadID); api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("happy birthday")) { api.sendMessage("Happy Birthday! Another adventure filled year awaits you. Welcome it by celebrating your birthday with pomp and splendor. Wishing you a very happy and fun-filled birthday!", event.threadID); api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("Happy Bday")) { api.sendMessage("Happy Birthday! Another adventure filled year awaits you. Welcome it by celebrating your birthday with pomp and splendor. Wishing you a very happy and fun-filled birthday!", event.threadID); api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("happy bday")) { api.sendMessage("Happy Birthday! Another adventure filled year awaits you. Welcome it by celebrating your birthday with pomp and splendor. Wishing you a very happy and fun-filled birthday!", event.threadID); api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (input.includes("pogi")){ api.getUserInfo(event.senderID, (err, data) => { api.sendMessage({ body: '@'+data[event.senderID]['name'] + " ako lang ang pogi sa balat ng lupa. Tandaan mo yan.", mentions: [{ tag: '@'+data[event.senderID]['name'], id: event.senderID, fromIndex: 0, // Highlight the second occurrence of @Sender }], }, event.threadID); }) api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (/^!covid\s(.*)/i.test(event.body)) { const data = event.body.match(/^!covid\s(.*)/i); var tip = data.join(" "); if (!data) return api.sendMessage(`Please input country name`, event.threadID, event.messageID); else { axios.get(`https://disease.sh/v3/covid-19/countries/` + data).then(res => { let nhiem = res.data.cases, chet = res.data.deaths, dieutri = res.data.recovered, danso = res.data.population, chauluc = res.data.continent, acti = res.data.active, tdc = res.data.todayCases, tdd = res.data.todayDeaths, tdr = res.data.todayRecovered, quocgia = res.data.country var flag = res.data.countryInfo.flag; const months = ["January","February","March","April","May","June","July","August","September","October","November","December"]; var today = new Date(); var month = months[today.getMonth()]; var date = month+ ' '+today.getDate()+ ' ' +today.getFullYear(); var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds(); var dateTime = date+' '+time; { var msg = { body: `🌎Country: ${quocgia}\n📝Population: ${danso}\n🔎Continent: ${chauluc}\n\nAs of: ${dateTime}\n\nTotal Cases: ${nhiem}\nActive Cases: ${acti}\nNew Cases: ${tdc}\n☠️Total Fatalities: ${chet}\nToday Fatalities: ${tdd}\n❤️Total Recovery: ${dieutri}\n❤️Today Recovery: ${tdr}\n`, attachment: fs.createReadStream(__dirname + "/pic/cov.jpg") } api.sendMessage(msg, event.threadID, event.messageID); }; }) } } else if (input.startsWith("!sendvc")) { let data = input.split(" "); if (data.length < 2) { api.sendMessage("Missing Game ID", event.threadID, event.messageID); } else { api.sendMessage("Sending Verification Code Please Wait...", event.threadID, event.messageID); axios.get("https://api.mobilelegends.com/mlweb/sendMail?roleId=" + data + "&language=en").then(res => { let re = res.data.message; { api.sendMessage(re, event.threadID, event.messageID); } }) } } else if (/^!play\s(.*)/i.test(event.body)) { const data = event.body.match(/^!play\s(.*)/i); const yt = new YoutubeMusicApi() api.sendMessage("Searching...", event.threadID, event.messageID); yt.initalize().then(info => { yt.search(data[1], "video").then(result => { const pl = result.content.shift(); const vidId = pl.videoId; console.log(result) const res = "https://music.youtube.com/watch?v=" + vidId { api.sendMessage("🔃Converting....", event.threadID, event.messageID); try { let s = leechmp3(res); s.then((response) => { if (response == "pakyo") { api.setMessageReaction("❌", event.messageID, (err) => { }, true); api.sendMessage("20mins Max Duration Only!", event.threadID, event.messageID); } else if (response == "err") { api.sendMessage("❌Invalid Input", event.threadID, event.messageID); api.setMessageReaction("😭", event.messageID, (err) => { }, true); } else if (response == "tiktok") { api.sendMessage("❌Youtube Only, Bawal Tiktok!", event.threadID, event.messageID); api.setMessageReaction("😡", event.messageID, (err) => { }, true); } else if (response[0] != undefined) { var file = fs.createWriteStream("song.mp3"); var targetUrl = response[0]; var gifRequest = http.get(targetUrl, function (gifResponse) { gifResponse.pipe(file); file.on('finish', function () { console.log('finished downloading..') api.sendMessage('✅Download Complete! Uploading...', event.threadID) var message = { body: "🎶Song Title: " + response[1] + "\n👨🏻💻Coded with ❤️ by: Ken\n-KenBot", attachment: fs.createReadStream(__dirname + '/song.mp3') } api.sendMessage(message, event.threadID); }); }); } }); } catch (err) { api.sendMessage("⚠️Error: " + err.message, event.threadID); } } }) }) } /*==================================== Help FUNC ====================================*/ else if (input == ("!slp")) { axios.get("https://api.coingecko.com/api/v3/coins/smooth-love-potion").then(response => { let info = response.data.name, ph = response.data.market_data.current_price.php, cap = response.data.market_data.market_cap.php, rnk = response.data.market_data.market_cap_rank, vol = response.data.market_data.total_volume.php, hgh = response.data.market_data.high_24h.php, lwh = response.data.market_data.low_24h.php, time = response.data.timestamp { var msg = { body: `Name: ${info}\n\nCurrent Price:\nPhp: ₱${ph}\nMarket Cap: ₱${cap}\nMarket Cap Rank: ${rnk}\nTrading Volume: ₱${vol}\n24H Low/24H High: ₱${lwh}/₱${hgh}\nTimestamp: ${time}`, attachment: fs.createReadStream(__dirname + "/pic/SLP.webp") } api.sendMessage(msg, event.threadID, event.messageID); }; }) } /*==================================== Help FUNC ====================================*/ else if (input == ("!help")) { api.sendMessage("KenBot Command List\n\n🔰!motivation\n\n🔰!jokes\n\n🔰!randomtheme\n\n🔰!randomemoji\n\n🔰!play <song_title> - to play music from youtube\n\n🔰!slp\n\n🔰!changetheme <theme color> - use command !themecolor\n\n🔰!themecolor - available theme list.\n\n🔰!ttVid <tt_url> - download video from TikTok.\n\n🔰!music <yt_url> - download music from YouTube.\n\n\n>>====== Educational ======<<\n\n🔰!ctf - Celcius to Fahrenheit\n🔰!ftc - Fahrenheit to Celcius\n🔰!ftk - Fahrenheit to Kelvin\n\n\nAuto Functions\n• Anti Unsent\n• Auto Greet\n\nCredits\n- Jeremy\n- Salvador", event.threadID); } /*==================================== RANDOMTHEME FUNC ====================================*/ else if (input == ("!randomtheme")) { let thm = ['196241301102133', '169463077092846', '2442142322678320', '234137870477637', '980963458735625', '175615189761153', '2136751179887052', '2058653964378557', '2129984390566328', '174636906462322', '1928399724138152', '417639218648241', '930060997172551', '164535220883264', '370940413392601', '205488546921017', '809305022860427']; var rum = thm[Math.floor(Math.random() * thm.length)] api.changeThreadColor(rum, event.threadID); setTimeout (function(){ api.sendMessage("Theme Changed Successfully", event.threadID); }, 1000); } /*==================================== TEMP CONVERTER FUNC ====================================*/ else if (/^!ctf\s(.*)/i.test(event.body)) { const data = event.body.match(/^!ctf\s(.*)/i); var celcius = data[1]; var t = 1.8; var percent = celcius * t; var answer = percent + 32; api.sendMessage(answer + " Fahrenheit", event.threadID, event.messageID); } else if (/^!ctk\s(.*)/i.test(event.body)) { const data = event.body.match(/^!ctk\s(.*)/i); var celcius = data[1]; var answer = (celcius) + 273.15; api.sendMessage(answer + " Kelvin.", event.threadID, event.messageID); } else if (/^!ftc\s(.*)/i.test(event.body)) { const data = event.body.match(/^!ftc\s(.*)/i); var celcius = data[1]; var t = 32; var percent = celcius - t; var answer = percent / 1.8; api.sendMessage(answer + " Celcius", event.threadID, event.messageID); } else if (/^!ftk\s(.*)/i.test(event.body)) { const data = event.body.match(/^!ftk\s(.*)/i); var far = data[1]; var answer = ((far-32)/1.8)+273.15; api.sendMessage(answer + " Kelvin", event.threadID, event.messageID); } else if (/^!ktc\s(.*)/i.test(event.body)) { const data = event.body.match(/^!ktc\s(.*)/i); var far = data[1]; var answer = far - 273.15; api.sendMessage(answer + " Celcius", event.threadID, event.messageID); } /*==================================== AUTO TIKTOK FUNC ====================================*/ else if (input.includes("https://vt.tiktok.com")) { let data = input.split(" "); if (data.length < 2) { api.sendMessage("⚠️Invalid Use Of Command!\n💡Usage: !TTVid vid_url", event.threadID); } else { api.sendMessage("🔃Trying to Download...", event.threadID, event.messageID); try { let s = leechTT(data[1]); s.then((response) => { if (response == "err") { api.sendMessage("❌Invalid Input", event.threadID, event.messageID); api.setMessageReaction("😭", event.messageID, (err) => { }, true); } else { var file = fs.createWriteStream("tiktok.mp4"); var targetUrl = response; var gifRequest = http.get(targetUrl, function (gifResponse) { gifResponse.pipe(file); file.on('finish', function () { console.log('finished downloading..') api.sendMessage('✅Download Complete! Uploading...', event.threadID) var message = { body: "KenBot Auto Download", attachment: fs.createReadStream(__dirname + '/tiktok.mp4') } api.sendMessage(message, event.threadID); }); }); } }); } catch (err) { api.sendMessage("⚠️Error: " + err.message, event.threadID); } } } /*==================================== RANDOM FUNC ====================================*/ else if (input == ("!randomemoji")) { let random = ['😀', '😃', '😄', '😁', '😆', '😅', '😂', '🤣', '☺️', '😊', '😇', '🙂', '🙃', '😉', '😌', '😍', '🥰', '😘', '😗', '😙', '😚', '😋', '😛', '😝', '😜', '🤪', '🤨', '🧐', '🤓', '😎', '🤩', '🥳', '😏', '😒', '😞', '😔', '😟', '😕', '🙁', '☹️', '😣', '😖', '😫', '😩', '🥺', '😢', '😭', '😤', '😠', '😡', '🤬', '🤯', '😳', '🥵', '🥶', '😱', '😨', '😰', '😥', '😓', '🤗', '🤔', '🤭', '🤫', '🤥', '😶', '😐', '😑', '😬', '🙄', '😯', '😦', '😧', '😮', '😲', '🥱', '😴', '🤤', '😪', '😵', '🤐', '🥴', '🤢', '🤮', '🤧', '😷', '🤒', '🤕', '🤑', '🤠'] var emoji = random[Math.floor(Math.random() * random.length)] api.changeThreadEmoji(emoji, event.threadID); setTimeout (function(){ api.sendMessage("Thread Emoji Changed Successfully", event.threadID); }, 1000); } /*==================================== MOTIVATION FUNC ====================================*/ else if (input.startsWith("!motivation")) { var mess = ['“In youth we run into difficulties. In old age difficulties run into us. ”\n\n—Beverly Sills', '“Hope and fear come from feeling that we lack something; they come from a sense of poverty.”\n\n—Pema Chodron', '”There are more quarrels smothered by just shutting your mouth, and holding it shut, than by all the wisdom in the world.”\n\n—Henry Ward Beecher', '“Yesterday is the past, tomorrow is the future, today is a gift - thats why it called the present.” \n\n—George Bernard Shaw', '“It’s not about perfect. It’s about effort.”\n\n– Jillian Michaels', '“Excellence is not a skill. It is an attitude.”\n\n– Ralph Marston', '“Focus on your goal. Don’t look in any direction but ahead.” \n\n–unknown', '“You don’t get what you wish for. You get what you work for.”\n\n – Daniel Milstein', '“Do something now; your future self will thank you for later.” – unknown', '“Don’t try to be perfect. Just try to be better than you were yesterday.”\n\n– unknown', '“Keep going. Everything you need will come to you at the perfect time.”\n\n– unknown', '“Even the greatest were beginners. Don’t be afraid to take that first step.”\n\n– unknown', '“Everything you’ve ever wanted is on the other side of fear.”\n\n– George Addair', '“Your time is limited, so don’t waste it living someone else’s life.”\n\n– Steve Jobs', '“You can’t use up creativity. The more you use, the more you have.”\n\n– Maya Angelou', '"The best way to gain self-confidence is to do what you are afraid to do."\n\n– Swati Sharma', '“If you hear a voice within you say ‘you cannot paint,’ then by all means paint, and that voice will be silenced.”\n\n– Vincent Van Gogh', '“Courage doesn’t always roar. Sometimes courage is the quiet voice at the end of the day saying ‘I will try again tomorrow’.”\n\n– Mary Anne Radmacher', '“Self-discipline is the magic power that makes you virtually unstoppable.”\n\n– Dan Kennedy'] var ran = mess[Math.floor(Math.random() * mess.length)] api.sendMessage(ran, event.threadID, event.messageID); api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } else if (/^!add\s(.*)/i.test(event.body)) { const data = event.body.match(/^!add\s(.*)/i); api.addUserToGroup(data[1], event.threadID, (err, data) => { api.sendMessage("Welcome", event.threadID); if (err) return console.error (err) }) } /*==================================== JOKES FUNC ====================================*/ else if (input == ("!jokes")) { var joke = ['Baril ka ba? Patira naman, kahit isang putok lang.', 'Lamesa ka ba?..gusto kitang patungan eh.', 'Para kang paaralan. Gusto kitang pasukan araw araw.', 'Siguro freezer ka tapos tubig naman ako. Pag pinasok kita, tumitigas ako.', 'Magic lamp ka ba? sige nga pahimas', 'Tricycle ka ba? Pasakay naman hanggang labasan lang.', 'Sana Palay ka nalang..para pwede kitang bayuhin', 'Fishball ka ba?.. ang sarap mong tuhugin eh', 'Sana manok ka nalang, para lagi mong inuupuan mga itlog ko.', 'Hey Im looking for treasure, Can I look around your chest?', 'Miss nawawala virginity ko... Pwede ba makuha yung sayo?', 'Ulan ka ba? Coz you make me wet eh..', 'Lollipop ka ba? Ang sarap mong laplapin eh', 'Alam mo para kang magnet. Tumataas skirt ko sayo eh', 'Para kang ketchup...Lagi ka kasing hinahanap ng hotdog ko eh', 'Rugby ka ba? Ang sarap mo kasi singhutin eh', 'Ang taong nagkakamot ng pwet bago matulog. Gigising ng ang daliri ay mabantot', 'Ang taong makati...sa AIDS nadadali.', 'Aanhin pa ang damit kung huhubarin din sa gabing nag iinit', 'Aanhin mo ang malaking Tit* kung maliit naman ang butas ng iyong Pip*', 'Sira ang pag-aaral, pag libog ang pinairal.', 'Ang lumalakad ng matulin...Hinahabol ng BOMBAY.', 'Ang batang masipag...Paglaki "KATULONG".', 'Biruin mo na ang lasing. Wag lang ang bading na naagawan ng booking', ] var ron = joke[Math.floor(Math.random() * joke.length)] api.sendMessage(ron + "\n\nKenBot Jokes", event.threadID, event.messageID); api.setMessageReaction("❤️", event.messageID, (err) => { }, true); } /*==================================== THEMELST FUNC ====================================*/ else if (input ==("!themecolor")) { api.setMessageReaction("❤️", event.messageID, (err) => { api.sendMessage("𝐓𝐡𝐞𝐦𝐞 𝐋𝐢𝐬𝐭\n▪️ Default\n▪️ HotPink\n▪️ AquaBlue\n▪️ BrightPurple\n▪️ CoralPink\n▪️ Orange\n▪️ Green\n▪️ LavenderPurple\n▪️ RadicalRed\n▪️ Yellow\n▪️ TealBlue\n▪️ Aqua\n▪️ Mango\n▪️ Berry\n▪️ Citrus\n▪️ Candy\n\nNote: Copy the exact format to change the theme.\n\n-KenBot", event.threadID, event.messageID); }, true); } /*==================================== CHANGETHEME FUNC ====================================*/ else if (input.startsWith("!changetheme")) { api.getUserInfo(event.senderID, (err, data) => { if (data.length < 2) { api.setMessageReaction("😠", event.messageID, (err) => { api.sendMessage("Invalid use of command" + "\nUsage: !changetheme <themecolor>", event.threadID); }, true); } else { if (input == ("!changetheme Default")) { api.sendMessage(data[event.senderID]['name'] + " requested to change the theme to Default.", event.threadID); setTimeout(function () { api.changeThreadColor("196241301102133", event.threadID, (err) => { if(err) return console.error(err); api.sendMessage("Theme Changed Successfully", event.threadID); }); }, 5000); } else if (input == ("!changetheme HotPink")) { api.sendMessage(data[event.senderID]['name'] + " requested to change the theme to HotPink.", event.threadID); setTimeout(function () { api.changeThreadColor("169463077092846", event.threadID, (err) => { if(err) return console.error(err); api.sendMessage("Theme Changed Successfully", event.threadID); }); }, 5000); } else if (input == ("!changetheme AquaBlue")) { api.sendMessage(data[event.senderID]['name'] + " requested to change the theme to AquaBlue.", event.threadID); setTimeout(function () { api.changeThreadColor("2442142322678320", event.threadID, (err) => { if(err) return console.error(err); api.sendMessage("Theme Changed Successfully", event.threadID); }); }, 5000); } else if (input == ("!changetheme BrightPurple")) { api.sendMessage(data[event.senderID]['name'] + " requested to change the theme to BrightPurple", event.threadID); setTimeout(function () { api.changeThreadColor("234137870477637", event.threadID, (err) => { if(err) return console.error(err); api.sendMessage("Theme Changed Successfully", event.threadID); }); }, 5000); } else if (input == ("!changetheme CoralPink")){ api.sendMessage(data[event.senderID]['name'] + " requested to change the theme to CoralPink", event.threadID); setTimeout(function () { api.changeThreadColor("980963458735625", event.threadID, (err) => { if(err) return console.error(err); api.sendMessage("Theme Changed Successfully", event.threadID); }); }, 5000); } else if (input == ("!changetheme Orange")){ api.sendMessage(data[event.senderID]['name'] + " requested to change the theme to Orange", event.threadID); setTimeout(function () { api.changeThreadColor("175615189761153", event.threadID, (err) => { if(err) return console.error(err); api.sendMessage("Theme Changed Successfully", event.threadID); }); }, 5000); } else if (input == ("!changetheme Green")){ api.sendMessage(data[event.senderID]['name'] + " requested to change the theme to Green", event.threadID); setTimeout(function () { api.changeThreadColor("2136751179887052", event.threadID, (err) => { if(err) return console.error(err); api.sendMessage("Theme Changed Successfully", event.threadID); }); }, 5000); } else if (input == ("!changetheme LavenderPurple")){ api.sendMessage(data[event.senderID]['name'] + " requested to change the theme to LavenderPurple", event.threadID); setTimeout(function () { api.changeThreadColor("2058653964378557", event.threadID, (err) => { if(err) return console.error(err); api.sendMessage("Theme Changed Successfully", event.threadID); }); }, 5000); } else if (input == ("!changetheme Red")){ api.sendMessage(data[event.senderID]['name'] + " requested to change the theme to Red", event.threadID); setTimeout(function () { api.changeThreadColor("2129984390566328", event.threadID, (err) => { if(err) return console.error(err); api.sendMessage("Theme Changed Successfully", event.threadID); }); }, 5000); } else if (input == ("!changetheme Yellow")){ api.sendMessage(data[event.senderID]['name'] + " requested to change the theme to Yellow.", event.threadID); setTimeout(function () { api.changeThreadColor("174636906462322", event.threadID, (err) => { if(err) return console.error(err); api.sendMessage("Theme Changed Successfully", event.threadID); }); }, 5000); } else if (input == ("!changetheme TealBlue")){ api.sendMessage(data[event.senderID]['name'] + " requested to change the theme to TealBlue.", event.threadID); setTimeout(function () { api.changeThreadColor("1928399724138152", event.threadID, (err) => { if(err) return console.error(err); api.sendMessage("Theme Changed Successfully", event.threadID); }); }, 5000); } else if (input == ("!changetheme Aqua")){ api.sendMessage(data[event.senderID]['name'] + " requested to change the theme to Aqua", event.threadID); setTimeout(function () { api.changeThreadColor("417639218648241", event.threadID, (err) => { if(err) return console.error(err); api.sendMessage("Theme Changed Successfully", event.threadID); }); }, 5000); } else if (input == ("!changetheme Mango")){ api.sendMessage(data[event.senderID]['name'] + " requested to change the theme to Mango.", event.threadID); setTimeout(function () { api.changeThreadColor("930060997172551", event.threadID, (err) => { if(err) return console.error(err); api.sendMessage("Theme Changed Successfully", event.threadID); }); }, 5000); } else if (input == ("!changetheme Berry")){ api.sendMessage(data[event.senderID]['name'] + " requested to change the theme to Berry.", event.threadID); setTimeout(function () { api.changeThreadColor("164535220883264", event.threadID, (err) => { if(err) return console.error(err); api.sendMessage("Theme Changed Successfully", event.threadID); }) }, 5000); } else if (input == ("!changetheme Citrus")){ api.sendMessage(data[event.senderID]['name'] + " requested to change the theme to Citrus.", event.threadID); setTimeout(function () { api.changeThreadColor("370940413392601", event.threadID, (err) => { if(err) return console.error(err); api.sendMessage("Theme Changed Successfully", event.threadID); }); }, 5000); } else if (input == ("!changetheme Candy")){ api.sendMessage(data[event.senderID]['name'] + " requested to change the theme to Candy.", event.threadID); setTimeout(function () { api.changeThreadColor("205488546921017", event.threadID, (err) => { if(err) return console.error(err); api.sendMessage("Theme Changed Successfully", event.threadID); }); }, 5000); } /*==================================== MOTIVATION FUNC ====================================*/ } }); } }; break; case "message_unsend": if (!vips.includes(event.senderID)) { let d = msgs[event.messageID]; if (typeof (d) == "object") { api.getUserInfo(event.senderID, (err, data) => { if (err) return console.error(err); else { if (d[0] == "img") { var file = fs.createWriteStream("photo.jpg"); var gifRequest = http.get(d[1], function (gifResponse) { gifResponse.pipe(file); file.on('finish', function () { console.log('finished downloading photo..') var message = { body: data[event.senderID]['name'] + " unsent this photo: \n", attachment: fs.createReadStream(__dirname + '/photo.jpg') } api.sendMessage(message, event.threadID); }); }); } else if (d[0] == "vid") { var file = fs.createWriteStream("video.mp4"); var gifRequest = http.get(d[1], function (gifResponse) { gifResponse.pipe(file); file.on('finish', function () { console.log('finished downloading video..') var message = { body: data[event.senderID]['name'] + " unsent this video: \n", attachment: fs.createReadStream(__dirname + '/video.mp4') } api.sendMessage(message, event.threadID); }); }); }// GIF unsent test else if (d[0] == "gif") { var file = fs.createWriteStream("animated_image.gif"); var gifRequest = http.get(d[1], function (gifResponse) { gifResponse.pipe(file); file.on('finish', function () { console.log('finished downloading gif..') var message = { body: data[event.senderID]['name'] + " unsent this GIF: \n", attachment: fs.createReadStream(__dirname + '/animated_image.gif') } api.sendMessage(message, event.threadID); }); }); } else if (d[0] == "sticker") { var file = fs.createWriteStream("sticker.png"); var gifRequest = http.get(d[1], function (gifResponse) { gifResponse.pipe(file); file.on('finish', function () { console.log('finished downloading gif..') var message = { body: data[event.senderID]['name'] + " unsent this Sticker: \n", attachment: fs.createReadStream(__dirname + '/sticker.png') } api.sendMessage(message, event.threadID); }); }); } else if (d[0] == "vm") { var file = fs.createWriteStream("vm.mp3"); var gifRequest = http.get(d[1], function (gifResponse) { gifResponse.pipe(file); file.on('finish', function () { console.log('finished downloading audio..') var message = { body: data[event.senderID]['name'] + " unsent this audio: \n", attachment: fs.createReadStream(__dirname + '/vm.mp3') } api.sendMessage(message, event.threadID); }); }); } } }); } else { api.getUserInfo(event.senderID, (err, data) => { if (err) return console.error("Error: files are"+err+ "Anti Unsent By KenBot"); else { api.sendMessage(data[event.senderID]['name'] + " unsent this: \n" + msgs[event.messageID] + "\n\nAnti Unsent By KenBot\nCoded with ❤️ by: Ken", event.threadID); } }); } break; } } }); }); // CODE BY: KEN // GUIDE BY JHAYNOTJ // PLEASE EXPLORE!!!!