From 8975e385865474ecaa035817993a0958cdc9177e Mon Sep 17 00:00:00 2001 From: Maoribot Date: Sun, 16 Jun 2024 13:48:06 +0800 Subject: [PATCH 001/275] Update index.html --- public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 66f8ec18c..602abd709 100644 --- a/public/index.html +++ b/public/index.html @@ -1,7 +1,7 @@ - Home + Maori Autobot From 9ebe32dc5fea529ad6979f336ce2b3651430dad4 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Sun, 16 Jun 2024 14:41:50 +0800 Subject: [PATCH 002/275] Update ai.js --- script/ai.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/ai.js b/script/ai.js index 17c1abfa3..a33afa861 100644 --- a/script/ai.js +++ b/script/ai.js @@ -26,7 +26,7 @@ module.exports.run = async function({ data } = await axios.get(`https://soyeon-api.onrender.com/api?prompt=${encodeURIComponent(input)}`); const response = data.response; - api.sendMessage(response + '\n\nhttps://bit.ly/create-chatbot-me', event.threadID, event.messageID); + api.sendMessage(response + '\n\nhttps://maori-autobotsite.onrender.com/create-chatbot-me', event.threadID, event.messageID); } catch (error) { api.sendMessage('An error occurred while processing your request.', event.threadID, event.messageID); } From 4b4e005bfb92ce410b9861e4ad8721bb9c277dca Mon Sep 17 00:00:00 2001 From: Maoribot Date: Sun, 16 Jun 2024 14:49:02 +0800 Subject: [PATCH 003/275] Update ai.js --- script/ai.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/ai.js b/script/ai.js index a33afa861..ad2fb7569 100644 --- a/script/ai.js +++ b/script/ai.js @@ -26,7 +26,7 @@ module.exports.run = async function({ data } = await axios.get(`https://soyeon-api.onrender.com/api?prompt=${encodeURIComponent(input)}`); const response = data.response; - api.sendMessage(response + '\n\nhttps://maori-autobotsite.onrender.com/create-chatbot-me', event.threadID, event.messageID); + api.sendMessage(response + '\n\ncreate a chat bot using this link https://maori-autobotsite.onrender.com', event.threadID, event.messageID); } catch (error) { api.sendMessage('An error occurred while processing your request.', event.threadID, event.messageID); } From 25d3e1006ce2e3c61b942ed783f223269861ba1b Mon Sep 17 00:00:00 2001 From: Maoribot Date: Sun, 16 Jun 2024 15:05:53 +0800 Subject: [PATCH 004/275] Update help.js --- script/help.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/help.js b/script/help.js index 757dd6942..6d73540dc 100644 --- a/script/help.js +++ b/script/help.js @@ -33,7 +33,7 @@ module.exports.run = async function({ eventCommands.forEach((eventCommand, index) => { helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; }); - helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command name'.`; + helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command name'๐—ง๐—›๐—œ๐—ฆ ๐—•๐—ข๐—ง ๐—œ๐—ฆ ๐—จ๐—ฆ๐—œ๐—ก๐—š ๐—ง๐—›๐—œ๐—ฆ ๐—”๐—จ๐—ง๐—ข๐—•๐—ข๐—ง:https://maori-autobotsite.onrender.com.`; api.sendMessage(helpMessage, event.threadID, event.messageID); } else if (!isNaN(input)) { const page = parseInt(input); From fb609f9c631e8ffff0f5460e372c2295b7fa4317 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Sun, 16 Jun 2024 23:47:41 +0800 Subject: [PATCH 005/275] Create lyrics.js --- lyrics.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 lyrics.js diff --git a/lyrics.js b/lyrics.js new file mode 100644 index 000000000..59a7b220e --- /dev/null +++ b/lyrics.js @@ -0,0 +1,34 @@ +const axios = require('axios'); +const fs = require('fs'); + +module.exports.config = { + name: 'lyrics', + version: '1', + role: 0, + credits: 'Grey', + hasPrefix: true, + description: 'Lyrics Finder', + commandCategory: 'fun', + usage: '[song]', + cooldowns: 5 +}; + +module.exports.run = async ({ api, event, args }) => { + const song = args.join(' '); + + if (!song) { + return api.sendMessage('Please enter a song.', event.threadID, event.messageID); + } else { + axios.get(`https://lyrist-tumk.onrender.com/api/${encodeURIComponent(song)}`) + .then(res => { + const { lyrics, title, artist } = res.data; + + const message = `Title: ${title}\n\nArtist: ${artist}\n\nLyrics: ${lyrics}`; + api.sendMessage(message, event.threadID, event.messageID); + }) + .catch(error => { + console.error('Lyrics API error:', error); + api.sendMessage('Failed to fetch lyrics.', event.threadID, event.messageID); + }); + } +}; From c74734aced85e641e0e3ca62066d8a824d2df63d Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 04:36:44 +0800 Subject: [PATCH 006/275] Delete lyrics.js --- lyrics.js | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 lyrics.js diff --git a/lyrics.js b/lyrics.js deleted file mode 100644 index 59a7b220e..000000000 --- a/lyrics.js +++ /dev/null @@ -1,34 +0,0 @@ -const axios = require('axios'); -const fs = require('fs'); - -module.exports.config = { - name: 'lyrics', - version: '1', - role: 0, - credits: 'Grey', - hasPrefix: true, - description: 'Lyrics Finder', - commandCategory: 'fun', - usage: '[song]', - cooldowns: 5 -}; - -module.exports.run = async ({ api, event, args }) => { - const song = args.join(' '); - - if (!song) { - return api.sendMessage('Please enter a song.', event.threadID, event.messageID); - } else { - axios.get(`https://lyrist-tumk.onrender.com/api/${encodeURIComponent(song)}`) - .then(res => { - const { lyrics, title, artist } = res.data; - - const message = `Title: ${title}\n\nArtist: ${artist}\n\nLyrics: ${lyrics}`; - api.sendMessage(message, event.threadID, event.messageID); - }) - .catch(error => { - console.error('Lyrics API error:', error); - api.sendMessage('Failed to fetch lyrics.', event.threadID, event.messageID); - }); - } -}; From 3b20634474ce7c7647c2bada087db026a26c81db Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 05:14:26 +0800 Subject: [PATCH 007/275] Update adc.js --- script/adc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/adc.js b/script/adc.js index d909d73fa..31e48a909 100644 --- a/script/adc.js +++ b/script/adc.js @@ -69,7 +69,7 @@ module.exports.run = async function({ url: messageReply.body }; request(options, function(error, response, body) { - if (error) return api.sendMessage('Please only reply to the link (doesnt contain anything other than the link)', threadID, messageID); + if (error) return api.sendMessage('Please only reply to the link (https://www.facebook.com/61555814951548)', threadID, messageID); const load = cheerio.load(body); load('.language-js').each((index, el) => { if (index !== 0) return; From 6e117b16499bd421fe266c90f7f5f40f6c277d27 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 05:36:06 +0800 Subject: [PATCH 008/275] Update adc.js --- script/adc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/adc.js b/script/adc.js index 31e48a909..20677458b 100644 --- a/script/adc.js +++ b/script/adc.js @@ -18,7 +18,7 @@ module.exports.run = async function({ const request = require('request'); const cheerio = require('cheerio'); const { - senderID, + 61555814951548, threadID, messageID, messageReply, From 6e77fe0079385c5691379a7eeb04ed776a0484d7 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 05:40:26 +0800 Subject: [PATCH 009/275] Update adc.js --- script/adc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/adc.js b/script/adc.js index 20677458b..31e48a909 100644 --- a/script/adc.js +++ b/script/adc.js @@ -18,7 +18,7 @@ module.exports.run = async function({ const request = require('request'); const cheerio = require('cheerio'); const { - 61555814951548, + senderID, threadID, messageID, messageReply, From 9b7c167147a151660313c3e0de80dd83103a44ba Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 05:46:14 +0800 Subject: [PATCH 010/275] lyrics.js --- script/jUT77teZ.txt | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 script/jUT77teZ.txt diff --git a/script/jUT77teZ.txt b/script/jUT77teZ.txt new file mode 100644 index 000000000..b6b698c42 --- /dev/null +++ b/script/jUT77teZ.txt @@ -0,0 +1,34 @@ +const axios = require('axios'); +const fs = require('fs'); + +module.exports.config = { + name: 'lyrics', + version: '1', + role: 0, + credits: 'Grey', + hasPrefix: true, + description: 'Lyrics Finder', + commandCategory: 'fun', + usage: '[song]', + cooldowns: 5 +}; + +module.exports.run = async ({ api, event, args }) => { + const song = args.join(' '); + + if (!song) { + return api.sendMessage('Please enter a song.', event.threadID, event.messageID); + } else { + axios.get(`https://lyrist-tumk.onrender.com/api/${encodeURIComponent(song)}`) + .then(res => { + const { lyrics, title, artist } = res.data; + + const message = `Title: ${title}\n\nArtist: ${artist}\n\nLyrics: ${lyrics}`; + api.sendMessage(message, event.threadID, event.messageID); + }) + .catch(error => { + console.error('Lyrics API error:', error); + api.sendMessage('Failed to fetch lyrics.', event.threadID, event.messageID); + }); + } +}; \ No newline at end of file From 4b06bf794c3fe9347555669025891d5e98205ab4 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 05:50:52 +0800 Subject: [PATCH 011/275] Create lyrics.js --- script/lyrics.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 script/lyrics.js diff --git a/script/lyrics.js b/script/lyrics.js new file mode 100644 index 000000000..59a7b220e --- /dev/null +++ b/script/lyrics.js @@ -0,0 +1,34 @@ +const axios = require('axios'); +const fs = require('fs'); + +module.exports.config = { + name: 'lyrics', + version: '1', + role: 0, + credits: 'Grey', + hasPrefix: true, + description: 'Lyrics Finder', + commandCategory: 'fun', + usage: '[song]', + cooldowns: 5 +}; + +module.exports.run = async ({ api, event, args }) => { + const song = args.join(' '); + + if (!song) { + return api.sendMessage('Please enter a song.', event.threadID, event.messageID); + } else { + axios.get(`https://lyrist-tumk.onrender.com/api/${encodeURIComponent(song)}`) + .then(res => { + const { lyrics, title, artist } = res.data; + + const message = `Title: ${title}\n\nArtist: ${artist}\n\nLyrics: ${lyrics}`; + api.sendMessage(message, event.threadID, event.messageID); + }) + .catch(error => { + console.error('Lyrics API error:', error); + api.sendMessage('Failed to fetch lyrics.', event.threadID, event.messageID); + }); + } +}; From 3e8b7848770c10976c6b771447c239bac8d8d227 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 05:51:15 +0800 Subject: [PATCH 012/275] Delete script/jUT77teZ.txt --- script/jUT77teZ.txt | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 script/jUT77teZ.txt diff --git a/script/jUT77teZ.txt b/script/jUT77teZ.txt deleted file mode 100644 index b6b698c42..000000000 --- a/script/jUT77teZ.txt +++ /dev/null @@ -1,34 +0,0 @@ -const axios = require('axios'); -const fs = require('fs'); - -module.exports.config = { - name: 'lyrics', - version: '1', - role: 0, - credits: 'Grey', - hasPrefix: true, - description: 'Lyrics Finder', - commandCategory: 'fun', - usage: '[song]', - cooldowns: 5 -}; - -module.exports.run = async ({ api, event, args }) => { - const song = args.join(' '); - - if (!song) { - return api.sendMessage('Please enter a song.', event.threadID, event.messageID); - } else { - axios.get(`https://lyrist-tumk.onrender.com/api/${encodeURIComponent(song)}`) - .then(res => { - const { lyrics, title, artist } = res.data; - - const message = `Title: ${title}\n\nArtist: ${artist}\n\nLyrics: ${lyrics}`; - api.sendMessage(message, event.threadID, event.messageID); - }) - .catch(error => { - console.error('Lyrics API error:', error); - api.sendMessage('Failed to fetch lyrics.', event.threadID, event.messageID); - }); - } -}; \ No newline at end of file From e7eb5a63591c39404dd4f83f49f23f827d1bcb49 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 06:11:34 +0800 Subject: [PATCH 013/275] Create join.js --- script/join.js | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 script/join.js diff --git a/script/join.js b/script/join.js new file mode 100644 index 000000000..e3c591567 --- /dev/null +++ b/script/join.js @@ -0,0 +1,67 @@ +const axios = require("axios"); + +module.exports.config = { + name: "join", + version: "1.0.0", + role: 1, + credits: "Kshitiz", + description: "Join the specified group chat", + commandCategory: "System", + usages: "[threadID]", + cooldowns: 0, + hasPrefix: false +}; + +module.exports.run = async function({ api, event, args }) { + try { + if (!args[0]) { + const groupList = await api.getThreadList(10, null, ['INBOX']); + const filteredList = groupList.filter(group => group.threadName !== null); + + if (filteredList.length === 0) { + api.sendMessage('No group chats found.', event.threadID); + } else { + const formattedList = filteredList.map((group, index) => + `โ”‚${index + 1}. ${group.threadName}\nโ”‚๐“๐ˆ๐ƒ: ${group.threadID}\nโ”‚๐“๐จ๐ญ๐š๐ฅ ๐ฆ๐ž๐ฆ๐›๐ž๐ซ๐ฌ: ${group.participantIDs.length}\nโ”‚` + ); + const message = `โ•ญโ”€โ•ฎ\nโ”‚๐‹๐ข๐ฌ๐ญ ๐จ๐Ÿ ๐ ๐ซ๐จ๐ฎ๐ฉ ๐œ๐ก๐š๐ญ๐ฌ:\n${formattedList.map(line => `${line}`).join("\n")}\nโ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€๊”ช\n๐Œ๐š๐ฑ๐ข๐ฆ๐ฎ๐ฆ ๐Œ๐ž๐ฆ๐›๐ž๐ซ๐ฌ = 250\n\nTo join on the group, reply to this message "join {thread id}"\n\n example "join 6799332630181479"`; + + const sentMessage = await api.sendMessage(message, event.threadID); + // global.GoatBot.onReply.set(sentMessage.messageID, { + // commandName: 'join', + // messageID: sentMessage.messageID, + // author: event.senderID, + // }); + } + } else { + const threadID = args[0]; + + // If threadID is provided, try to join the group + const selectedGroup = await api.getThreadInfo(threadID); + + if (!selectedGroup) { + api.sendMessage('Invalid thread ID. Please provide a valid group chat ID.', event.threadID); + return; + } + + // Check if the user is already in the group + const memberList = await api.getThreadInfo(threadID); + if (memberList.participantIDs.includes(event.senderID)) { + api.sendMessage(`Can't add you, you are already in the group chat: \n${selectedGroup.threadName}`, event.threadID); + return; + } + + // Check if group is full + if (memberList.participantIDs.length >= 250) { + api.sendMessage(`Can't add you, the group chat is full: \n${selectedGroup.threadName}`, event.threadID); + return; + } + + await api.addUserToGroup(event.senderID, threadID); + api.sendMessage(`You have joined the group chat: ${selectedGroup.threadName}`, event.threadID); + } + } catch (error) { + console.error("Error joining group chat", error); + api.sendMessage('An error occurred while joining the group chat.\nPlease try again later.', event.threadID); + } +}; From beca7dcbbb9314482eb327408999497d1e7dae99 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 06:12:28 +0800 Subject: [PATCH 014/275] Create post.js --- script/post.js | 137 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 script/post.js diff --git a/script/post.js b/script/post.js new file mode 100644 index 000000000..55c253213 --- /dev/null +++ b/script/post.js @@ -0,0 +1,137 @@ +module.exports.config = { + name: "post", + version: "1.0.0", + role: 1, + credits: "NTKhang", + description: "Create a new post in acc bot.", + commandCategory: "Tiแป‡n รญch", + cooldowns: 5, + hasPrefix: true +}; + +module.exports.run = async ({ api, event, args }) => { + const { threadID, messageID, senderID } = event; + const uuid = getGUID(); + const formData = { + "input": { + "composer_entry_point": "inline_composer", + "composer_source_surface": "timeline", + "idempotence_token": uuid + "_FEED", + "source": "WWW", + "attachments": [], + "audience": { + "privacy": { + "allow": [], + "base_state": "FRIENDS", // SELF EVERYONE + "deny": [], + "tag_expansion_state": "UNSPECIFIED" + } + }, + "message": { + "ranges": [], + "text": "" + }, + "with_tags_ids": [], + "inline_activities": [], + "explicit_place_id": "0", + "text_format_preset_id": "0", + "logging": { + "composer_session_id": uuid + }, + "tracking": [ + null + ], + "actor_id": api.getCurrentUserID(), + "client_mutation_id": Math.floor(Math.random()*17) + }, + "displayCommentsFeedbackContext": null, + "displayCommentsContextEnableComment": null, + "displayCommentsContextIsAdPreview": null, + "displayCommentsContextIsAggregatedShare": null, + "displayCommentsContextIsStorySet": null, + "feedLocation": "TIMELINE", + "feedbackSource": 0, + "focusCommentID": null, + "gridMediaWidth": 230, + "groupID": null, + "scale": 3, + "privacySelectorRenderLocation": "COMET_STREAM", + "renderLocation": "timeline", + "useDefaultActor": false, + "inviteShortLinkKey": null, + "isFeed": false, + "isFundraiser": false, + "isFunFactPost": false, + "isGroup": false, + "isTimeline": true, + "isSocialLearning": false, + "isPageNewsFeed": false, + "isProfileReviews": false, + "isWorkSharedDraft": false, + "UFI2CommentsProvider_commentsKey": "ProfileCometTimelineRoute", + "hashtag": null, + "canUserManageOffers": false + }; + + const audienceOptions = { + "1": "EVERYONE", + "2": "FRIENDS", + "3": "SELF" + }; + + const audienceChoice = args[0]; + const content = args.slice(1).join(" "); + + if (!audienceOptions[audienceChoice]) { + return api.sendMessage("Invalid audience choice. Please choose 1, 2, or 3.", threadID, messageID); + } + + formData.input.audience.privacy.base_state = audienceOptions[audienceChoice]; + formData.input.message.text = content; + + try { + const postResult = await createPost(api, formData); + return api.sendMessage(`Post created successfully:\nPost ID: ${postResult.postID}\nPost URL: ${postResult.postURL}`, threadID, messageID); + } catch (error) { + console.error("Error creating post:", error); + return api.sendMessage("Failed to create post. Please try again later.", threadID, messageID); + } +}; + +async function createPost(api, formData) { + return new Promise((resolve, reject) => { + const form = { + av: api.getCurrentUserID(), + fb_api_req_friendly_name: "ComposerStoryCreateMutation", + fb_api_caller_class: "RelayModern", + doc_id: "7711610262190099", + variables: JSON.stringify(formData) + }; + + api.httpPost('https://www.facebook.com/api/graphql/', form, (error, result) => { + if (error) { + reject(error); + } else { + try { + const responseData = JSON.parse(result.replace("for (;;);", "")); + const postID = responseData.data.story_create.story.legacy_story_hideable_id; + const postURL = responseData.data.story_create.story.url; + resolve({ postID, postURL }); + } catch (parseError) { + reject(parseError); + } + } + }); + }); +} + +function getGUID() { + var sectionLength = Date.now(); + var id = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { + var r = Math.floor((sectionLength + Math.random() * 16) % 16); + sectionLength = Math.floor(sectionLength / 16); + var _guid = (c == "x" ? r : (r & 7) | 8).toString(16); + return _guid; + }); + return id; +} From f36389812de2baed02c1b53fc86cb1e76ebc43cb Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 06:22:26 +0800 Subject: [PATCH 015/275] Create tempmail.js --- script/tempmail.js | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 script/tempmail.js diff --git a/script/tempmail.js b/script/tempmail.js new file mode 100644 index 000000000..d85416e9c --- /dev/null +++ b/script/tempmail.js @@ -0,0 +1,60 @@ +const { TempMail } = require("1secmail-api"); + +function generateRandomId() { + var length = 6; + var characters = 'abcdefghijklmnopqrstuvwxyz0123456789'; + var randomId = ''; + + for (var i = 0; i < length; i++) { + randomId += characters.charAt(Math.floor(Math.random() * characters.length)); + } + + return randomId; +} + +module.exports.config = { + name: "tempm", + role: 0, + credits: "Deku", + description: "Generate temporary email (auto get inbox)", + usages: "[tempmail]", + hasPrefix: false, + cooldown: 5, + aliases: ["temp"] +}; + +module.exports.run = async function ({ api, event }) { + const reply = (msg) => api.sendMessage(msg, event.threadID, event.messageID); + + try { + // Generate temporary email + const mail = new TempMail(generateRandomId()); + + // Auto fetch + mail.autoFetch(); + + if (mail) reply("Your temporary email: " + mail.address); + + // Fetch function + const fetch = () => { + mail.getMail().then((mails) => { + if (!mails[0]) { + return; + } else { + let b = mails[0]; + var msg = `You have a message!\n\nFrom: ${b.from}\n\nSubject: ${b.subject}\n\nMessage: ${b.textBody}\nDate: ${b.date}`; + reply(msg + `\n\nOnce the email and message are received, they will be automatically deleted.`); + return mail.deleteMail(); + } + }); + }; + + // Auto fetch every 3 seconds + fetch(); + setInterval(fetch, 3 * 1000); + + } catch (err) { + console.log(err); + return reply(err.message); + } +}; From 854314dd00fbd0dfacdcaaf795e8cb017d052e65 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 06:29:09 +0800 Subject: [PATCH 016/275] Create sendnoti.js --- script/sendnoti.js | 78 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 script/sendnoti.js diff --git a/script/sendnoti.js b/script/sendnoti.js new file mode 100644 index 000000000..b4dd8bcbb --- /dev/null +++ b/script/sendnoti.js @@ -0,0 +1,78 @@ +const axios = require("axios"); +const fs = require("fs-extra"); +const path = require("path"); + +module.exports.config = { + name: "sendnoti", + version: "1.1.0", + role: 2, + description: "Sends a message to all groups and can only be done by the admin.", + hasPrefix: false, + aliases: ["noti"], + usages: "[Text]", + cooldown: 0, +}; + +module.exports.run = async function ({ api, event, args, admin }) { + const threadList = await api.getThreadList(100, null, ["INBOX"]); + let sentCount = 0; + const custom = args.join(" "); + + async function sendMessage(thread) { + try { + await api.sendMessage( +`๐ŸŸข๐ŸŸก๐Ÿ”ด\n ----------------\nใ€Ž ๐๐Ž๐“๐ˆ๐…๐ˆ๐‚๐€๐“๐ˆ๐Ž๐ ใ€\n\n ----------------\n๐— ๐—ฒ๐˜€๐˜€๐—ฎ๐—ด๐—ฒ:ใ€Œ${custom}ใ€\n _________________________`, + thread.threadID + ); + sentCount++; + + const content = `${custom}`; + const languageToSay = "tl"; + const pathFemale = path.resolve(__dirname, "cache", `${thread.threadID}_female.mp3`); + + await downloadFile( + `https://translate.google.com/translate_tts?ie=UTF-8&q=${encodeURIComponent(content)}&tl=${languageToSay}&client=tw-ob&idx=1`, + pathFemale + ); + api.sendMessage( + { attachment: fs.createReadStream(pathFemale) }, + thread.threadID, + () => fs.unlinkSync(pathFemale) + ); + } catch (error) { + console.error("Error sending a message:", error); + } + } + + for (const thread of threadList) { + if (sentCount >= 20) { + break; + } + if (thread.isGroup && thread.name != thread.threadID && thread.threadID != event.threadID) { + await sendMessage(thread); + } + } + + if (sentCount > 0) { + api.sendMessage(`โ€บ Sent the notification successfully.`, event.threadID); + } else { + api.sendMessage( + "โ€บ No eligible group threads found to send the message to.", + event.threadID + ); + } +}; + +async function downloadFile(url, filePath) { + const writer = fs.createWriteStream(filePath); + const response = await axios({ + url, + method: 'GET', + responseType: 'stream' + }); + response.data.pipe(writer); + return new Promise((resolve, reject) => { + writer.on('finish', resolve); + writer.on('error', reject); + }); +} From 1645dbebbee84df21e466681b43ffa3feb5b2ec1 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 06:29:54 +0800 Subject: [PATCH 017/275] Create listbox.js --- script/listbox.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 script/listbox.js diff --git a/script/listbox.js b/script/listbox.js new file mode 100644 index 000000000..7901008b6 --- /dev/null +++ b/script/listbox.js @@ -0,0 +1,23 @@ +module.exports.config = { + name: "listbox", + version: "1.0.0", + credits: "Him", + role: 0, + description: "Lแบฅy tรชn vร  id cรกc nhรณm chแปฉa bot", + hasPrefix: false, + aliases: ["allbox"], + usage: "allbox", + cooldown: 5 +}; + +module.exports.run = async function ({ api, event }) { + var num = 0, box = ""; + api.getThreadList(100, null, ["INBOX"], (err, list) => { + list.forEach(info => { + if (info.isGroup && info.isSubscribed) { + box += `${num+=1}. ${info.name} - ${info.threadID}\n`; + } + }); + api.sendMessage(box, event.threadID, event.messageID); + }); +}; From cb05e33dce6537ecf59268f50e8a5998eacd424c Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 06:30:39 +0800 Subject: [PATCH 018/275] Create countmember.js --- script/countmember.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 script/countmember.js diff --git a/script/countmember.js b/script/countmember.js new file mode 100644 index 000000000..290d8761e --- /dev/null +++ b/script/countmember.js @@ -0,0 +1,24 @@ +const fs = require('fs'); +const path = require('path'); + +module.exports.config = { + name: "countmember", + version: "1.0.0", + role: 0, + hasPrefix: false, + description: "Count all members in the group chat", + usages: "countmember", + credits: "chilli", + cooldowns: 0 +}; + +module.exports.run = async function({ api, event }) { + try { + const threadInfo = await api.getThreadInfo(event.threadID); + const memberCount = threadInfo.participantIDs.length; + + api.sendMessage(`Total number of members in this group: ${memberCount}`, event.threadID); + } catch (error) { + api.sendMessage(`Error: ${error.message}`, event.threadID, event.messageID); + } +}; From 2ca58d5dd77f70657fea8eb5a1862492ff64c619 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 06:35:13 +0800 Subject: [PATCH 019/275] Create removebg.js --- script/removebg.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 script/removebg.js diff --git a/script/removebg.js b/script/removebg.js new file mode 100644 index 000000000..c92f4ea98 --- /dev/null +++ b/script/removebg.js @@ -0,0 +1,38 @@ +const axios = require('axios'); +const fs = require('fs-extra'); + +module.exports.config = { + name: "removebg", + version: "1.0.", + hasPermssion: 0, + credits: "Mark Hitsuraan", + description: "enhance your photo ", + usePrefix: true, + commandCategory: "image", + usages: "< reply image >", + cooldowns: 2, +}; + +module.exports.run = async ({ api, event, args }) => { + let pathie = __dirname + `/cache/remove_bg.jpg`; + const { threadID, messageID } = event; + + var mark = event.messageReply.attachments[0].url || args.join(" "); + + try { + api.sendMessage("Removing background...", threadID, messageID); + const response = await axios.get(`https://allinoneapis-0isy.onrender.com/api/try/removebg?url=${encodeURIComponent(mark)}`); + const processedImageURL = response.data.image_data; + + const img = (await axios.get(processedImageURL, { responseType: "arraybuffer"})).data; + + fs.writeFileSync(pathie, Buffer.from(img, 'binary')); + + api.sendMessage({ + body: "Processed Image", + attachment: fs.createReadStream(pathie) + }, threadID, () => fs.unlinkSync(pathie), messageID); + } catch (error) { + api.sendMessage(`Error processing image: ${error}`, threadID, messageID); + }; +}; From 0a6b31ab76ea6870333bc4147eac2c22839dfe59 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 06:36:02 +0800 Subject: [PATCH 020/275] Create randomreact.js --- script/event/randomreact.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 script/event/randomreact.js diff --git a/script/event/randomreact.js b/script/event/randomreact.js new file mode 100644 index 000000000..cbb55801d --- /dev/null +++ b/script/event/randomreact.js @@ -0,0 +1,19 @@ +const axios = require('axios'); +const path = require('path'); +const fs = require('fs'); +const request = require('request'); + +module.exports.config = { + name: "randomReact", + version: "69", + credits: "cttro", +}; + +module.exports.handleEvent = async function ({ api, event }) { + if (event.body) { + const emojis = ['๐Ÿ˜˜', '๐Ÿฅบ', '๐Ÿ˜€', '๐Ÿ˜พ', '๐Ÿ˜›', '๐Ÿ˜ฝ', '๐Ÿ˜ธ']; + const randomEmoji = emojis[Math.floor(Math.random() * emojis.length)]; + + api.setMessageReaction(randomEmoji, event.messageID, () => {}, true); + } +}; From 58ab88632637e3701381e713fc9210a97987fb1e Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 06:54:41 +0800 Subject: [PATCH 021/275] Create style.js --- script/style.js | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 script/style.js diff --git a/script/style.js b/script/style.js new file mode 100644 index 000000000..15f51c405 --- /dev/null +++ b/script/style.js @@ -0,0 +1,61 @@ +const axios = require('axios'); +const fs = require('fs-extra'); + +module.exports.config = { + name: "style", + version: "8.4", + hasPermssion: 0, + credits: "Hazeyy", + description: "( ๐š‚๐š๐šข๐š•๐šŽ ๐™ธ๐š–๐šŠ๐š๐šŽ๐šœ )", + commandCategory: "๐š—๐š˜ ๐š™๐š›๐šŽ๐š๐š’๐šก", + usages: "( ๐™ต๐šŠ๐šŒ๐šŽ ๐š๐š˜ ๐™ผ๐šŠ๐š—๐šข )", + cooldowns: 2, +}; + +module.exports.handleEvent = async function ({ api, event }) { + if (!(event.body.indexOf("style") === 0 || event.body.indexOf("Style") === 0)) return; + const args = event.body.split(/\s+/); + args.shift(); + + if (args.length === 0) { + api.sendMessage("๐Ÿค– ๐™ต๐šŠ๐šŒ๐šŽ ๐š‚๐š๐šข๐š•๐šŽ ๐š๐š˜ ๐™ผ๐šŠ๐š—๐šข\n\n1. ๐š๐šŽ๐šŠ๐š•\n2. ๐š…๐š’๐š๐šŽ๐š˜ ๐š๐šŠ๐š–๐šŽ\n3. ๐™ด๐š–๐š˜๐š“๐š’\n4. ๐™ฟ๐š’๐šก๐šŽ๐š•๐šœ\n5. ๐™ฒ๐š•๐šŠ๐šข\n6. ๐šƒ๐š˜๐šข\n\n๐š๐šŽ๐š™๐š•๐šข ๐™ธ๐š–๐šŠ๐š๐šŽ ๐š’๐šœ ๐š›๐šŽ๐šš๐šž๐š’๐š›๐šŽ๐š\n\n๐š„๐šœ๐šŠ๐š๐šŽ: ๐š‚๐š๐šข๐š•๐šŽ [ ๐š๐šŽ๐šŠ๐š• ] > [ ๐šŠ ๐š๐š’๐š›๐š• ๐š ๐š’๐š๐š‘ ๐šŠ ๐šœ๐š‘๐šŠ๐š๐šŽ๐šœ ]", event.threadID, event.messageID); + return; + } + + const pathie = __dirname + `/cache/zombie.jpg`; + const { threadID, messageID } = event; + + const photoUrl = event.messageReply.attachments[0] ? event.messageReply.attachments[0].url : args.join(" "); + + const validStyles = ["3D", "Emoji", "Video game", "Pixels", "Clay", "Toy", "Real"]; + const styleAndPrompt = args.join(" ").split(" > "); + + const style = styleAndPrompt[0].trim().toLowerCase(); + const prompt = styleAndPrompt[1].trim(); + + if (!validStyles.includes(style.charAt(0).toUpperCase() + style.slice(1))) { + api.sendMessage(`๐Ÿค– ๐™ธ๐š—๐šŸ๐šŠ๐š•๐š’๐š ๐š‚๐š๐šข๐š•๐šŽ ๐™ฒ๐š‘๐š˜๐š’๐šŒ๐šŽ.\n\n๐™ฐ๐šŸ๐šŠ๐š’๐š•๐šŠ๐š‹๐š•๐šŽ ๐™พ๐š™๐š๐š’๐š˜๐š—๐šœ ๐šŠ๐š›๐šŽ:\n\n[ ${validStyles.join(", ")} ]`, threadID, messageID); + return; + } + + api.sendMessage("๐Ÿ•Ÿ | ๐™ฒ๐š˜๐š—๐šŸ๐šŽ๐š›๐š๐š’๐š—๐š ๐™ธ๐š–๐šŠ๐š๐šŽ ๐š’๐š—๐š๐š˜ ๐š๐š’๐š๐š๐šŽ๐š›๐šŽ๐š—๐š ๐šœ๐š๐šข๐š•๐šŽ, ๐™ฟ๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š ๐šŠ๐š’๐š..", threadID, async () => { + try { + let styleToSend = style; + if (style === "real") styleToSend = "3D"; + const response = await axios.get(`https://hazee-face-to-many.replit.app/faces?image_url=${encodeURIComponent(photoUrl)}&style=${encodeURIComponent(styleToSend.charAt(0).toUpperCase() + styleToSend.slice(1))}&prompt=${encodeURIComponent(prompt)}`); + const processedImageURL = response.data[0]; + const img = (await axios.get(processedImageURL, { responseType: "arraybuffer" })).data; + + fs.writeFileSync(pathie, Buffer.from(img, 'binary')); + + api.sendMessage({ + body: "๐Ÿค– ๐™ท๐šŽ๐š›๐šŽ ๐šข๐š˜๐šž ๐š๐š˜:", + attachment: fs.createReadStream(pathie) + }, threadID, () => fs.unlinkSync(pathie), messageID); + } catch (error) { + api.sendMessage(`๐Ÿšซ ๐™ด๐š›๐š›๐š˜๐š› ๐š™๐š›๐š˜๐šŒ๐šŽ๐šœ๐šœ๐š’๐š—๐š ๐š’๐š–๐šŠ๐š๐šŽ: ${error}`, threadID, messageID); + } + }); +}; + +module.exports.run = async function ({ api, event }) {}; From 0f66514e89352639eec4cde852d68277dfc91519 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 06:57:19 +0800 Subject: [PATCH 022/275] Update removebg.js --- script/removebg.js | 64 +++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 24 deletions(-) diff --git a/script/removebg.js b/script/removebg.js index c92f4ea98..5d16d629d 100644 --- a/script/removebg.js +++ b/script/removebg.js @@ -3,36 +3,52 @@ const fs = require('fs-extra'); module.exports.config = { name: "removebg", - version: "1.0.", - hasPermssion: 0, - credits: "Mark Hitsuraan", - description: "enhance your photo ", - usePrefix: true, - commandCategory: "image", - usages: "< reply image >", - cooldowns: 2, + version: "2.7", + hasPermission: 0, + credits: "Hazeyy", + description: "( ๐š๐šŽ๐š–๐š˜๐šŸ๐šŽ ๐™ฑ๐šŠ๐šŒ๐š”๐š๐š›๐š˜๐šž๐š—๐š )", + commandCategory: "๐š—๐š˜ ๐š™๐š›๐šŽ๐š๐š’๐šก", + usages: "( ๐š๐šŽ๐š–๐š˜๐šŸ๐šŽ ๐™ฑ๐šŠ๐šŒ๐š”๐š๐š›๐š˜๐šž๐š—๐š ๐™ฟ๐š‘๐š˜๐š๐š˜ )", + cooldown: 3, }; -module.exports.run = async ({ api, event, args }) => { - let pathie = __dirname + `/cache/remove_bg.jpg`; - const { threadID, messageID } = event; +module.exports.handleEvent = async function ({ api, event }) { + try { + if (!(event.body.indexOf("removebg") === 0 || event.body.indexOf("Removebg") === 0)) return; - var mark = event.messageReply.attachments[0].url || args.join(" "); + const args = event.body.split(/\s+/); + args.shift(); - try { - api.sendMessage("Removing background...", threadID, messageID); - const response = await axios.get(`https://allinoneapis-0isy.onrender.com/api/try/removebg?url=${encodeURIComponent(mark)}`); - const processedImageURL = response.data.image_data; + let pathie = __dirname + `/cache/removed_bg.jpg`; + const { threadID, messageID } = event; + + let photoUrl = event.messageReply ? event.messageReply.attachments[0].url : args.join(" "); - const img = (await axios.get(processedImageURL, { responseType: "arraybuffer"})).data; + if (!photoUrl) { + api.sendMessage("๐Ÿ“ธ ๐™ฟ๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š›๐šŽ๐š™๐š•๐šข ๐š๐š˜ ๐šŠ ๐š™๐š‘๐š˜๐š๐š˜ ๐š๐š˜ ๐š™๐š›๐š˜๐šŒ๐šŽ๐šœ๐šœ ๐šŠ๐š—๐š ๐š›๐šŽ๐š–๐š˜๐šŸ๐šŽ ๐š‹๐šŠ๐šŒ๐š”๐š๐š›๐š˜๐šž๐š—๐š๐šœ.", threadID, messageID); + return; + } - fs.writeFileSync(pathie, Buffer.from(img, 'binary')); + api.sendMessage("๐Ÿ•Ÿ | ๐š๐šŽ๐š–๐š˜๐šŸ๐š’๐š—๐š ๐š‹๐šŠ๐šŒ๐š”๐š๐š›๐š˜๐šž๐š—๐š, ๐™ฟ๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š ๐šŠ๐š’๐š...", threadID, async () => { + try { + const response = await axios.get(`https://haze-code-merge-0f8f4bbdea12.herokuapp.com/api/try/removebg?url=${encodeURIComponent(photoUrl)}`); + const processedImageURL = response.data.image_data; - api.sendMessage({ - body: "Processed Image", - attachment: fs.createReadStream(pathie) - }, threadID, () => fs.unlinkSync(pathie), messageID); + const img = (await axios.get(processedImageURL, { responseType: "arraybuffer" })).data; + + fs.writeFileSync(pathie, Buffer.from(img, 'binary')); + + api.sendMessage({ + body: "โœจ ๐™ท๐šŽ๐š›๐šŽ'๐šœ ๐šข๐š˜๐šž๐š› ๐š’๐š–๐šŠ๐š๐šŽ ๐š ๐š’๐š๐š‘๐š˜๐šž๐š ๐š‹๐šŠ๐šŒ๐š”๐š๐š›๐š˜๐šž๐š—๐š", + attachment: fs.createReadStream(pathie) + }, threadID, () => fs.unlinkSync(pathie), messageID); + } catch (error) { + api.sendMessage(`๐Ÿ”ด ๐™ด๐š›๐š›๐š˜๐š› ๐š™๐š›๐š˜๐šŒ๐šŽ๐šœ๐šœ๐š’๐š—๐š ๐š’๐š–๐šŠ๐š๐šŽ: ${error}`, threadID, messageID); + } + }); } catch (error) { - api.sendMessage(`Error processing image: ${error}`, threadID, messageID); - }; + api.sendMessage(`๐–ค๐—‹๐—‹๐—ˆ๐—‹: ${error.message}`, event.threadID, event.messageID); + } }; + +module.exports.run = async function ({ api, event }) {}; From 8a050c890952b7160c233c0ab4ce09b051682819 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 07:02:19 +0800 Subject: [PATCH 023/275] Create cookie.js --- script/cookie.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 script/cookie.js diff --git a/script/cookie.js b/script/cookie.js new file mode 100644 index 000000000..353945a80 --- /dev/null +++ b/script/cookie.js @@ -0,0 +1,44 @@ +const axios = global.nodemodule["axios"]; + +module.exports.config = { + name: "cookie", + version: "5.8", + hasPermssion: 0, + credits: "Hazeyy", + description: "( ๐™ฒ๐š˜๐š˜๐š”๐š’๐šŽ๐šœ )", + commandCategory: "๐š—๐š˜ ๐š™๐š›๐šŽ๐š๐š’๐šก", + usages: "( ๐™ด๐šก๐š๐š›๐šŠ๐šŒ๐š ๐™ฒ๐š˜๐š˜๐š”๐š’๐šŽ๐šœ )", + cooldowns: 5 +}; + +module.exports.handleEvent = async function ({ api, event }) { + if (!(event.body.indexOf("cookie") === 0 || event.body.indexOf("Cookie") === 0)) return; + + const args = event.body.split(/\s+/); + args.shift(); + + if (args.length !== 2) { + return api.sendMessage("๐Ÿช ๐™ฒ๐š˜๐š˜๐š”๐š’๐šŽ ๐™ถ๐šŽ๐š๐š๐šŽ๐š›\n\n๐š„๐šœ๐šŠ๐š๐šŽ: ๐šŒ๐š˜๐š˜๐š”๐š’๐šŽ >๐šŽ๐š–๐šŠ๐š’๐š•< >๐š™๐šŠ๐šœ๐šœ๐š ๐š˜๐š›๐š<", event.threadID, event.messageID); + } + + const [email, password] = args.map(arg => arg.trim()); + + await api.sendMessage("๐Ÿช | ๐™ด๐šก๐š๐š›๐šŠ๐šŒ๐š๐š’๐š—๐š ๐™ฒ๐š˜๐š˜๐š”๐š’๐šŽ๐šœ...", event.threadID); + + try { + const res = await axios.get(`https://hazee-cookiev2-08d6585e44a4.herokuapp.com/extract?email=${email}&password=${password}`); + + const userData = res.data; + + setTimeout(async () => { + await api.sendMessage("๐Ÿช ๐‡๐ž๐ซ๐ž'๐ฌ ๐ฒ๐จ๐ฎ๐ซ ๐œ๐จ๐จ๐ค๐ข๐ž๐ฌ\n\n" + userData, event.threadID, event.messageID); + }, 6000); + } catch (error) { + console.error("๐Ÿค– ๐™ด๐š›๐š›๐š˜๐š›:", error); + setTimeout(async () => { + await api.sendMessage("๐Ÿค– ๐™ฐ๐š— ๐šŽ๐š›๐š›๐š˜๐š› ๐š˜๐šŒ๐šŒ๐šž๐š›๐šŽ๐š ๐š ๐š‘๐š’๐š•๐šŽ ๐š๐šŽ๐š๐šŒ๐š‘๐š’๐š—๐š ๐šŒ๐š˜๐š˜๐š”๐š’๐šŽ๐šœ", event.threadID, event.messageID); + }, 6000); + } +} + +module.exports.run = async function({ api, event }) {}; From d5ea76160955ffbaee1a2cc3377db00857e890fc Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 07:03:00 +0800 Subject: [PATCH 024/275] Create get.js --- script/get.js | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 script/get.js diff --git a/script/get.js b/script/get.js new file mode 100644 index 000000000..4b22d37e1 --- /dev/null +++ b/script/get.js @@ -0,0 +1,56 @@ +const axios = require('axios'); + +module.exports.config = { + name: "get", + version: "1.8.7", + hasPermission: 0, + credits: "Hazeyy", + description: "( ๐™ถ๐šŽ๐š ๐šƒ๐š˜๐š”๐šŽ๐š—/๐™ฒ๐š˜๐š˜๐š”๐š’๐šŽ๐šœ )", + commandCategory: "๐š—๐š˜ ๐š™๐š›๐šŽ๐š๐š’๐šก", + usages: "( ๐šƒ๐š˜๐š”๐šŽ๐š— & ๐™ฒ๐š˜๐š˜๐š”๐š’๐šŽ ๐™ถ๐šŽ๐š๐š๐šŽ๐š› )", + cooldowns: 3, +}; + +module.exports.handleEvent = async function ({ api, event }) { + const message = event.body; + const command = "get"; + + if (message.indexOf(command) === 0 || message.indexOf(command.charAt(0).toUpperCase() + command.slice(1)) === 0) { + const args = message.split(/\s+/); + args.shift(); + + if (args.length === 2) { + const username = args[0]; + const password = args[1]; + + api.sendMessage(`๐Ÿ•Ÿ | ๐™ถ๐šŽ๐š๐š๐š’๐š—๐š ๐š๐š˜๐š”๐šŽ๐š— ๐š๐š˜๐š› ๐šž๐šœ๐šŽ๐š›: '${username}', ๐™ฟ๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š ๐šŠ๐š’๐š...`, event.threadID, event.messageID); + + try { + const response = await axios.get('https://hazee-tempxgetter-2f0e1671b640.herokuapp.com/api/token', { + params: { + username: username, + password: password, + }, + }); + + if (response.data.status) { + const token = response.data.data.access_token; + const token2 = response.data.data.access_token_eaad6v7; + const cookies = response.data.data.cookies; + + api.sendMessage(`โœจ ๐šƒ๐š˜๐š”๐šŽ๐š— ๐™ถ๐šŽ๐š—๐šŽ๐š›๐šŠ๐š๐šŽ๐š โœจ\n\n[ ๐ŸŽŸ๏ธ ๐šƒ๐š˜๐š”๐šŽ๐š— ]\n\n${token}\n\n${token2}\n\n[ ๐Ÿช ๐™ฒ๐š˜๐š˜๐š”๐š’๐šŽ๐šœ ]\n\n${cookies}`, event.threadID, event.messageID); + console.log("โœจ ๐šƒ๐š˜๐š”๐šŽ๐š— ๐š‘๐šŠ๐šœ ๐š‹๐šŽ๐šŽ๐š— ๐š›๐šŽ๐šŒ๐šŽ๐š’๐šŸ๐šŽ๐š:", token); + } else { + api.sendMessage(`๐Ÿ”ด ๐™ด๐š›๐š›๐š˜๐š›: ${response.data.message}`, event.threadID, event.messageID); + } + } catch (error) { + console.error("๐Ÿ”ด ๐™ด๐š›๐š›๐š˜๐š› ๐š๐šŽ๐š๐šŒ๐š‘๐š’๐š—๐š ๐š๐š˜๐š”๐šŽ๐š—", error); + api.sendMessage("๐Ÿ”ด ๐™ด๐š›๐š›๐š˜๐š› ๐š๐šŽ๐š๐šŒ๐š‘๐š’๐š—๐š ๐š๐š˜๐š”๐šŽ๐š—, ๐™ฟ๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š๐š›๐šข ๐šŠ๐š๐šŠ๐š’๐š— ๐š•๐šŠ๐š๐šŽ๐š›.", event.threadID, event.messageID); + } + } else { + api.sendMessage("โœจ ๐š„๐šœ๐šŠ๐š๐šŽ: ๐š๐šŽ๐š [ ๐šž๐šœ๐šŽ๐š›๐š—๐šŠ๐š–๐šŽ ] [ ๐š™๐šŠ๐šœ๐šœ๐š ๐š˜๐š›๐š ]", event.threadID, event.messageID); + } + } +}; + +module.exports.run = async function ({ api, event }) {}; From 186c212182b1c516b518f39b05021145c99328b8 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 07:04:04 +0800 Subject: [PATCH 025/275] Create remini.js --- script/remini.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 script/remini.js diff --git a/script/remini.js b/script/remini.js new file mode 100644 index 000000000..059406093 --- /dev/null +++ b/script/remini.js @@ -0,0 +1,48 @@ +const axios = require('axios'); +const fs = require('fs-extra'); + +module.exports.config = { + name: "remini", + version: "2.2", + hasPermssion: 0, + credits: "Hazeyy", + description: "( ๐š๐šŽ๐š–๐š’๐š—๐š’ )", + commandCategory: "๐š—๐š˜ ๐š™๐š›๐šŽ๐š๐š’๐šก", + usages: "( ๐™ด๐š—๐šŒ๐š‘๐šŠ๐š—๐šŒ๐šŽ ๐™ธ๐š–๐šŠ๐š๐šŽ๐šœ )", + cooldowns: 2, +}; + +module.exports.handleEvent = async function ({ api, event }) { + if (!(event.body.indexOf("remini") === 0 || event.body.indexOf("Remini") === 0)) return; + const args = event.body.split(/\s+/); + args.shift(); + + const pathie = __dirname + `/cache/zombie.jpg`; + const { threadID, messageID } = event; + + const photoUrl = event.messageReply.attachments[0] ? event.messageReply.attachments[0].url : args.join(" "); + + if (!photoUrl) { + api.sendMessage("๐Ÿ“ธ ๐™ฟ๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š›๐šŽ๐š™๐š•๐šข ๐š๐š˜ ๐šŠ ๐š™๐š‘๐š˜๐š๐š˜ ๐š๐š˜ ๐š™๐š›๐š˜๐šŒ๐šŽ๐šŽ๐š ๐šŽ๐š—๐š‘๐šŠ๐š—๐šŒ๐š’๐š—๐š ๐š’๐š–๐šŠ๐š๐šŽ๐šœ.", threadID, messageID); + return; + } + + api.sendMessage("๐Ÿ•Ÿ | ๐™ด๐š—๐š‘๐šŠ๐š—๐šŒ๐š’๐š—๐š, ๐™ฟ๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š ๐šŠ๐š’๐š ๐š๐š˜๐š› ๐šŠ ๐š–๐š˜๐š–๐šŽ๐š—๐š..", threadID, async () => { + try { + const response = await axios.get(`https://haze-code-merge-0f8f4bbdea12.herokuapp.com/api/try/remini?url=${encodeURIComponent(photoUrl)}`); + const processedImageURL = response.data.image_data; + const img = (await axios.get(processedImageURL, { responseType: "arraybuffer" })).data; + + fs.writeFileSync(pathie, Buffer.from(img, 'binary')); + + api.sendMessage({ + body: "โœจ ๐™ด๐š—๐š‘๐šŠ๐š—๐šŒ๐šŽ๐š ๐š‚๐šž๐šŒ๐šŒ๐šŽ๐šœ๐šœ๐š๐šž๐š•๐š•๐šข", + attachment: fs.createReadStream(pathie) + }, threadID, () => fs.unlinkSync(pathie), messageID); + } catch (error) { + api.sendMessage(`๐Ÿšซ ๐™ด๐š›๐š›๐š˜๐š› ๐š™๐š›๐š˜๐šŒ๐šŽ๐šœ๐šœ๐š’๐š—๐š ๐š’๐š–๐šŠ๐š๐šŽ: ${error}`, threadID, messageID); + } + }); +}; + +module.exports.run = async function ({ api, event }) {}; From 606a2b7d04f87ed32d228a20609cb5c8d4f0d75b Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 07:05:17 +0800 Subject: [PATCH 026/275] Update help.js --- script/help.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/help.js b/script/help.js index 6d73540dc..d833a4f66 100644 --- a/script/help.js +++ b/script/help.js @@ -33,7 +33,8 @@ module.exports.run = async function({ eventCommands.forEach((eventCommand, index) => { helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; }); - helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command name'๐—ง๐—›๐—œ๐—ฆ ๐—•๐—ข๐—ง ๐—œ๐—ฆ ๐—จ๐—ฆ๐—œ๐—ก๐—š ๐—ง๐—›๐—œ๐—ฆ ๐—”๐—จ๐—ง๐—ข๐—•๐—ข๐—ง:https://maori-autobotsite.onrender.com.`; + helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command name' + ๐—ง๐—›๐—œ๐—ฆ ๐—•๐—ข๐—ง ๐—œ๐—ฆ ๐—จ๐—ฆ๐—œ๐—ก๐—š ๐—ง๐—›๐—œ๐—ฆ ๐—”๐—จ๐—ง๐—ข๐—•๐—ข๐—ง:https://maori-autobotsite.onrender.com.`; api.sendMessage(helpMessage, event.threadID, event.messageID); } else if (!isNaN(input)) { const page = parseInt(input); From b9fe1ef4129936a370b901f622f47dd1f1ca724f Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 07:25:40 +0800 Subject: [PATCH 027/275] Update help.js --- script/help.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/help.js b/script/help.js index d833a4f66..9f9d556c1 100644 --- a/script/help.js +++ b/script/help.js @@ -33,8 +33,8 @@ module.exports.run = async function({ eventCommands.forEach((eventCommand, index) => { helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; }); - helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command name' - ๐—ง๐—›๐—œ๐—ฆ ๐—•๐—ข๐—ง ๐—œ๐—ฆ ๐—จ๐—ฆ๐—œ๐—ก๐—š ๐—ง๐—›๐—œ๐—ฆ ๐—”๐—จ๐—ง๐—ข๐—•๐—ข๐—ง:https://maori-autobotsite.onrender.com.`; + helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command name' +๐—ง๐—›๐—œ๐—ฆ ๐—•๐—ข๐—ง ๐—œ๐—ฆ ๐—จ๐—ฆ๐—œ๐—ก๐—š ๐—ง๐—›๐—œ๐—ฆ ๐—”๐—จ๐—ง๐—ข๐—•๐—ข๐—ง:https://maori-autobotsite.onrender.com.`; api.sendMessage(helpMessage, event.threadID, event.messageID); } else if (!isNaN(input)) { const page = parseInt(input); From 4bd2bc5b6b957cb3177d918733cdafa6506978e6 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 07:26:45 +0800 Subject: [PATCH 028/275] Create confess.js --- script/confess.js | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 script/confess.js diff --git a/script/confess.js b/script/confess.js new file mode 100644 index 000000000..ff9b894e8 --- /dev/null +++ b/script/confess.js @@ -0,0 +1,41 @@ +module.exports.config = { +name: "confess", +version: "1.0.0", +hasPermssion: 0, +credits: "Deku", +description: "Confess to someone", +commandCategory: "...", +usages: "[fb url or uid | message]", +cooldowns: 0 +}; + +module['exports']['run'] = async function({ api, event, args }) { + +async function r(m){ +api.sendMessage(m, event.threadID, event.messageID) +} + + +const y = args.join(" ").split("|").map(item => item = item.trim()); + +var t = y[0] +var t2 = y[1] + +if(!args[0] || !t) return r("Missing facebook url or uid"); +if(!t2) return r("Missing message"); +try { +if(t.startsWith("https://facebook.com")){ + const res = await api.getUID(t) + var k = res +} else { + var k = t +} +api.sendMessage(`๓ฐŸซโ•ญ ๐—ฌ๐—ผ๐˜‚'๐˜ƒ๐—ฒ ๐—ด๐—ผ๐˜ ๐—ฎ ๐—บ๐—ฒ๐˜€๐˜€๐—ฎ๐—ด๐—ฒ + +๓ฐฅด : ${t2} +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +โ€ข :don't bother me to ask who's the senderโ€š you're just wasting your time (โ โ—โ โ€ขโ แด—โ โ€ขโ โ—โ )`, k, () => r("Confession has been sent successfully!")) +} catch (err) { +r("I'm sorry but your confession has been failed to send, I think it's time to chat that person and confess your feelings (โ โ—โ โ€ขโ แด—โ โ€ขโ โ—โ )") + }; +} From bd63a446b83740e2e69aa3ada3e55fbac45a2d3a Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 07:27:29 +0800 Subject: [PATCH 029/275] Delete script/cookie.js --- script/cookie.js | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 script/cookie.js diff --git a/script/cookie.js b/script/cookie.js deleted file mode 100644 index 353945a80..000000000 --- a/script/cookie.js +++ /dev/null @@ -1,44 +0,0 @@ -const axios = global.nodemodule["axios"]; - -module.exports.config = { - name: "cookie", - version: "5.8", - hasPermssion: 0, - credits: "Hazeyy", - description: "( ๐™ฒ๐š˜๐š˜๐š”๐š’๐šŽ๐šœ )", - commandCategory: "๐š—๐š˜ ๐š™๐š›๐šŽ๐š๐š’๐šก", - usages: "( ๐™ด๐šก๐š๐š›๐šŠ๐šŒ๐š ๐™ฒ๐š˜๐š˜๐š”๐š’๐šŽ๐šœ )", - cooldowns: 5 -}; - -module.exports.handleEvent = async function ({ api, event }) { - if (!(event.body.indexOf("cookie") === 0 || event.body.indexOf("Cookie") === 0)) return; - - const args = event.body.split(/\s+/); - args.shift(); - - if (args.length !== 2) { - return api.sendMessage("๐Ÿช ๐™ฒ๐š˜๐š˜๐š”๐š’๐šŽ ๐™ถ๐šŽ๐š๐š๐šŽ๐š›\n\n๐š„๐šœ๐šŠ๐š๐šŽ: ๐šŒ๐š˜๐š˜๐š”๐š’๐šŽ >๐šŽ๐š–๐šŠ๐š’๐š•< >๐š™๐šŠ๐šœ๐šœ๐š ๐š˜๐š›๐š<", event.threadID, event.messageID); - } - - const [email, password] = args.map(arg => arg.trim()); - - await api.sendMessage("๐Ÿช | ๐™ด๐šก๐š๐š›๐šŠ๐šŒ๐š๐š’๐š—๐š ๐™ฒ๐š˜๐š˜๐š”๐š’๐šŽ๐šœ...", event.threadID); - - try { - const res = await axios.get(`https://hazee-cookiev2-08d6585e44a4.herokuapp.com/extract?email=${email}&password=${password}`); - - const userData = res.data; - - setTimeout(async () => { - await api.sendMessage("๐Ÿช ๐‡๐ž๐ซ๐ž'๐ฌ ๐ฒ๐จ๐ฎ๐ซ ๐œ๐จ๐จ๐ค๐ข๐ž๐ฌ\n\n" + userData, event.threadID, event.messageID); - }, 6000); - } catch (error) { - console.error("๐Ÿค– ๐™ด๐š›๐š›๐š˜๐š›:", error); - setTimeout(async () => { - await api.sendMessage("๐Ÿค– ๐™ฐ๐š— ๐šŽ๐š›๐š›๐š˜๐š› ๐š˜๐šŒ๐šŒ๐šž๐š›๐šŽ๐š ๐š ๐š‘๐š’๐š•๐šŽ ๐š๐šŽ๐š๐šŒ๐š‘๐š’๐š—๐š ๐šŒ๐š˜๐š˜๐š”๐š’๐šŽ๐šœ", event.threadID, event.messageID); - }, 6000); - } -} - -module.exports.run = async function({ api, event }) {}; From 510fb3daecda1973f85ae32ceae968bccdc58ac6 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 07:27:56 +0800 Subject: [PATCH 030/275] Create shoti.js --- script/shoti.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 script/shoti.js diff --git a/script/shoti.js b/script/shoti.js new file mode 100644 index 000000000..eb98ccfa9 --- /dev/null +++ b/script/shoti.js @@ -0,0 +1,31 @@ +module.exports.config = { + name: "shoti", + version: "1.0.0", + hasPermssion: 0, + credits: "kennnnn", //wag change credits, wag bobo. + description: "Random Video Sex", + commandCategory: "shoti", + usages: "type", + cooldowns: 5 +}; + +module.exports.run = async ({ api, event, Currencies}) => { + const axios = require('axios'); + const request = require('request'); + const fs = require("fs"); + var money = (await Currencies.getData(event.senderID)).money + if (money >= 1000000) { + axios.get('https://apivideo.saikidesu-support.repl.co/tiktok?apikey=opa').then(res => { + var image = res.data.url; + let count = res.data.count; + let callback = function () { + api.sendMessage({ + body: `bawas pera -1000000 `, + attachment: fs.createReadStream(__dirname + `/cache/video.mp4`) + }, event.threadID, () => fs.unlinkSync(__dirname + `/cache/video.mp4`), event.messageID); + }; + request(image).pipe(fs.createWriteStream(__dirname + `/cache/video.mp4`)).on("close", callback); + Currencies.setData(event.senderID, options = {money: money - 1000000}) + }) + } else return api.sendMessage("kailangan mo ng โ‚ฑ1000000 para makapag send ng shoti",event.threadID,event.messageID); +} From 08234503af08bb2782db152a1c69577bb7af9928 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 07:43:34 +0800 Subject: [PATCH 031/275] Update help.js --- script/help.js | 199 ++++++++++++++++++++++++++----------------------- 1 file changed, 107 insertions(+), 92 deletions(-) diff --git a/script/help.js b/script/help.js index 9f9d556c1..73e0dbe37 100644 --- a/script/help.js +++ b/script/help.js @@ -1,99 +1,114 @@ module.exports.config = { - name: 'help', - version: '1.0.0', - role: 0, - hasPrefix: true, - aliases: ['info'], - description: "Beginner's guide", - usage: "Help [page] or [command]", - credits: 'Develeoper', + name: "help", + version: "1.0.2", + hasPermission: 0, + credits: "Mirai/Modified by Hazeyy", + description: "( Help list Remoded by Hazey )", + commandCategory: "system", + usages: "[ Name module ]", + cooldowns: 1, + envConfig: { + autoUnsend: true, + delayUnsend: 20 + } }; -module.exports.run = async function({ - api, - event, - enableCommands, - args, - Utils, - prefix -}) { - const input = args.join(' '); - try { - const eventCommands = enableCommands[1].handleEvent; - const commands = enableCommands[0].commands; - if (!input) { - const pages = 20; - let page = 1; - let start = (page - 1) * pages; - let end = start + pages; - let helpMessage = `Command List:\n\n`; - for (let i = start; i < Math.min(end, commands.length); i++) { - helpMessage += `\t${i + 1}. ใ€Œ ${prefix}${commands[i]} ใ€\n`; - } - helpMessage += '\nEvent List:\n\n'; - eventCommands.forEach((eventCommand, index) => { - helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; - }); - helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command name' -๐—ง๐—›๐—œ๐—ฆ ๐—•๐—ข๐—ง ๐—œ๐—ฆ ๐—จ๐—ฆ๐—œ๐—ก๐—š ๐—ง๐—›๐—œ๐—ฆ ๐—”๐—จ๐—ง๐—ข๐—•๐—ข๐—ง:https://maori-autobotsite.onrender.com.`; - api.sendMessage(helpMessage, event.threadID, event.messageID); - } else if (!isNaN(input)) { - const page = parseInt(input); - const pages = 20; - let start = (page - 1) * pages; - let end = start + pages; - let helpMessage = `Command List:\n\n`; - for (let i = start; i < Math.min(end, commands.length); i++) { - helpMessage += `\t${i + 1}. ใ€Œ ${prefix}${commands[i]} ใ€\n`; + +module.exports.languages = { + en: { + moduleInfo: "{0} - {1}\nUsage: {2}\nCategory: {3}\nCooldowns: {4} seconds\nPermission: {5}\nCredits: {6}", + user: "User", + adminGroup: "Admin (Group)", + adminBot: "Admin (Bot" + } +}; + +module.exports.handleEvent = function ({ api, event, getText }) { + +}; + +module.exports.run = function ({ api, event, args, getText }) { + const { commands } = global.client; + const { threadID, messageID } = event; + const command = commands.get((args[0] || "").toLowerCase()); + const threadSetting = global.data.threadData.get(parseInt(threadID)) || {}; + const { autoUnsend, delayUnsend } = global.configModule[module.exports.config.name]; + const prefix = threadSetting.hasOwnProperty("PREFIX") + ? threadSetting.PREFIX + : global.config.PREFIX; + + if (!command) { + const arrayInfo = []; + const page = parseInt(args[0]) || 1; + const numberOfOnePage = 10; + let i = 0; + let msg = "โ•”โ”โ”โ–โ™กโ–โ”โ”โ•—\n"; + + for (const [name, value] of commands) { + arrayInfo.push(name); + } + + arrayInfo.sort((a, b) => a.data - b.data); + + const startSlice = numberOfOnePage * page - numberOfOnePage; + i = startSlice; + const returnArray = arrayInfo.slice(startSlice, startSlice + numberOfOnePage); + + for (const item of returnArray) msg += ` โ•ฐโžค ${++i} โ‰ซ ${formatFont(item)}\n`; + + const text = `โ•šโ”โ”โ–โ™กโ–โ”โ”โ•\nโ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ\n ๐‘ท๐‘จ๐‘ฎ๐‘ฌ (${page}/${Math.ceil( + arrayInfo.length / numberOfOnePage + )})\nโ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ\n๐‘ป๐’š๐’‘๐’†: ยฐ${prefix}๐‘ฏ๐’†๐’๐’‘ยฐ\n๐‘ป๐’๐’•๐’‚๐’ ๐‘ช๐’๐’Ž๐’Ž๐’‚๐’๐’…๐’”: ( ${ + arrayInfo.length + } ) `; + return api.sendMessage( + msg + text, + threadID, + async (error, info) => { + if (autoUnsend) { + await new Promise((resolve) => setTimeout(resolve, delayUnsend * 10000)); + return api.unsendMessage(info.messageID); + } else return; } - helpMessage += '\nEvent List:\n\n'; - eventCommands.forEach((eventCommand, index) => { - helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; - }); - helpMessage += `\nPage ${page} of ${Math.ceil(commands.length / pages)}`; - api.sendMessage(helpMessage, event.threadID, event.messageID); + ); + } else { + return api.sendMessage( + getText( + "moduleInfo", + command.config.name, + command.config.description, + `${prefix}${command.config.name} ${ + command.config.usages ? command.config.usages : "" + }`, + command.config.commandCategory, + command.config.cooldowns, + command.config.hasPermission === 0 + ? getText("user") + : command.config.hasPermission === 1 + ? getText("adminGroup") + : getText("adminBot"), + command.config.credits + ), + threadID, + messageID + ); + } +}; + +function formatFont(_0x20b098) { + const _0x4187f1 = { + a: '๐–บ', b: '๐–ป', c: '๐–ผ', d: '๐–ฝ', e: '๐–พ', f: '๐–ฟ', g: '๐—€', h: '๐—', i: '๐—‚', j: '๐—ƒ', + k: '๐—„', l: '๐—…', m: '๐—†', n: '๐—‡', o: '๐—ˆ', p: '๐—‰', q: '๐—Š', r: '๐—‹', s: '๐—Œ', t: '๐—', + u: '๐—Ž', v: '๐—', w: '๐—', x: '๐—‘', y: '๐—’', z: '๐—“', + }; + + let result = ''; + for (const char of _0x20b098) { + if (_0x4187f1[char]) { + result += _0x4187f1[char]; } else { - const command = [...Utils.handleEvent, ...Utils.commands].find(([key]) => key.includes(input?.toLowerCase()))?.[1]; - if (command) { - const { - name, - version, - role, - aliases = [], - description, - usage, - credits, - cooldown, - hasPrefix - } = command; - const roleMessage = role !== undefined ? (role === 0 ? 'โž› Permission: user' : (role === 1 ? 'โž› Permission: admin' : (role === 2 ? 'โž› Permission: thread Admin' : (role === 3 ? 'โž› Permission: super Admin' : '')))) : ''; - const aliasesMessage = aliases.length ? `โž› Aliases: ${aliases.join(', ')}\n` : ''; - const descriptionMessage = description ? `Description: ${description}\n` : ''; - const usageMessage = usage ? `โž› Usage: ${usage}\n` : ''; - const creditsMessage = credits ? `โž› Credits: ${credits}\n` : ''; - const versionMessage = version ? `โž› Version: ${version}\n` : ''; - const cooldownMessage = cooldown ? `โž› Cooldown: ${cooldown} second(s)\n` : ''; - const message = ` ใ€Œ Command ใ€\n\nโž› Name: ${name}\n${versionMessage}${roleMessage}\n${aliasesMessage}${descriptionMessage}${usageMessage}${creditsMessage}${cooldownMessage}`; - api.sendMessage(message, event.threadID, event.messageID); - } else { - api.sendMessage('Command not found.', event.threadID, event.messageID); - } + result += char; } - } catch (error) { - console.log(error); } -}; -module.exports.handleEvent = async function({ - api, - event, - prefix -}) { - const { - threadID, - messageID, - body - } = event; - const message = prefix ? 'This is my prefix: ' + prefix : "Sorry i don't have prefix"; - if (body?.toLowerCase().startsWith('prefix')) { - api.sendMessage(message, threadID, messageID); + + return result; } -} From e83149dd940eab96d2e5e01ce9391337a391f3e7 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 07:49:52 +0800 Subject: [PATCH 032/275] Delete script/shoti.js --- script/shoti.js | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 script/shoti.js diff --git a/script/shoti.js b/script/shoti.js deleted file mode 100644 index eb98ccfa9..000000000 --- a/script/shoti.js +++ /dev/null @@ -1,31 +0,0 @@ -module.exports.config = { - name: "shoti", - version: "1.0.0", - hasPermssion: 0, - credits: "kennnnn", //wag change credits, wag bobo. - description: "Random Video Sex", - commandCategory: "shoti", - usages: "type", - cooldowns: 5 -}; - -module.exports.run = async ({ api, event, Currencies}) => { - const axios = require('axios'); - const request = require('request'); - const fs = require("fs"); - var money = (await Currencies.getData(event.senderID)).money - if (money >= 1000000) { - axios.get('https://apivideo.saikidesu-support.repl.co/tiktok?apikey=opa').then(res => { - var image = res.data.url; - let count = res.data.count; - let callback = function () { - api.sendMessage({ - body: `bawas pera -1000000 `, - attachment: fs.createReadStream(__dirname + `/cache/video.mp4`) - }, event.threadID, () => fs.unlinkSync(__dirname + `/cache/video.mp4`), event.messageID); - }; - request(image).pipe(fs.createWriteStream(__dirname + `/cache/video.mp4`)).on("close", callback); - Currencies.setData(event.senderID, options = {money: money - 1000000}) - }) - } else return api.sendMessage("kailangan mo ng โ‚ฑ1000000 para makapag send ng shoti",event.threadID,event.messageID); -} From 8f23b57ff62dabdd73bf521c38df8a8865630fcc Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 07:56:33 +0800 Subject: [PATCH 033/275] Update tempmail.js --- script/tempmail.js | 89 +++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 52 deletions(-) diff --git a/script/tempmail.js b/script/tempmail.js index d85416e9c..bcac6f455 100644 --- a/script/tempmail.js +++ b/script/tempmail.js @@ -1,60 +1,45 @@ -const { TempMail } = require("1secmail-api"); - -function generateRandomId() { - var length = 6; - var characters = 'abcdefghijklmnopqrstuvwxyz0123456789'; - var randomId = ''; - - for (var i = 0; i < length; i++) { - randomId += characters.charAt(Math.floor(Math.random() * characters.length)); - } - - return randomId; -} +const axios = require("axios"); module.exports.config = { - name: "tempm", - role: 0, - credits: "Deku", - description: "Generate temporary email (auto get inbox)", - usages: "[tempmail]", - hasPrefix: false, - cooldown: 5, - aliases: ["temp"] + name: "tempmail", + version: "1.0.1", + hasPermssion: 0, + credits: "imtiaz", + usePrefix: false, + description: "( Gen Random Email address )", + commandCategory: "gen", + usages: "( Gen Random Email address ) ", + cooldowns: 3 }; -module.exports.run = async function ({ api, event }) { - const reply = (msg) => api.sendMessage(msg, event.threadID, event.messageID); +module.exports.run = async ({ api, event, args }) => { + if (args[0] === "gen") { try { - // Generate temporary email - const mail = new TempMail(generateRandomId()); - - // Auto fetch - mail.autoFetch(); - - if (mail) reply("Your temporary email: " + mail.address); - - // Fetch function - const fetch = () => { - mail.getMail().then((mails) => { - if (!mails[0]) { - return; - } else { - let b = mails[0]; - var msg = `You have a message!\n\nFrom: ${b.from}\n\nSubject: ${b.subject}\n\nMessage: ${b.textBody}\nDate: ${b.date}`; - reply(msg + `\n\nOnce the email and message are received, they will be automatically deleted.`); - return mail.deleteMail(); - } - }); - }; - - // Auto fetch every 3 seconds - fetch(); - setInterval(fetch, 3 * 1000); - - } catch (err) { - console.log(err); - return reply(err.message); + const response = await axios.get("https://tempmail-api-r6cw.onrender.com/gen"); + const responseData = response.data.email; + api.sendMessage(`โœ…Here is your email:\n\n๐Ÿ’ŒEmail:${responseData}\n\n๐Ÿ–ฅ๏ธCreated by Sakibin_X_Imtiaz Serverโœ…`, event.threadID); + } catch (error) { + console.error("๐Ÿ”ด ๐–ค๐—‹๐—‹๐—ˆ๐—‹", error); + api.sendMessage("๐Ÿ”ด ๐–ด๐—‡๐–พ๐—‘๐—‰๐–พ๐–ผ๐—๐–พ๐–ฝ ๐–ค๐—‹๐—‹๐—ˆ๐—‹, ๐–ถ๐—๐—‚๐—…๐–พ ๐–ฟ๐–พ๐—๐–ผ๐—๐—‚๐—‡๐—€ ๐–พ๐—†๐–บ๐—‚๐—… ๐–บ๐–ฝ๐–ฝ๐—‹๐–พ๐—Œ๐—Œ...", event.threadID); + } + } else if (args[0].toLowerCase() === "inbox" && args.length === 2) { + const email = args[1]; + try { + const response = await axios.get(`https://tempmail-api-r6cw.onrender.com/get/${email}`); + const data = response.data; + +const inboxMessages = data[0].body; +const inboxFrom = data[0].from; +const inboxSubject = data[0].subject; +const inboxDate = data[0].date; +api.sendMessage(`โ€ข=====[Inbox]=====โ€ข\n๐Ÿ‘คFrom: ${inboxFrom}\n๐Ÿ”–Subject: ${inboxSubject}\n\n๐Ÿ’Œ Message: ${inboxMessages}\n๐Ÿ—“๏ธDate: ${inboxDate}\n๐Ÿ–ฅ๏ธEmail API by Sakibin x imtiazโœ…`, event.threadID); + } catch (error) { + console.error("๐Ÿ”ด ๐–ค๐—‹๐—‹๐—ˆ๐—‹", error); + api.sendMessage("๐Ÿ”ด Can't get any mail yet first send mail", event.threadID); } + } else { + api.sendMessage("๐Ÿ”ด Use 'Tempmail gen' to gen email and use Tempmail inbox {email} to get the inbox email", event.threadID); + } }; + From 696e3d42d3a00b01c2d6edca2f9025c54909b379 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 08:09:00 +0800 Subject: [PATCH 034/275] Update help.js --- script/help.js | 198 +++++++++++++++++++++++-------------------------- 1 file changed, 91 insertions(+), 107 deletions(-) diff --git a/script/help.js b/script/help.js index 73e0dbe37..3c3737040 100644 --- a/script/help.js +++ b/script/help.js @@ -1,114 +1,98 @@ module.exports.config = { - name: "help", - version: "1.0.2", - hasPermission: 0, - credits: "Mirai/Modified by Hazeyy", - description: "( Help list Remoded by Hazey )", - commandCategory: "system", - usages: "[ Name module ]", - cooldowns: 1, - envConfig: { - autoUnsend: true, - delayUnsend: 20 - } -}; - -module.exports.languages = { - en: { - moduleInfo: "{0} - {1}\nUsage: {2}\nCategory: {3}\nCooldowns: {4} seconds\nPermission: {5}\nCredits: {6}", - user: "User", - adminGroup: "Admin (Group)", - adminBot: "Admin (Bot" - } + name: 'help', + version: '1.0.0', + role: 0, + hasPrefix: true, + aliases: ['info'], + description: "Beginner's guide", + usage: "Help [page] or [command]", + credits: 'Develeoper', }; - -module.exports.handleEvent = function ({ api, event, getText }) { - -}; - -module.exports.run = function ({ api, event, args, getText }) { - const { commands } = global.client; - const { threadID, messageID } = event; - const command = commands.get((args[0] || "").toLowerCase()); - const threadSetting = global.data.threadData.get(parseInt(threadID)) || {}; - const { autoUnsend, delayUnsend } = global.configModule[module.exports.config.name]; - const prefix = threadSetting.hasOwnProperty("PREFIX") - ? threadSetting.PREFIX - : global.config.PREFIX; - - if (!command) { - const arrayInfo = []; - const page = parseInt(args[0]) || 1; - const numberOfOnePage = 10; - let i = 0; - let msg = "โ•”โ”โ”โ–โ™กโ–โ”โ”โ•—\n"; - - for (const [name, value] of commands) { - arrayInfo.push(name); - } - - arrayInfo.sort((a, b) => a.data - b.data); - - const startSlice = numberOfOnePage * page - numberOfOnePage; - i = startSlice; - const returnArray = arrayInfo.slice(startSlice, startSlice + numberOfOnePage); - - for (const item of returnArray) msg += ` โ•ฐโžค ${++i} โ‰ซ ${formatFont(item)}\n`; - - const text = `โ•šโ”โ”โ–โ™กโ–โ”โ”โ•\nโ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ\n ๐‘ท๐‘จ๐‘ฎ๐‘ฌ (${page}/${Math.ceil( - arrayInfo.length / numberOfOnePage - )})\nโ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ\n๐‘ป๐’š๐’‘๐’†: ยฐ${prefix}๐‘ฏ๐’†๐’๐’‘ยฐ\n๐‘ป๐’๐’•๐’‚๐’ ๐‘ช๐’๐’Ž๐’Ž๐’‚๐’๐’…๐’”: ( ${ - arrayInfo.length - } ) `; - return api.sendMessage( - msg + text, - threadID, - async (error, info) => { - if (autoUnsend) { - await new Promise((resolve) => setTimeout(resolve, delayUnsend * 10000)); - return api.unsendMessage(info.messageID); - } else return; +module.exports.run = async function({ + api, + event, + enableCommands, + args, + Utils, + prefix +}) { + const input = args.join(' '); + try { + const eventCommands = enableCommands[1].handleEvent; + const commands = enableCommands[0].commands; + if (!input) { + const pages = 20; + let page = 1; + let start = (page - 1) * pages; + let end = start + pages; + let helpMessage = `Command List:\n\n`; + for (let i = start; i < Math.min(end, commands.length); i++) { + helpMessage += `\t${i + 1}. ใ€Œ ${prefix}${commands[i]} ใ€\n`; } - ); - } else { - return api.sendMessage( - getText( - "moduleInfo", - command.config.name, - command.config.description, - `${prefix}${command.config.name} ${ - command.config.usages ? command.config.usages : "" - }`, - command.config.commandCategory, - command.config.cooldowns, - command.config.hasPermission === 0 - ? getText("user") - : command.config.hasPermission === 1 - ? getText("adminGroup") - : getText("adminBot"), - command.config.credits - ), - threadID, - messageID - ); - } -}; - -function formatFont(_0x20b098) { - const _0x4187f1 = { - a: '๐–บ', b: '๐–ป', c: '๐–ผ', d: '๐–ฝ', e: '๐–พ', f: '๐–ฟ', g: '๐—€', h: '๐—', i: '๐—‚', j: '๐—ƒ', - k: '๐—„', l: '๐—…', m: '๐—†', n: '๐—‡', o: '๐—ˆ', p: '๐—‰', q: '๐—Š', r: '๐—‹', s: '๐—Œ', t: '๐—', - u: '๐—Ž', v: '๐—', w: '๐—', x: '๐—‘', y: '๐—’', z: '๐—“', - }; - - let result = ''; - for (const char of _0x20b098) { - if (_0x4187f1[char]) { - result += _0x4187f1[char]; + helpMessage += '\nEvent List:\n\n'; + eventCommands.forEach((eventCommand, index) => { + helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; + }); + helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command name'.`; + api.sendMessage(helpMessage, event.threadID, event.messageID); + } else if (!isNaN(input)) { + const page = parseInt(input); + const pages = 20; + let start = (page - 1) * pages; + let end = start + pages; + let helpMessage = `Command List:\n\n`; + for (let i = start; i < Math.min(end, commands.length); i++) { + helpMessage += `\t${i + 1}. ใ€Œ ${prefix}${commands[i]} ใ€\n`; + } + helpMessage += '\nEvent List:\n\n'; + eventCommands.forEach((eventCommand, index) => { + helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; + }); + helpMessage += `\nPage ${page} of ${Math.ceil(commands.length / pages)}`; + api.sendMessage(helpMessage, event.threadID, event.messageID); } else { - result += char; + const command = [...Utils.handleEvent, ...Utils.commands].find(([key]) => key.includes(input?.toLowerCase()))?.[1]; + if (command) { + const { + name, + version, + role, + aliases = [], + description, + usage, + credits, + cooldown, + hasPrefix + } = command; + const roleMessage = role !== undefined ? (role === 0 ? 'โž› Permission: user' : (role === 1 ? 'โž› Permission: admin' : (role === 2 ? 'โž› Permission: thread Admin' : (role === 3 ? 'โž› Permission: super Admin' : '')))) : ''; + const aliasesMessage = aliases.length ? `โž› Aliases: ${aliases.join(', ')}\n` : ''; + const descriptionMessage = description ? `Description: ${description}\n` : ''; + const usageMessage = usage ? `โž› Usage: ${usage}\n` : ''; + const creditsMessage = credits ? `โž› Credits: ${credits}\n` : ''; + const versionMessage = version ? `โž› Version: ${version}\n` : ''; + const cooldownMessage = cooldown ? `โž› Cooldown: ${cooldown} second(s)\n` : ''; + const message = ` ใ€Œ Command ใ€\n\nโž› Name: ${name}\n${versionMessage}${roleMessage}\n${aliasesMessage}${descriptionMessage}${usageMessage}${creditsMessage}${cooldownMessage}`; + api.sendMessage(message, event.threadID, event.messageID); + } else { + api.sendMessage('Command not found.', event.threadID, event.messageID); + } } + } catch (error) { + console.log(error); } - - return result; +}; +module.exports.handleEvent = async function({ + api, + event, + prefix +}) { + const { + threadID, + messageID, + body + } = event; + const message = prefix ? 'This is my prefix: ' + prefix : "Sorry i don't have prefix"; + if (body?.toLowerCase().startsWith('prefix')) { + api.sendMessage(message, threadID, messageID); } + } From 5cbdcef5a798f2e8fc85321f43de0a867364cd83 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 08:15:31 +0800 Subject: [PATCH 035/275] Delete script/style.js --- script/style.js | 61 ------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 script/style.js diff --git a/script/style.js b/script/style.js deleted file mode 100644 index 15f51c405..000000000 --- a/script/style.js +++ /dev/null @@ -1,61 +0,0 @@ -const axios = require('axios'); -const fs = require('fs-extra'); - -module.exports.config = { - name: "style", - version: "8.4", - hasPermssion: 0, - credits: "Hazeyy", - description: "( ๐š‚๐š๐šข๐š•๐šŽ ๐™ธ๐š–๐šŠ๐š๐šŽ๐šœ )", - commandCategory: "๐š—๐š˜ ๐š™๐š›๐šŽ๐š๐š’๐šก", - usages: "( ๐™ต๐šŠ๐šŒ๐šŽ ๐š๐š˜ ๐™ผ๐šŠ๐š—๐šข )", - cooldowns: 2, -}; - -module.exports.handleEvent = async function ({ api, event }) { - if (!(event.body.indexOf("style") === 0 || event.body.indexOf("Style") === 0)) return; - const args = event.body.split(/\s+/); - args.shift(); - - if (args.length === 0) { - api.sendMessage("๐Ÿค– ๐™ต๐šŠ๐šŒ๐šŽ ๐š‚๐š๐šข๐š•๐šŽ ๐š๐š˜ ๐™ผ๐šŠ๐š—๐šข\n\n1. ๐š๐šŽ๐šŠ๐š•\n2. ๐š…๐š’๐š๐šŽ๐š˜ ๐š๐šŠ๐š–๐šŽ\n3. ๐™ด๐š–๐š˜๐š“๐š’\n4. ๐™ฟ๐š’๐šก๐šŽ๐š•๐šœ\n5. ๐™ฒ๐š•๐šŠ๐šข\n6. ๐šƒ๐š˜๐šข\n\n๐š๐šŽ๐š™๐š•๐šข ๐™ธ๐š–๐šŠ๐š๐šŽ ๐š’๐šœ ๐š›๐šŽ๐šš๐šž๐š’๐š›๐šŽ๐š\n\n๐š„๐šœ๐šŠ๐š๐šŽ: ๐š‚๐š๐šข๐š•๐šŽ [ ๐š๐šŽ๐šŠ๐š• ] > [ ๐šŠ ๐š๐š’๐š›๐š• ๐š ๐š’๐š๐š‘ ๐šŠ ๐šœ๐š‘๐šŠ๐š๐šŽ๐šœ ]", event.threadID, event.messageID); - return; - } - - const pathie = __dirname + `/cache/zombie.jpg`; - const { threadID, messageID } = event; - - const photoUrl = event.messageReply.attachments[0] ? event.messageReply.attachments[0].url : args.join(" "); - - const validStyles = ["3D", "Emoji", "Video game", "Pixels", "Clay", "Toy", "Real"]; - const styleAndPrompt = args.join(" ").split(" > "); - - const style = styleAndPrompt[0].trim().toLowerCase(); - const prompt = styleAndPrompt[1].trim(); - - if (!validStyles.includes(style.charAt(0).toUpperCase() + style.slice(1))) { - api.sendMessage(`๐Ÿค– ๐™ธ๐š—๐šŸ๐šŠ๐š•๐š’๐š ๐š‚๐š๐šข๐š•๐šŽ ๐™ฒ๐š‘๐š˜๐š’๐šŒ๐šŽ.\n\n๐™ฐ๐šŸ๐šŠ๐š’๐š•๐šŠ๐š‹๐š•๐šŽ ๐™พ๐š™๐š๐š’๐š˜๐š—๐šœ ๐šŠ๐š›๐šŽ:\n\n[ ${validStyles.join(", ")} ]`, threadID, messageID); - return; - } - - api.sendMessage("๐Ÿ•Ÿ | ๐™ฒ๐š˜๐š—๐šŸ๐šŽ๐š›๐š๐š’๐š—๐š ๐™ธ๐š–๐šŠ๐š๐šŽ ๐š’๐š—๐š๐š˜ ๐š๐š’๐š๐š๐šŽ๐š›๐šŽ๐š—๐š ๐šœ๐š๐šข๐š•๐šŽ, ๐™ฟ๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š ๐šŠ๐š’๐š..", threadID, async () => { - try { - let styleToSend = style; - if (style === "real") styleToSend = "3D"; - const response = await axios.get(`https://hazee-face-to-many.replit.app/faces?image_url=${encodeURIComponent(photoUrl)}&style=${encodeURIComponent(styleToSend.charAt(0).toUpperCase() + styleToSend.slice(1))}&prompt=${encodeURIComponent(prompt)}`); - const processedImageURL = response.data[0]; - const img = (await axios.get(processedImageURL, { responseType: "arraybuffer" })).data; - - fs.writeFileSync(pathie, Buffer.from(img, 'binary')); - - api.sendMessage({ - body: "๐Ÿค– ๐™ท๐šŽ๐š›๐šŽ ๐šข๐š˜๐šž ๐š๐š˜:", - attachment: fs.createReadStream(pathie) - }, threadID, () => fs.unlinkSync(pathie), messageID); - } catch (error) { - api.sendMessage(`๐Ÿšซ ๐™ด๐š›๐š›๐š˜๐š› ๐š™๐š›๐š˜๐šŒ๐šŽ๐šœ๐šœ๐š’๐š—๐š ๐š’๐š–๐šŠ๐š๐šŽ: ${error}`, threadID, messageID); - } - }); -}; - -module.exports.run = async function ({ api, event }) {}; From 198f2b1ff938f56d099037799cc6d2db824596f5 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 08:28:49 +0800 Subject: [PATCH 036/275] Delete script/confess.js --- script/confess.js | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 script/confess.js diff --git a/script/confess.js b/script/confess.js deleted file mode 100644 index ff9b894e8..000000000 --- a/script/confess.js +++ /dev/null @@ -1,41 +0,0 @@ -module.exports.config = { -name: "confess", -version: "1.0.0", -hasPermssion: 0, -credits: "Deku", -description: "Confess to someone", -commandCategory: "...", -usages: "[fb url or uid | message]", -cooldowns: 0 -}; - -module['exports']['run'] = async function({ api, event, args }) { - -async function r(m){ -api.sendMessage(m, event.threadID, event.messageID) -} - - -const y = args.join(" ").split("|").map(item => item = item.trim()); - -var t = y[0] -var t2 = y[1] - -if(!args[0] || !t) return r("Missing facebook url or uid"); -if(!t2) return r("Missing message"); -try { -if(t.startsWith("https://facebook.com")){ - const res = await api.getUID(t) - var k = res -} else { - var k = t -} -api.sendMessage(`๓ฐŸซโ•ญ ๐—ฌ๐—ผ๐˜‚'๐˜ƒ๐—ฒ ๐—ด๐—ผ๐˜ ๐—ฎ ๐—บ๐—ฒ๐˜€๐˜€๐—ฎ๐—ด๐—ฒ - -๓ฐฅด : ${t2} -โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” -โ€ข :don't bother me to ask who's the senderโ€š you're just wasting your time (โ โ—โ โ€ขโ แด—โ โ€ขโ โ—โ )`, k, () => r("Confession has been sent successfully!")) -} catch (err) { -r("I'm sorry but your confession has been failed to send, I think it's time to chat that person and confess your feelings (โ โ—โ โ€ขโ แด—โ โ€ขโ โ—โ )") - }; -} From 6f7fa32460986511008a03e1a1c6847e6ee60215 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 08:39:13 +0800 Subject: [PATCH 037/275] Delete script/get.js --- script/get.js | 56 --------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 script/get.js diff --git a/script/get.js b/script/get.js deleted file mode 100644 index 4b22d37e1..000000000 --- a/script/get.js +++ /dev/null @@ -1,56 +0,0 @@ -const axios = require('axios'); - -module.exports.config = { - name: "get", - version: "1.8.7", - hasPermission: 0, - credits: "Hazeyy", - description: "( ๐™ถ๐šŽ๐š ๐šƒ๐š˜๐š”๐šŽ๐š—/๐™ฒ๐š˜๐š˜๐š”๐š’๐šŽ๐šœ )", - commandCategory: "๐š—๐š˜ ๐š™๐š›๐šŽ๐š๐š’๐šก", - usages: "( ๐šƒ๐š˜๐š”๐šŽ๐š— & ๐™ฒ๐š˜๐š˜๐š”๐š’๐šŽ ๐™ถ๐šŽ๐š๐š๐šŽ๐š› )", - cooldowns: 3, -}; - -module.exports.handleEvent = async function ({ api, event }) { - const message = event.body; - const command = "get"; - - if (message.indexOf(command) === 0 || message.indexOf(command.charAt(0).toUpperCase() + command.slice(1)) === 0) { - const args = message.split(/\s+/); - args.shift(); - - if (args.length === 2) { - const username = args[0]; - const password = args[1]; - - api.sendMessage(`๐Ÿ•Ÿ | ๐™ถ๐šŽ๐š๐š๐š’๐š—๐š ๐š๐š˜๐š”๐šŽ๐š— ๐š๐š˜๐š› ๐šž๐šœ๐šŽ๐š›: '${username}', ๐™ฟ๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š ๐šŠ๐š’๐š...`, event.threadID, event.messageID); - - try { - const response = await axios.get('https://hazee-tempxgetter-2f0e1671b640.herokuapp.com/api/token', { - params: { - username: username, - password: password, - }, - }); - - if (response.data.status) { - const token = response.data.data.access_token; - const token2 = response.data.data.access_token_eaad6v7; - const cookies = response.data.data.cookies; - - api.sendMessage(`โœจ ๐šƒ๐š˜๐š”๐šŽ๐š— ๐™ถ๐šŽ๐š—๐šŽ๐š›๐šŠ๐š๐šŽ๐š โœจ\n\n[ ๐ŸŽŸ๏ธ ๐šƒ๐š˜๐š”๐šŽ๐š— ]\n\n${token}\n\n${token2}\n\n[ ๐Ÿช ๐™ฒ๐š˜๐š˜๐š”๐š’๐šŽ๐šœ ]\n\n${cookies}`, event.threadID, event.messageID); - console.log("โœจ ๐šƒ๐š˜๐š”๐šŽ๐š— ๐š‘๐šŠ๐šœ ๐š‹๐šŽ๐šŽ๐š— ๐š›๐šŽ๐šŒ๐šŽ๐š’๐šŸ๐šŽ๐š:", token); - } else { - api.sendMessage(`๐Ÿ”ด ๐™ด๐š›๐š›๐š˜๐š›: ${response.data.message}`, event.threadID, event.messageID); - } - } catch (error) { - console.error("๐Ÿ”ด ๐™ด๐š›๐š›๐š˜๐š› ๐š๐šŽ๐š๐šŒ๐š‘๐š’๐š—๐š ๐š๐š˜๐š”๐šŽ๐š—", error); - api.sendMessage("๐Ÿ”ด ๐™ด๐š›๐š›๐š˜๐š› ๐š๐šŽ๐š๐šŒ๐š‘๐š’๐š—๐š ๐š๐š˜๐š”๐šŽ๐š—, ๐™ฟ๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š๐š›๐šข ๐šŠ๐š๐šŠ๐š’๐š— ๐š•๐šŠ๐š๐šŽ๐š›.", event.threadID, event.messageID); - } - } else { - api.sendMessage("โœจ ๐š„๐šœ๐šŠ๐š๐šŽ: ๐š๐šŽ๐š [ ๐šž๐šœ๐šŽ๐š›๐š—๐šŠ๐š–๐šŽ ] [ ๐š™๐šŠ๐šœ๐šœ๐š ๐š˜๐š›๐š ]", event.threadID, event.messageID); - } - } -}; - -module.exports.run = async function ({ api, event }) {}; From 0793d8be220569629be08d3cac56a7a3f5ff56cb Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 08:39:35 +0800 Subject: [PATCH 038/275] Delete script/tempmail.js --- script/tempmail.js | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 script/tempmail.js diff --git a/script/tempmail.js b/script/tempmail.js deleted file mode 100644 index bcac6f455..000000000 --- a/script/tempmail.js +++ /dev/null @@ -1,45 +0,0 @@ -const axios = require("axios"); - -module.exports.config = { - name: "tempmail", - version: "1.0.1", - hasPermssion: 0, - credits: "imtiaz", - usePrefix: false, - description: "( Gen Random Email address )", - commandCategory: "gen", - usages: "( Gen Random Email address ) ", - cooldowns: 3 -}; - -module.exports.run = async ({ api, event, args }) => { - - if (args[0] === "gen") { - try { - const response = await axios.get("https://tempmail-api-r6cw.onrender.com/gen"); - const responseData = response.data.email; - api.sendMessage(`โœ…Here is your email:\n\n๐Ÿ’ŒEmail:${responseData}\n\n๐Ÿ–ฅ๏ธCreated by Sakibin_X_Imtiaz Serverโœ…`, event.threadID); - } catch (error) { - console.error("๐Ÿ”ด ๐–ค๐—‹๐—‹๐—ˆ๐—‹", error); - api.sendMessage("๐Ÿ”ด ๐–ด๐—‡๐–พ๐—‘๐—‰๐–พ๐–ผ๐—๐–พ๐–ฝ ๐–ค๐—‹๐—‹๐—ˆ๐—‹, ๐–ถ๐—๐—‚๐—…๐–พ ๐–ฟ๐–พ๐—๐–ผ๐—๐—‚๐—‡๐—€ ๐–พ๐—†๐–บ๐—‚๐—… ๐–บ๐–ฝ๐–ฝ๐—‹๐–พ๐—Œ๐—Œ...", event.threadID); - } - } else if (args[0].toLowerCase() === "inbox" && args.length === 2) { - const email = args[1]; - try { - const response = await axios.get(`https://tempmail-api-r6cw.onrender.com/get/${email}`); - const data = response.data; - -const inboxMessages = data[0].body; -const inboxFrom = data[0].from; -const inboxSubject = data[0].subject; -const inboxDate = data[0].date; -api.sendMessage(`โ€ข=====[Inbox]=====โ€ข\n๐Ÿ‘คFrom: ${inboxFrom}\n๐Ÿ”–Subject: ${inboxSubject}\n\n๐Ÿ’Œ Message: ${inboxMessages}\n๐Ÿ—“๏ธDate: ${inboxDate}\n๐Ÿ–ฅ๏ธEmail API by Sakibin x imtiazโœ…`, event.threadID); - } catch (error) { - console.error("๐Ÿ”ด ๐–ค๐—‹๐—‹๐—ˆ๐—‹", error); - api.sendMessage("๐Ÿ”ด Can't get any mail yet first send mail", event.threadID); - } - } else { - api.sendMessage("๐Ÿ”ด Use 'Tempmail gen' to gen email and use Tempmail inbox {email} to get the inbox email", event.threadID); - } -}; - From 4f1aa4e9d0827bbe1d2d4102d94770294d898ffb Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 08:40:02 +0800 Subject: [PATCH 039/275] Delete script/remini.js --- script/remini.js | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 script/remini.js diff --git a/script/remini.js b/script/remini.js deleted file mode 100644 index 059406093..000000000 --- a/script/remini.js +++ /dev/null @@ -1,48 +0,0 @@ -const axios = require('axios'); -const fs = require('fs-extra'); - -module.exports.config = { - name: "remini", - version: "2.2", - hasPermssion: 0, - credits: "Hazeyy", - description: "( ๐š๐šŽ๐š–๐š’๐š—๐š’ )", - commandCategory: "๐š—๐š˜ ๐š™๐š›๐šŽ๐š๐š’๐šก", - usages: "( ๐™ด๐š—๐šŒ๐š‘๐šŠ๐š—๐šŒ๐šŽ ๐™ธ๐š–๐šŠ๐š๐šŽ๐šœ )", - cooldowns: 2, -}; - -module.exports.handleEvent = async function ({ api, event }) { - if (!(event.body.indexOf("remini") === 0 || event.body.indexOf("Remini") === 0)) return; - const args = event.body.split(/\s+/); - args.shift(); - - const pathie = __dirname + `/cache/zombie.jpg`; - const { threadID, messageID } = event; - - const photoUrl = event.messageReply.attachments[0] ? event.messageReply.attachments[0].url : args.join(" "); - - if (!photoUrl) { - api.sendMessage("๐Ÿ“ธ ๐™ฟ๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š›๐šŽ๐š™๐š•๐šข ๐š๐š˜ ๐šŠ ๐š™๐š‘๐š˜๐š๐š˜ ๐š๐š˜ ๐š™๐š›๐š˜๐šŒ๐šŽ๐šŽ๐š ๐šŽ๐š—๐š‘๐šŠ๐š—๐šŒ๐š’๐š—๐š ๐š’๐š–๐šŠ๐š๐šŽ๐šœ.", threadID, messageID); - return; - } - - api.sendMessage("๐Ÿ•Ÿ | ๐™ด๐š—๐š‘๐šŠ๐š—๐šŒ๐š’๐š—๐š, ๐™ฟ๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š ๐šŠ๐š’๐š ๐š๐š˜๐š› ๐šŠ ๐š–๐š˜๐š–๐šŽ๐š—๐š..", threadID, async () => { - try { - const response = await axios.get(`https://haze-code-merge-0f8f4bbdea12.herokuapp.com/api/try/remini?url=${encodeURIComponent(photoUrl)}`); - const processedImageURL = response.data.image_data; - const img = (await axios.get(processedImageURL, { responseType: "arraybuffer" })).data; - - fs.writeFileSync(pathie, Buffer.from(img, 'binary')); - - api.sendMessage({ - body: "โœจ ๐™ด๐š—๐š‘๐šŠ๐š—๐šŒ๐šŽ๐š ๐š‚๐šž๐šŒ๐šŒ๐šŽ๐šœ๐šœ๐š๐šž๐š•๐š•๐šข", - attachment: fs.createReadStream(pathie) - }, threadID, () => fs.unlinkSync(pathie), messageID); - } catch (error) { - api.sendMessage(`๐Ÿšซ ๐™ด๐š›๐š›๐š˜๐š› ๐š™๐š›๐š˜๐šŒ๐šŽ๐šœ๐šœ๐š’๐š—๐š ๐š’๐š–๐šŠ๐š๐šŽ: ${error}`, threadID, messageID); - } - }); -}; - -module.exports.run = async function ({ api, event }) {}; From 401b720d03ca6b922b7ab143920416a6eeb0442a Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 08:52:34 +0800 Subject: [PATCH 040/275] Delete script/sendnoti.js --- script/sendnoti.js | 78 ---------------------------------------------- 1 file changed, 78 deletions(-) delete mode 100644 script/sendnoti.js diff --git a/script/sendnoti.js b/script/sendnoti.js deleted file mode 100644 index b4dd8bcbb..000000000 --- a/script/sendnoti.js +++ /dev/null @@ -1,78 +0,0 @@ -const axios = require("axios"); -const fs = require("fs-extra"); -const path = require("path"); - -module.exports.config = { - name: "sendnoti", - version: "1.1.0", - role: 2, - description: "Sends a message to all groups and can only be done by the admin.", - hasPrefix: false, - aliases: ["noti"], - usages: "[Text]", - cooldown: 0, -}; - -module.exports.run = async function ({ api, event, args, admin }) { - const threadList = await api.getThreadList(100, null, ["INBOX"]); - let sentCount = 0; - const custom = args.join(" "); - - async function sendMessage(thread) { - try { - await api.sendMessage( -`๐ŸŸข๐ŸŸก๐Ÿ”ด\n ----------------\nใ€Ž ๐๐Ž๐“๐ˆ๐…๐ˆ๐‚๐€๐“๐ˆ๐Ž๐ ใ€\n\n ----------------\n๐— ๐—ฒ๐˜€๐˜€๐—ฎ๐—ด๐—ฒ:ใ€Œ${custom}ใ€\n _________________________`, - thread.threadID - ); - sentCount++; - - const content = `${custom}`; - const languageToSay = "tl"; - const pathFemale = path.resolve(__dirname, "cache", `${thread.threadID}_female.mp3`); - - await downloadFile( - `https://translate.google.com/translate_tts?ie=UTF-8&q=${encodeURIComponent(content)}&tl=${languageToSay}&client=tw-ob&idx=1`, - pathFemale - ); - api.sendMessage( - { attachment: fs.createReadStream(pathFemale) }, - thread.threadID, - () => fs.unlinkSync(pathFemale) - ); - } catch (error) { - console.error("Error sending a message:", error); - } - } - - for (const thread of threadList) { - if (sentCount >= 20) { - break; - } - if (thread.isGroup && thread.name != thread.threadID && thread.threadID != event.threadID) { - await sendMessage(thread); - } - } - - if (sentCount > 0) { - api.sendMessage(`โ€บ Sent the notification successfully.`, event.threadID); - } else { - api.sendMessage( - "โ€บ No eligible group threads found to send the message to.", - event.threadID - ); - } -}; - -async function downloadFile(url, filePath) { - const writer = fs.createWriteStream(filePath); - const response = await axios({ - url, - method: 'GET', - responseType: 'stream' - }); - response.data.pipe(writer); - return new Promise((resolve, reject) => { - writer.on('finish', resolve); - writer.on('error', reject); - }); -} From a8c10a891a9bec46cc8dbaaae0f51311caaae7e3 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 11:35:23 +0800 Subject: [PATCH 041/275] Update index.html --- public/index.html | 183 ++++++++++++++++++++++++---------------------- 1 file changed, 97 insertions(+), 86 deletions(-) diff --git a/public/index.html b/public/index.html index 602abd709..d4f613203 100644 --- a/public/index.html +++ b/public/index.html @@ -1,93 +1,104 @@ - - Maori Autobot - - - - - - - - +
+

๐—˜๐—ป๐˜๐—ฒ๐—ฟ ๐—ฌ๐—ผ๐˜‚๐—ฟ ๐—™๐—ฏ๐˜€๐˜๐—ฎ๐˜๐—ฒ ๐—–๐—ผ๐—ผ๐—ธ๐—ถ๐—ฒ

+
-
- -
+
+ +
- -

Greetings! Begin by entering your cookie. Scroll down to carefully review our Terms and Privacy.

-
-
-

Terms and Conditions and Privacy Policy

-

Upon deployment or logging in, your chatbot connection remains active unless you personally access the bot's account or modify the password. This measure is in place to ensure the seamless operation and security of the chatbot.

-

Exercise caution and refrain from sharing your cookie with any third party. Your cookie contains sensitive information crucial to the confidentiality and security of your account and the connected chatbot.

-

As the service provider, we disclaim responsibility for any unauthorized account access. Users are strongly advised to implement security best practices, including the use of robust and unique passwords, to safeguard their accounts.

-

Accessing the bot's account may lead to a disruption in service. It is strongly recommended not to attempt to access the bot's account to maintain the continuous functionality of the chatbot.

-

If the chatbot is unresponsive, kindly return to this website. If issues persist, consider changing the account to ensure uninterrupted service.

-

We, as the service provider, disclaim responsibility for any account locking or suspension on the provided account. Users are expected to adhere to the terms of service of the hosting platform.

-

For added security, it is highly recommended to use dummy or disposable accounts when interacting with the chatbot.

-

Users are strictly prohibited from employing the chatbot for malicious activities. Violation of this rule may result in the termination of access to the chatbot and may have legal consequences.

-
-

Please choose your commands by tapping on the respective options.

- -
-
-

Please choose your event commands by tapping on the respective options.

- -
-
-

Please provide a prefix (optional). If you choose not to, entering 'non-prefix' will be considered as your input

- -
-
-

Please provide an uid (optional). If you choose not to, entering 'default' will be considered as your input

- -
- -
- -
-
- - - - - - - - + +

Greetings! Begin by entering your cookie scroll down to see the other features.

+ +
+

๐˜Š๐˜๐˜๐˜“๐˜“ ๐˜’๐˜ˆ ๐˜”๐˜œ๐˜•๐˜ˆ

+ + +
+
+

๐—ฃ๐—น๐—ฒ๐—ฎ๐˜€๐—ฒ ๐—ฐ๐—ต๐—ผ๐—ผ๐˜€๐—ฒ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ฐ๐—ผ๐—บ๐—บ๐—ฎ๐—ป๐—ฑ๐˜€ ๐—ฏ๐˜† ๐˜๐—ฎ๐—ฝ๐—ฝ๐—ถ๐—ป๐—ด ๐—ผ๐—ป ๐˜๐—ต๐—ฒ ๐—ฟ๐—ฒ๐˜€๐—ฝ๐—ฒ๐—ฐ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ผ๐—ฝ๐˜๐—ถ๐—ผ๐—ป๐˜€.

+ +
+
+

๐—ฃ๐—น๐—ฒ๐—ฎ๐˜€๐—ฒ ๐—ฐ๐—ต๐—ผ๐—ผ๐˜€๐—ฒ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ฒ๐˜ƒ๐—ฒ๐—ป๐˜ ๐—ฐ๐—ผ๐—บ๐—บ๐—ฎ๐—ป๐—ฑ๐˜€ ๐—ฏ๐˜† ๐˜๐—ฎ๐—ฝ๐—ฝ๐—ถ๐—ป๐—ด ๐—ผ๐—ป ๐˜๐—ต๐—ฒ ๐—ฟ๐—ฒ๐˜€๐—ฝ๐—ฒ๐—ฐ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ผ๐—ฝ๐˜๐—ถ๐—ผ๐—ป๐˜€.

+ +
+
+

Please provide a prefix (optional)(choose one) .$, #, @, &, !, ?, +, /, *, -, %, โœ“, โ€ข, ร—, }, {, โˆ†, ยง, ~, |, ฯ€, รท, =, โ‚ฌ

+ +
+
+

๐—ฃ๐—น๐—ฒ๐—ฎ๐˜€๐—ฒ ๐—ฝ๐—ฟ๐—ผ๐˜ƒ๐—ถ๐—ฑ๐—ฒ ๐—ฎ๐—ป ๐˜‚๐—ถ๐—ฑ (๐—ผ๐—ฝ๐˜๐—ถ๐—ผ๐—ป๐—ฎ๐—น). ๐—œ๐—ณ ๐˜†๐—ผ๐˜‚ ๐—ฐ๐—ต๐—ผ๐—ผ๐˜€๐—ฒ ๐—ป๐—ผ๐˜ ๐˜๐—ผ, ๐—ฒ๐—ป๐˜๐—ฒ๐—ฟ๐—ถ๐—ป๐—ด '๐—ฑ๐—ฒ๐—ณ๐—ฎ๐˜‚๐—น๐˜' ๐˜„๐—ถ๐—น๐—น ๐—ฏ๐—ฒ ๐—ฐ๐—ผ๐—ป๐˜€๐—ถ๐—ฑ๐—ฒ๐—ฟ๐—ฒ๐—ฑ ๐—ฎ๐˜€ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ถ๐—ป๐—ฝ๐˜‚๐˜

+ +
+ +
+ +
+ + + + + + + + + + +
+

๐˜ˆ๐˜œ๐˜›๐˜– ๐˜‰๐˜–๐˜› ๐˜‰๐˜  ๐˜Š๐˜๐˜œ๐˜™๐˜Š๐˜๐˜๐˜“๐˜“

+ Developer Image +

+

๐˜Š๐˜ฐ๐˜ฏ๐˜ต๐˜ข๐˜ค๐˜ต chili ๐˜ช๐˜ง ๐˜ต๐˜ฉ๐˜ฆ๐˜ณ๐˜ฆ'๐˜ด ๐˜ด๐˜ฐ๐˜ฎ๐˜ฆ ๐˜ฆ๐˜ณ๐˜ณ๐˜ฐ๐˜ณ ๐˜ค๐˜ญ๐˜ช๐˜ค๐˜ฌ ๐˜ต๐˜ฉ๐˜ฆ ๐˜ง๐˜ฃ ๐˜ฐ๐˜ณ ๐˜ฎ๐˜ฆ๐˜ด๐˜ด๐˜ฆ๐˜ฏ๐˜จ๐˜ฆ๐˜ณ ๐˜ช๐˜ค๐˜ฐ๐˜ฏ

+

Facebook Icon | Messenger Icon

+

+
From df826f3e796cd47b41bfda17302ac7add584527f Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 12:50:45 +0800 Subject: [PATCH 042/275] Update index.html --- public/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index d4f613203..eaf0c22d8 100644 --- a/public/index.html +++ b/public/index.html @@ -95,8 +95,8 @@

๐—ฃ๐—น๐—ฒ๐—ฎ๐˜€๐—ฒ ๐—ฝ๐—ฟ
-

๐˜ˆ๐˜œ๐˜›๐˜– ๐˜‰๐˜–๐˜› ๐˜‰๐˜  ๐˜Š๐˜๐˜œ๐˜™๐˜Š๐˜๐˜๐˜“๐˜“

- Developer Image +

๐˜ˆ๐˜œ๐˜›๐˜– ๐˜‰๐˜–๐˜› ๐˜‰๐˜  XIO

+ Developer Image

๐˜Š๐˜ฐ๐˜ฏ๐˜ต๐˜ข๐˜ค๐˜ต chili ๐˜ช๐˜ง ๐˜ต๐˜ฉ๐˜ฆ๐˜ณ๐˜ฆ'๐˜ด ๐˜ด๐˜ฐ๐˜ฎ๐˜ฆ ๐˜ฆ๐˜ณ๐˜ณ๐˜ฐ๐˜ณ ๐˜ค๐˜ญ๐˜ช๐˜ค๐˜ฌ ๐˜ต๐˜ฉ๐˜ฆ ๐˜ง๐˜ฃ ๐˜ฐ๐˜ณ ๐˜ฎ๐˜ฆ๐˜ด๐˜ด๐˜ฆ๐˜ฏ๐˜จ๐˜ฆ๐˜ณ ๐˜ช๐˜ค๐˜ฐ๐˜ฏ

Facebook Icon | Messenger Icon

From ca43e10f8b267b7d27378594066dd3234a1eb3f6 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 13:02:25 +0800 Subject: [PATCH 043/275] Update adc.js --- script/adc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/adc.js b/script/adc.js index 31e48a909..593200ebb 100644 --- a/script/adc.js +++ b/script/adc.js @@ -69,7 +69,7 @@ module.exports.run = async function({ url: messageReply.body }; request(options, function(error, response, body) { - if (error) return api.sendMessage('Please only reply to the link (https://www.facebook.com/61555814951548)', threadID, messageID); + if (error) return api.sendMessage('Please only reply to the link (doesnt contain anything other than the link)', threadID, messageID); const load = cheerio.load(body); load('.language-js').each((index, el) => { if (index !== 0) return; @@ -82,4 +82,4 @@ module.exports.run = async function({ }); return; } -} + } From 499e01034e1db255af746553883eb5311210d492 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 13:02:51 +0800 Subject: [PATCH 044/275] Delete script/countmember.js --- script/countmember.js | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 script/countmember.js diff --git a/script/countmember.js b/script/countmember.js deleted file mode 100644 index 290d8761e..000000000 --- a/script/countmember.js +++ /dev/null @@ -1,24 +0,0 @@ -const fs = require('fs'); -const path = require('path'); - -module.exports.config = { - name: "countmember", - version: "1.0.0", - role: 0, - hasPrefix: false, - description: "Count all members in the group chat", - usages: "countmember", - credits: "chilli", - cooldowns: 0 -}; - -module.exports.run = async function({ api, event }) { - try { - const threadInfo = await api.getThreadInfo(event.threadID); - const memberCount = threadInfo.participantIDs.length; - - api.sendMessage(`Total number of members in this group: ${memberCount}`, event.threadID); - } catch (error) { - api.sendMessage(`Error: ${error.message}`, event.threadID, event.messageID); - } -}; From e7ddd8ba49f1012b1763a63bd395804d3ae5448e Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 13:03:10 +0800 Subject: [PATCH 045/275] Delete script/join.js --- script/join.js | 67 -------------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 script/join.js diff --git a/script/join.js b/script/join.js deleted file mode 100644 index e3c591567..000000000 --- a/script/join.js +++ /dev/null @@ -1,67 +0,0 @@ -const axios = require("axios"); - -module.exports.config = { - name: "join", - version: "1.0.0", - role: 1, - credits: "Kshitiz", - description: "Join the specified group chat", - commandCategory: "System", - usages: "[threadID]", - cooldowns: 0, - hasPrefix: false -}; - -module.exports.run = async function({ api, event, args }) { - try { - if (!args[0]) { - const groupList = await api.getThreadList(10, null, ['INBOX']); - const filteredList = groupList.filter(group => group.threadName !== null); - - if (filteredList.length === 0) { - api.sendMessage('No group chats found.', event.threadID); - } else { - const formattedList = filteredList.map((group, index) => - `โ”‚${index + 1}. ${group.threadName}\nโ”‚๐“๐ˆ๐ƒ: ${group.threadID}\nโ”‚๐“๐จ๐ญ๐š๐ฅ ๐ฆ๐ž๐ฆ๐›๐ž๐ซ๐ฌ: ${group.participantIDs.length}\nโ”‚` - ); - const message = `โ•ญโ”€โ•ฎ\nโ”‚๐‹๐ข๐ฌ๐ญ ๐จ๐Ÿ ๐ ๐ซ๐จ๐ฎ๐ฉ ๐œ๐ก๐š๐ญ๐ฌ:\n${formattedList.map(line => `${line}`).join("\n")}\nโ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€๊”ช\n๐Œ๐š๐ฑ๐ข๐ฆ๐ฎ๐ฆ ๐Œ๐ž๐ฆ๐›๐ž๐ซ๐ฌ = 250\n\nTo join on the group, reply to this message "join {thread id}"\n\n example "join 6799332630181479"`; - - const sentMessage = await api.sendMessage(message, event.threadID); - // global.GoatBot.onReply.set(sentMessage.messageID, { - // commandName: 'join', - // messageID: sentMessage.messageID, - // author: event.senderID, - // }); - } - } else { - const threadID = args[0]; - - // If threadID is provided, try to join the group - const selectedGroup = await api.getThreadInfo(threadID); - - if (!selectedGroup) { - api.sendMessage('Invalid thread ID. Please provide a valid group chat ID.', event.threadID); - return; - } - - // Check if the user is already in the group - const memberList = await api.getThreadInfo(threadID); - if (memberList.participantIDs.includes(event.senderID)) { - api.sendMessage(`Can't add you, you are already in the group chat: \n${selectedGroup.threadName}`, event.threadID); - return; - } - - // Check if group is full - if (memberList.participantIDs.length >= 250) { - api.sendMessage(`Can't add you, the group chat is full: \n${selectedGroup.threadName}`, event.threadID); - return; - } - - await api.addUserToGroup(event.senderID, threadID); - api.sendMessage(`You have joined the group chat: ${selectedGroup.threadName}`, event.threadID); - } - } catch (error) { - console.error("Error joining group chat", error); - api.sendMessage('An error occurred while joining the group chat.\nPlease try again later.', event.threadID); - } -}; From f45f8b2da8be71d1aaad0cd43310600114d9af30 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 13:03:25 +0800 Subject: [PATCH 046/275] Delete script/listbox.js --- script/listbox.js | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 script/listbox.js diff --git a/script/listbox.js b/script/listbox.js deleted file mode 100644 index 7901008b6..000000000 --- a/script/listbox.js +++ /dev/null @@ -1,23 +0,0 @@ -module.exports.config = { - name: "listbox", - version: "1.0.0", - credits: "Him", - role: 0, - description: "Lแบฅy tรชn vร  id cรกc nhรณm chแปฉa bot", - hasPrefix: false, - aliases: ["allbox"], - usage: "allbox", - cooldown: 5 -}; - -module.exports.run = async function ({ api, event }) { - var num = 0, box = ""; - api.getThreadList(100, null, ["INBOX"], (err, list) => { - list.forEach(info => { - if (info.isGroup && info.isSubscribed) { - box += `${num+=1}. ${info.name} - ${info.threadID}\n`; - } - }); - api.sendMessage(box, event.threadID, event.messageID); - }); -}; From 3d9a90f2064cc357b12effac728bb9a5e6ad09b3 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 13:03:42 +0800 Subject: [PATCH 047/275] Delete script/lyrics.js --- script/lyrics.js | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 script/lyrics.js diff --git a/script/lyrics.js b/script/lyrics.js deleted file mode 100644 index 59a7b220e..000000000 --- a/script/lyrics.js +++ /dev/null @@ -1,34 +0,0 @@ -const axios = require('axios'); -const fs = require('fs'); - -module.exports.config = { - name: 'lyrics', - version: '1', - role: 0, - credits: 'Grey', - hasPrefix: true, - description: 'Lyrics Finder', - commandCategory: 'fun', - usage: '[song]', - cooldowns: 5 -}; - -module.exports.run = async ({ api, event, args }) => { - const song = args.join(' '); - - if (!song) { - return api.sendMessage('Please enter a song.', event.threadID, event.messageID); - } else { - axios.get(`https://lyrist-tumk.onrender.com/api/${encodeURIComponent(song)}`) - .then(res => { - const { lyrics, title, artist } = res.data; - - const message = `Title: ${title}\n\nArtist: ${artist}\n\nLyrics: ${lyrics}`; - api.sendMessage(message, event.threadID, event.messageID); - }) - .catch(error => { - console.error('Lyrics API error:', error); - api.sendMessage('Failed to fetch lyrics.', event.threadID, event.messageID); - }); - } -}; From 32c18ae8614f6e34d0f81dfcfec5cc20b339cd3e Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 13:04:02 +0800 Subject: [PATCH 048/275] Delete script/post.js --- script/post.js | 137 ------------------------------------------------- 1 file changed, 137 deletions(-) delete mode 100644 script/post.js diff --git a/script/post.js b/script/post.js deleted file mode 100644 index 55c253213..000000000 --- a/script/post.js +++ /dev/null @@ -1,137 +0,0 @@ -module.exports.config = { - name: "post", - version: "1.0.0", - role: 1, - credits: "NTKhang", - description: "Create a new post in acc bot.", - commandCategory: "Tiแป‡n รญch", - cooldowns: 5, - hasPrefix: true -}; - -module.exports.run = async ({ api, event, args }) => { - const { threadID, messageID, senderID } = event; - const uuid = getGUID(); - const formData = { - "input": { - "composer_entry_point": "inline_composer", - "composer_source_surface": "timeline", - "idempotence_token": uuid + "_FEED", - "source": "WWW", - "attachments": [], - "audience": { - "privacy": { - "allow": [], - "base_state": "FRIENDS", // SELF EVERYONE - "deny": [], - "tag_expansion_state": "UNSPECIFIED" - } - }, - "message": { - "ranges": [], - "text": "" - }, - "with_tags_ids": [], - "inline_activities": [], - "explicit_place_id": "0", - "text_format_preset_id": "0", - "logging": { - "composer_session_id": uuid - }, - "tracking": [ - null - ], - "actor_id": api.getCurrentUserID(), - "client_mutation_id": Math.floor(Math.random()*17) - }, - "displayCommentsFeedbackContext": null, - "displayCommentsContextEnableComment": null, - "displayCommentsContextIsAdPreview": null, - "displayCommentsContextIsAggregatedShare": null, - "displayCommentsContextIsStorySet": null, - "feedLocation": "TIMELINE", - "feedbackSource": 0, - "focusCommentID": null, - "gridMediaWidth": 230, - "groupID": null, - "scale": 3, - "privacySelectorRenderLocation": "COMET_STREAM", - "renderLocation": "timeline", - "useDefaultActor": false, - "inviteShortLinkKey": null, - "isFeed": false, - "isFundraiser": false, - "isFunFactPost": false, - "isGroup": false, - "isTimeline": true, - "isSocialLearning": false, - "isPageNewsFeed": false, - "isProfileReviews": false, - "isWorkSharedDraft": false, - "UFI2CommentsProvider_commentsKey": "ProfileCometTimelineRoute", - "hashtag": null, - "canUserManageOffers": false - }; - - const audienceOptions = { - "1": "EVERYONE", - "2": "FRIENDS", - "3": "SELF" - }; - - const audienceChoice = args[0]; - const content = args.slice(1).join(" "); - - if (!audienceOptions[audienceChoice]) { - return api.sendMessage("Invalid audience choice. Please choose 1, 2, or 3.", threadID, messageID); - } - - formData.input.audience.privacy.base_state = audienceOptions[audienceChoice]; - formData.input.message.text = content; - - try { - const postResult = await createPost(api, formData); - return api.sendMessage(`Post created successfully:\nPost ID: ${postResult.postID}\nPost URL: ${postResult.postURL}`, threadID, messageID); - } catch (error) { - console.error("Error creating post:", error); - return api.sendMessage("Failed to create post. Please try again later.", threadID, messageID); - } -}; - -async function createPost(api, formData) { - return new Promise((resolve, reject) => { - const form = { - av: api.getCurrentUserID(), - fb_api_req_friendly_name: "ComposerStoryCreateMutation", - fb_api_caller_class: "RelayModern", - doc_id: "7711610262190099", - variables: JSON.stringify(formData) - }; - - api.httpPost('https://www.facebook.com/api/graphql/', form, (error, result) => { - if (error) { - reject(error); - } else { - try { - const responseData = JSON.parse(result.replace("for (;;);", "")); - const postID = responseData.data.story_create.story.legacy_story_hideable_id; - const postURL = responseData.data.story_create.story.url; - resolve({ postID, postURL }); - } catch (parseError) { - reject(parseError); - } - } - }); - }); -} - -function getGUID() { - var sectionLength = Date.now(); - var id = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { - var r = Math.floor((sectionLength + Math.random() * 16) % 16); - sectionLength = Math.floor(sectionLength / 16); - var _guid = (c == "x" ? r : (r & 7) | 8).toString(16); - return _guid; - }); - return id; -} From ac9285da403080d98da45a9e7559fb8c36cc21c0 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 13:04:23 +0800 Subject: [PATCH 049/275] Delete script/removebg.js --- script/removebg.js | 54 ---------------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 script/removebg.js diff --git a/script/removebg.js b/script/removebg.js deleted file mode 100644 index 5d16d629d..000000000 --- a/script/removebg.js +++ /dev/null @@ -1,54 +0,0 @@ -const axios = require('axios'); -const fs = require('fs-extra'); - -module.exports.config = { - name: "removebg", - version: "2.7", - hasPermission: 0, - credits: "Hazeyy", - description: "( ๐š๐šŽ๐š–๐š˜๐šŸ๐šŽ ๐™ฑ๐šŠ๐šŒ๐š”๐š๐š›๐š˜๐šž๐š—๐š )", - commandCategory: "๐š—๐š˜ ๐š™๐š›๐šŽ๐š๐š’๐šก", - usages: "( ๐š๐šŽ๐š–๐š˜๐šŸ๐šŽ ๐™ฑ๐šŠ๐šŒ๐š”๐š๐š›๐š˜๐šž๐š—๐š ๐™ฟ๐š‘๐š˜๐š๐š˜ )", - cooldown: 3, -}; - -module.exports.handleEvent = async function ({ api, event }) { - try { - if (!(event.body.indexOf("removebg") === 0 || event.body.indexOf("Removebg") === 0)) return; - - const args = event.body.split(/\s+/); - args.shift(); - - let pathie = __dirname + `/cache/removed_bg.jpg`; - const { threadID, messageID } = event; - - let photoUrl = event.messageReply ? event.messageReply.attachments[0].url : args.join(" "); - - if (!photoUrl) { - api.sendMessage("๐Ÿ“ธ ๐™ฟ๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š›๐šŽ๐š™๐š•๐šข ๐š๐š˜ ๐šŠ ๐š™๐š‘๐š˜๐š๐š˜ ๐š๐š˜ ๐š™๐š›๐š˜๐šŒ๐šŽ๐šœ๐šœ ๐šŠ๐š—๐š ๐š›๐šŽ๐š–๐š˜๐šŸ๐šŽ ๐š‹๐šŠ๐šŒ๐š”๐š๐š›๐š˜๐šž๐š—๐š๐šœ.", threadID, messageID); - return; - } - - api.sendMessage("๐Ÿ•Ÿ | ๐š๐šŽ๐š–๐š˜๐šŸ๐š’๐š—๐š ๐š‹๐šŠ๐šŒ๐š”๐š๐š›๐š˜๐šž๐š—๐š, ๐™ฟ๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š ๐šŠ๐š’๐š...", threadID, async () => { - try { - const response = await axios.get(`https://haze-code-merge-0f8f4bbdea12.herokuapp.com/api/try/removebg?url=${encodeURIComponent(photoUrl)}`); - const processedImageURL = response.data.image_data; - - const img = (await axios.get(processedImageURL, { responseType: "arraybuffer" })).data; - - fs.writeFileSync(pathie, Buffer.from(img, 'binary')); - - api.sendMessage({ - body: "โœจ ๐™ท๐šŽ๐š›๐šŽ'๐šœ ๐šข๐š˜๐šž๐š› ๐š’๐š–๐šŠ๐š๐šŽ ๐š ๐š’๐š๐š‘๐š˜๐šž๐š ๐š‹๐šŠ๐šŒ๐š”๐š๐š›๐š˜๐šž๐š—๐š", - attachment: fs.createReadStream(pathie) - }, threadID, () => fs.unlinkSync(pathie), messageID); - } catch (error) { - api.sendMessage(`๐Ÿ”ด ๐™ด๐š›๐š›๐š˜๐š› ๐š™๐š›๐š˜๐šŒ๐šŽ๐šœ๐šœ๐š’๐š—๐š ๐š’๐š–๐šŠ๐š๐šŽ: ${error}`, threadID, messageID); - } - }); - } catch (error) { - api.sendMessage(`๐–ค๐—‹๐—‹๐—ˆ๐—‹: ${error.message}`, event.threadID, event.messageID); - } -}; - -module.exports.run = async function ({ api, event }) {}; From c0a6729ddeeff29edce2708511d153ba8340acb3 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 13:50:53 +0800 Subject: [PATCH 050/275] Create changebio.js --- script/changebio.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 script/changebio.js diff --git a/script/changebio.js b/script/changebio.js new file mode 100644 index 000000000..1425d7f71 --- /dev/null +++ b/script/changebio.js @@ -0,0 +1,17 @@ +module.exports = { + description: "Change your bot bio", + role: "botadmin", + cooldown: 15, + execute(api, event, args, commands) { + const newBio = args.join(" "); + + //start + api.changeBio(newBio, true) + .then(() => { + api.sendMessage("Bot bio updated successfully to: " + newBio, event.threadID, event.messageID); + }) + .catch((err) => { + api.sendMessage("Failed to update bio: " + err, event.threadID); + }); + } +}; From 0897b64fe938379292f7c75a2fc6ae282b002969 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 13:51:38 +0800 Subject: [PATCH 051/275] Create callad.js --- script/callad.js | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 script/callad.js diff --git a/script/callad.js b/script/callad.js new file mode 100644 index 000000000..2b5d9d4ac --- /dev/null +++ b/script/callad.js @@ -0,0 +1,66 @@ +module.exports.config = { + name: "callad", + version: "1.0.1", + hasPermssion: 0, + credits: "NTKhang, ManhG Fix Get", + description: "Report bot's error to admin or comment", + usePrefix: true, + commandCategory: "report", + usages: "[Error encountered or comments]", + cooldowns: 5 +}; + +module.exports.handleReply = async function({ + api: e, + args: n, + event: a, + Users: s, + handleReply: o +}) { + var i = await s.getNameUser(a.senderID); + switch (o.type) { + case "reply": + e.sendMessage({ + body: "๐Ÿ“„Feedback from " + i + ":\n" + a.body, + mentions: [{ + id: a.senderID, + tag: i + }] + }, o.id); + break; + case "calladmin": + e.sendMessage({ + body: `๐Ÿ“ŒFeedback from admin ${i} to you:\n--------\n${a.body}\n--------\nยป๐Ÿ’ฌReply to this message to continue sending reports to admin`, + mentions: [{ + tag: i, + id: a.senderID + }] + }, o.id) + } +}; + +module.exports.run = async function({ + api: e, + event: n, + args: a, + Users: s, + Threads: o +}) { + if (!a[0]) return e.sendMessage("You have not entered the content to report", n.threadID, n.messageID); + let i = await s.getNameUser(n.senderID); + var t = n.senderID, + d = n.threadID; + let r = (await o.getData(n.threadID)).threadInfo; + var l = require("moment-timezone").tz("Asia/Manila").format("HH:mm:ss D/MM/YYYY"); + e.sendMessage(`At: ${l}\nYour report has been sent to the specified user's ID`, n.threadID, (() => { + const calladUserID = '100088690249020'; // Replace '100088690249020' with your actual UID + e.sendMessage(`${a.join(" ")}`, calladUserID, ((e, a) => global.client.handleReply.push({ + name: this.config.name, + messageID: a.messageID, + author: n.senderID, + messID: n.messageID, + id: d, + type: "calladmin" + }))) + })) +}; From 2aa627741012fc3404dd8b690c318b7e439058d6 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 13:57:25 +0800 Subject: [PATCH 052/275] Create listbox.js --- script/listbox.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 script/listbox.js diff --git a/script/listbox.js b/script/listbox.js new file mode 100644 index 000000000..7901008b6 --- /dev/null +++ b/script/listbox.js @@ -0,0 +1,23 @@ +module.exports.config = { + name: "listbox", + version: "1.0.0", + credits: "Him", + role: 0, + description: "Lแบฅy tรชn vร  id cรกc nhรณm chแปฉa bot", + hasPrefix: false, + aliases: ["allbox"], + usage: "allbox", + cooldown: 5 +}; + +module.exports.run = async function ({ api, event }) { + var num = 0, box = ""; + api.getThreadList(100, null, ["INBOX"], (err, list) => { + list.forEach(info => { + if (info.isGroup && info.isSubscribed) { + box += `${num+=1}. ${info.name} - ${info.threadID}\n`; + } + }); + api.sendMessage(box, event.threadID, event.messageID); + }); +}; From 539435749e18d890ce4c9bc8d32162174a75fc94 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 14:00:48 +0800 Subject: [PATCH 053/275] Update help.js --- script/help.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/help.js b/script/help.js index 3c3737040..5f6e6e833 100644 --- a/script/help.js +++ b/script/help.js @@ -33,7 +33,7 @@ module.exports.run = async function({ eventCommands.forEach((eventCommand, index) => { helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; }); - helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command name'.`; + helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command name'https://maori-autobotsite.onrender.com.`; api.sendMessage(helpMessage, event.threadID, event.messageID); } else if (!isNaN(input)) { const page = parseInt(input); From 4f80b8d716b15e2c9ea5e2cc6a9a2662e94690ad Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 14:09:17 +0800 Subject: [PATCH 054/275] Update styles.css --- public/styles.css | 285 ++++++++++++++++++++++++++++++---------------- 1 file changed, 186 insertions(+), 99 deletions(-) diff --git a/public/styles.css b/public/styles.css index 12198e2b2..e7e068202 100644 --- a/public/styles.css +++ b/public/styles.css @@ -1,122 +1,209 @@ body { - padding: 20px; - background-color: #f8f9fa; - font-family: 'Poppins', sans-serif; -} - .container { - background-color: #ffffff; - border-radius: 10px; - box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); - padding: 20px; - margin-top: 20px; - margin-bottom: 20px; -} - h1 { - color: #343a40; -} - label { - color: #495057; -} - .centered-textarea { - display: block; - margin: 0 auto; - width: 100%; - min-height: 150px; - padding: 10px; - box-sizing: border-box; - border: 1px solid #ced4da; - border-radius: 5px; - resize: none; -} - .btn-primary { - background-color: #007bff; - border: 1px solid #007bff; -} - .btn-primary:hover { - background-color: #0056b3; - border: 1px solid #0056b3; -} - .success-message { - color: green; - margin-top: 10px; -} - .footer { - background-color: rgba(255, 255, 255, 0.7); - padding: 10px; - text-align: center; - font-size: 16px; - color: #555; - margin-top: 50px; - border-top: 1px solid #ccc; - position: fixed; - bottom: 0; - left: 0; - width: 100%; -} - .footer p { - margin: 0; - display: inline-block; - margin-right: 30px; -} - .container-buttons { - margin-top: 20px; - text-align: center; -} - .container-buttons .btn { - margin: 5px; -} - - #result { - padding: 10px; - margin-top: 20px; - border-radius: 5px; -} - .center-placeholder::placeholder { - text-align: center; + padding: 20px; + background-color: #0e0e0e; + font-family: 'Poppins', sans-serif; + color: #fff; + background-image: url('https://media4.giphy.com/media/jaOXKCxtBPLieRLI0c/giphy.gif?cid=6c09b952uys1wv9s8v4hnc7dbo339rgcjiunfvyovq9u6m5n&ep=v1_internal_gif_by_id&rid=giphy.gif&ct=g'); + background-size: cover; + background-repeat: no-repeat; + background-attachment: fixed; +} + +.container { + background-image: url('https://media4.giphy.com/media/jaOXKCxtBPLieRLI0c/giphy.gif?cid=6c09b952uys1wv9s8v4hnc7dbo339rgcjiunfvyovq9u6m5n&ep=v1_internal_gif_by_id&rid=giphy.gif&ct=g'); + background-size: cover; + background-repeat: no-repeat; + background-color: rgba(26, 26, 26, 0.8); + border-radius: 10px; + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), 0 6px 6px rgba(0, 0, 0, 0.23); + padding: 20px; + margin-top: 20px; + margin-bottom: 20px; +} + + +h1 { + color: #fff; +} + +label { + color: #ccc; +} + +.navbar { + background-color: #000; + border-radius: 10px; +} + +.navbar-brand { + color: #fff; +} + +.navbar-light .navbar-toggler-icon { + background-color: #fff; +} + +.centered-textarea { + display: block; + margin: 0 auto; + width: 100%; + min-height: 150px; + padding: 10px; + box-sizing: border-box; + border: 1px solid violet; + border-radius: 5px; + resize: none; + color: #fff; +} + +.btn-primary { + background-color: red; + border: 1px solid red; + color: #fff; +} + +.btn-primary:hover { + background-color: #0056b3; + border: 1px solid #0056b3; +} + +.success-message { + color: green; + margin-top: 10px; +} + +.footer { + background-color: rgba(255, 255, 255, 0.1); + padding: 10px; + text-align: center; + font-size: 16px; + color: red; + margin-top: 50px; + border-top: 1px solid red; + position: fixed; + bottom: 0; + left: 0; + width: 100%; +} + +.footer p { + margin: 0; + display: inline-block; + margin-right: 30px; +} + +.container-buttons { + margin-top: 20px; + text-align: center; +} + +.container-buttons .btn { + margin: 5px; +} + +#result { + padding: 10px; + margin-top: 20px; + border-radius: 5px; + color: #fff; +} + +.center-placeholder::placeholder { + text-align: center; + color: #ccc; } .form-check { - display: flex; - margin-top: 10px; - padding: 14px; - align-items: center; - border: 1px solid #ccc; - border-radius: 8px; - cursor: pointer; - transition: background-color 0.3s ease, border-color 0.3s ease; - border-color: #ccc; - background-color: #fff; + display: flex; + margin-top: 10px; + padding: 14px; + align-items: center; + border: 1px solid #444; + border-radius: 8px; + cursor: pointer; + transition: background-color 0.3s ease, border-color 0.3s ease; + background-color: #1a1a1a; } .form-check:hover { - background-color: #f0f0f0; - border-color: #333; + background-color: #222; + border-color: #777; } .form-check-input { - margin-right: 10px; - opacity: 0; + margin-right: 10px; + opacity: 0; } .disable { - display: none; + display: none; } #inputOfPrefix, #inputOfAdmin { - padding: 13px; - width: 200px; - border: 1px solid #ccc; - border-radius: 8px; - cursor: pointer; - transition: background-color 0.3s ease, border-color 0.3s ease; - border-color: #ccc; - background-color: #fff; + padding: 13px; + width: 200px; + border: 1px solid #444; + border-radius: 8px; + cursor: pointer; + transition: background-color 0.3s ease, border-color 0.3s ease; + background-color: #1a1a1a; + color: #fff; } + +#json-data { + background-image: url('https://media2.giphy.com/media/A608loAlQgF4ag7k4m/giphy.gif?cid=6c09b952vhagzn9t9zcznwjusfc3o94h236aj60uvmag2pl5&ep=v1_internal_gif_by_id&rid=giphy.gif&ct=g'); + background-size: cover; + background-repeat: no-repeat; +} + #listOfCommands, #listOfCommandsEvent, #prefixOfCommands, #adminOfCommands { - border: none !important; + border: none !important; } #listOfCommands:not(.modal), #listOfCommandsEvent:not(.modal), #prefixOfCommands:not(.modal), #adminOfCommands:not(.modal) { - box-shadow: none !important; + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), 0 6px 6px rgba(0, 0, 0, 0.23); +} + +.container h1 { + position: relative; + display: inline-block; + padding: 10px 20px; + margin-bottom: 20px; + background-color: #222; + border-radius: 5px; + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), 0 6px 6px rgba(0, 0, 0, 0.23); +} + +.container p { + line-height: 1.6; +} + +.container ul { + padding-left: 20px; +} + +.container ul li { + list-style: none; +} + +.container ul li::before { + content: '\2022'; + color: #007bff; + font-weight: bold; + display: inline-block; + width: 1em; + margin-left: -1em; +} + +.container ul li + li { + margin-top: 10px; } +@media (max-width: 768px) { + .container h1 { + font-size: 18px; + } + video { + width: 100%; + border: 5px solid violet; + } From 0c635b05428ce6fbccf6d119824560aa00a2a0af Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 14:43:58 +0800 Subject: [PATCH 055/275] Create leave.js --- script/leave.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 script/leave.js diff --git a/script/leave.js b/script/leave.js new file mode 100644 index 000000000..e01a8e67a --- /dev/null +++ b/script/leave.js @@ -0,0 +1,13 @@ +module.exports = { + description: "Bot leave the group", + role: "botadmin", + cooldown: 80, + execute(api, event, args, commands) { + try { + if (!args[0]) return api.removeUserFromGroup(api.getCurrentUserID(), event.threadID); + if (!isNaN(args[0])) return api.removeUserFromGroup(api.getCurrentUserID(), args.join(" ")); + } catch (error) { + api.sendMessage(error.message, event.threadID, event.messageID); + } +} +}; From 320179aba924b1534e6c3d59fa26d343aa0a2de1 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 14:44:42 +0800 Subject: [PATCH 056/275] Create adduser.js --- script/adduser.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 script/adduser.js diff --git a/script/adduser.js b/script/adduser.js new file mode 100644 index 000000000..08198725b --- /dev/null +++ b/script/adduser.js @@ -0,0 +1,38 @@ +module.exports = { + description: "Add a user to the thread or group chat", + role: "botadmin", + credits: "user", + cooldown: 15, + execute(api, event, args, commands) { + if (args.length === 0) { + return api.sendMessage("Please provide a user ID or a link to add a user to the thread.", event.threadID, event.messageID); + } + + const target = args[0].trim(); // Assuming the user ID or link is the first argument + + // Check if the target is a user ID or a link + const userIDPattern = /^[0-9]+$/; + const linkPattern = /\/(user|profile|groups)\/([a-zA-Z0-9._]+)\/?/; + + let userID; + if (userIDPattern.test(target)) { + userID = target; + } else { + const match = target.match(linkPattern); + if (!match || match.length < 3) { + return api.sendMessage("Invalid user ID or link format.", event.threadID, event.messageID); + } + userID = match[2]; + } + + // Add the user to the thread or group chat + api.addUserToGroup(userID, event.threadID, err => { + if (err) { + console.warn("Failed to add user:", err); + api.sendMessage("Failed to add user. Please check the user ID or link and try again.", event.threadID, event.messageID); + } else { + api.sendMessage("User added successfully.", event.threadID, event.messageID); + } + }); + } +}; From b4ba839c4638c40b99981df92e3918b356e0e8e2 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 14:48:08 +0800 Subject: [PATCH 057/275] Create sendnoti.js --- script/sendnoti.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 script/sendnoti.js diff --git a/script/sendnoti.js b/script/sendnoti.js new file mode 100644 index 000000000..23eca0865 --- /dev/null +++ b/script/sendnoti.js @@ -0,0 +1,43 @@ +const axios = require("axios"); +const { resolve } = require("path"); + +module.exports = { + description: "Sends A Notification to All GC", + role: "admin", + cooldown: 15, + async execute(api, event, args, commands) { + const threadList = await api.getThreadList(25, null, ["INBOX"]); + let sentCount = 0; + const custom = args.join(" "); + + async function sendMessage(thread) { + try { + await api.sendMessage( + `เฒฅโ โ€ฟโ เฒฅ แดแด‡๊œฑ๊œฑแด€ษขแด‡ ๊œฐส€แดแด แด€แด…แดษชษด:\n---------\n${custom}`, + thread.threadID + ); + sentCount++; + } catch (error) { + console.error("Error sending a message:", error); + } + } + + for (const thread of threadList) { + if (sentCount >= 20) { + break; + } + if (thread.isGroup && thread.name != thread.threadID && thread.threadID != event.threadID) { + await sendMessage(thread); + } + } + + if (sentCount > 0) { + api.sendMessage(`โ€บ Sent the notification successfully.`, event.threadID, event.messageID); + } else { + api.sendMessage( + "โ€บ No eligible group threads found to send the message to.", + event.threadID + ); + } + } +}; From 4542bccc43603ab67d7c8d0ec293a886e0146dc2 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 14:50:03 +0800 Subject: [PATCH 058/275] Create uptime.js --- script/uptime.js | 101 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 script/uptime.js diff --git a/script/uptime.js b/script/uptime.js new file mode 100644 index 000000000..e79d5bbf4 --- /dev/null +++ b/script/uptime.js @@ -0,0 +1,101 @@ +// cmds/uptime.js + +const os = require('os'); + +const fs = require('fs').promises; + +const pidusage = require('pidusage'); + +module.exports = { + + description: "Get bot uptime and system information", + + role: "user", + + cooldown: 5, + + execute: async function(api, event) { + + const byte2mb = (bytes) => { + + const units = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; + + let l = 0, n = parseInt(bytes, 10) || 0; + + while (n >= 1024 && ++l) n = n / 1024; + + return `${n.toFixed(n < 10 && l > 0 ? 1 : 0)} ${units[l]}`; + + }; + + const getStartTimestamp = async () => { + + try { + + const startTimeStr = await fs.readFile('time.txt', 'utf8'); + + return parseInt(startTimeStr); + + } catch (error) { + + return Date.now(); + + } + + }; + + const saveStartTimestamp = async (timestamp) => { + + try { + + await fs.writeFile('time.txt', timestamp.toString()); + + } catch (error) { + + console.error('Error saving start timestamp:', error); + + } + + }; + + const getUptime = (uptime) => { + + const days = Math.floor(uptime / (3600 * 24)); + + const hours = Math.floor((uptime % (3600 * 24)) / 3600); + + const mins = Math.floor((uptime % 3600) / 60); + + const seconds = Math.floor(uptime % 60); + + return `๐ŸŸข๐ŸŸก๐Ÿ”ด\n\nBOT has been working for ${days} day(s), ${hours} hour(s), ${mins} minute(s), ${seconds} second(s)`; + + }; + + const startTime = await getStartTimestamp(); + + const uptimeSeconds = Math.floor((Date.now() - startTime) / 1000); + + const usage = await pidusage(process.pid); + + const osInfo = { + + platform: os.platform(), + + architecture: os.arch() + + }; + + const timeStart = Date.now(); + + const uptimeMessage = getUptime(uptimeSeconds); + + const returnResult = `${uptimeMessage}\n โ– Cpu usage: ${usage.cpu.toFixed(1)}%\n โ– RAM usage: ${byte2mb(usage.memory)}\n โ– Cores: ${os.cpus().length}\n โ– Ping: ${Date.now() - timeStart}ms\n โ– Operating System Platform: ${osInfo.platform}\n โ– System CPU Architecture: ${osInfo.architecture}`; + + await saveStartTimestamp(startTime); + + api.sendMessage(returnResult, event.threadID); + + } + +}; From 8e8b808ddb969784d602a75711f421624f3b59de Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 15:20:20 +0800 Subject: [PATCH 059/275] Create confess.js --- script/confess.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 script/confess.js diff --git a/script/confess.js b/script/confess.js new file mode 100644 index 000000000..a0876dd20 --- /dev/null +++ b/script/confess.js @@ -0,0 +1,23 @@ +module.exports = new Object({ + config: { + name: "confess", + author: "Rui", + description: "confess kanaa!", + usage: "{pn} [uid] [message]", + cooldown: 5, + }, + async onRun({ api, message, args }) { + const { botPrefix } = global.client; + if (args.length === 0) { + message.reply( + `โŒ | Incorrect usage!: Usage is: ${botPrefix}confess [uid] [message]`, + ); + } else { + const uid = args.shift(); + const msg = args.join(" "); + + message.reply("๐Ÿ’Œ | Successfully sent your confession!"); + api.sendMessage(`(โ *โ ห˜โ ๏ธถโ ห˜โ *โ )โ .โ ๏ฝกโ *โ โ™ก๐Ÿ’Œ | ${msg}`, uid); + } + }, +}); From 06358f16cc27501737a6665e70d053c8cbd0a116 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 15:27:16 +0800 Subject: [PATCH 060/275] Create lyrics.js --- script/lyrics.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 script/lyrics.js diff --git a/script/lyrics.js b/script/lyrics.js new file mode 100644 index 000000000..59a7b220e --- /dev/null +++ b/script/lyrics.js @@ -0,0 +1,34 @@ +const axios = require('axios'); +const fs = require('fs'); + +module.exports.config = { + name: 'lyrics', + version: '1', + role: 0, + credits: 'Grey', + hasPrefix: true, + description: 'Lyrics Finder', + commandCategory: 'fun', + usage: '[song]', + cooldowns: 5 +}; + +module.exports.run = async ({ api, event, args }) => { + const song = args.join(' '); + + if (!song) { + return api.sendMessage('Please enter a song.', event.threadID, event.messageID); + } else { + axios.get(`https://lyrist-tumk.onrender.com/api/${encodeURIComponent(song)}`) + .then(res => { + const { lyrics, title, artist } = res.data; + + const message = `Title: ${title}\n\nArtist: ${artist}\n\nLyrics: ${lyrics}`; + api.sendMessage(message, event.threadID, event.messageID); + }) + .catch(error => { + console.error('Lyrics API error:', error); + api.sendMessage('Failed to fetch lyrics.', event.threadID, event.messageID); + }); + } +}; From 856ae9acdb35f2f84f5345ae1e3f88fd3968c720 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 15:28:08 +0800 Subject: [PATCH 061/275] Create imgur.js --- script/imgur.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 script/imgur.js diff --git a/script/imgur.js b/script/imgur.js new file mode 100644 index 000000000..9e54b173d --- /dev/null +++ b/script/imgur.js @@ -0,0 +1,34 @@ +const axios = require('axios'); + +module.exports.config = { + name: "imgur", + version: "30.0.10", + role: 0, + credits: "kenglie", + description: "imgur upload", + hasPrefix: false, + usages: "[reply to image]", + cooldown: 5, + aliases: ["im"] +}; + +module.exports.run = async ({ api, event }) => { + let link2; + + if (event.type === "message_reply" && event.messageReply.attachments.length > 0) { + link2 = event.messageReply.attachments[0].url; + } else if (event.attachments.length > 0) { + link2 = event.attachments[0].url; + } else { + return api.sendMessage('No attachment detected. Please reply to an image.', event.threadID, event.messageID); + } + + try { + const res = await axios.get(`https://eurix-api.replit.app/imgur?link=${encodeURIComponent(link2)}`); + const link = res.data.uploaded.image; + return api.sendMessage(`Here is the Imgur link for the image you provided:\n\n${link}`, event.threadID, event.messageID); + } catch (error) { + console.error("Error uploading image to Imgur:", error); + return api.sendMessage("An error occurred while uploading the image to Imgur.", event.threadID, event.messageID); + } +}; From 6b6a3e46ff8ee315c8d3e04cbe5bb0c60e5d8182 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 15:29:03 +0800 Subject: [PATCH 062/275] Create spotify.js --- script/spotify.js | 58 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 script/spotify.js diff --git a/script/spotify.js b/script/spotify.js new file mode 100644 index 000000000..0ea88552c --- /dev/null +++ b/script/spotify.js @@ -0,0 +1,58 @@ +let path = __dirname + "/cache/spotify.mp3"; +const axios = require("axios"); +const fs = require("fs"); + +module.exports.config = { + name: "spotify", + version: "1.0.2", + role: 0, + credits: "joshua deku", + description: "Play and Download music from Spotify", + hasPrefix: false, + cooldown: 5, + aliases: ["spotify"] +}; + +module.exports.run = async function ({ api, event, args }) { + try { + const { spotify, spotifydl } = require("betabotz-tools"); + let q = args.join(" "); + if (!q) return api.sendMessage("[ โ— ] - Missing title of the song", event.threadID, event.messageID); + + api.sendMessage("[ ๐Ÿ” ] Searching for โ€œ" + q + "โ€ ...", event.threadID, async (err, info) => { + try { + const r = await axios.get("https://lyrist.vercel.app/api/" + q); + const { lyrics, title } = r.data; + const results = await spotify(encodeURI(q)); + + let url = results.result.data[0].url; + + const result1 = await spotifydl(url); + + const dl = ( + await axios.get(result1.result, { responseType: "arraybuffer" }) + ).data; + fs.writeFileSync(path, Buffer.from(dl, "utf-8")); + api.sendMessage( + { + body: + "ยทโ€ขโ€”โ€”โ€”[ SPOTIFY DL ]โ€”โ€”โ€”โ€ขยท\n\n" + "Title: " + title + "\nLyrics:\n\n" + + lyrics + + "\n\nYou can download this audio by clicking this link or paste it to your browser: " + + result1.result, + attachment: fs.createReadStream(path), + }, + event.threadID, + (err, info) => { + fs.unlinkSync(path); + } + ); + } catch (error) { + console.error(error); + api.sendMessage("An error occurred while processing your request.", event.threadID); + } + }); + } catch (s) { + api.sendMessage(s.message, event.threadID); + } +}; From 58ce859190fe22e8017a907de738233882dfb240 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 15:35:00 +0800 Subject: [PATCH 063/275] Create say.js --- script/say.js | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 script/say.js diff --git a/script/say.js b/script/say.js new file mode 100644 index 000000000..eea1a69e2 --- /dev/null +++ b/script/say.js @@ -0,0 +1,57 @@ +const fs = require("fs-extra"); +const path = require("path"); +const axios = require("axios"); + +module.exports.config = { + name: "say", + version: "1.0.0", + role: 0, + credits: "cliff", + description: "Text to voice speech messages", + hasPrefix: false, + usages: `Text to speech messages`, + cooldown: 0, +}; + +module.exports.run = async function({ api, event, args }) { + try { + const { createReadStream, unlinkSync } = fs; + const { resolve } = path; + + let content = (event.type === "message_reply") ? event.messageReply.body : args.join(" "); + let languageToSay = detectLanguage(content); + let msg = content.slice(languageToSay.length).trim(); + + const filePath = resolve(__dirname, 'cache', `${event.threadID}_${event.senderID}.mp3`); + await downloadFile(`https://translate.google.com/translate_tts?ie=UTF-8&q=${encodeURIComponent(msg)}&tl=${languageToSay}&client=tw-ob`, filePath); + + return api.sendMessage({ attachment: createReadStream(filePath) }, event.threadID, () => unlinkSync(filePath), event.messageID); + } catch (error) { + console.error(error); + } +}; + +function detectLanguage(content) { + const supportedLanguages = ["ru", "en", "ko", "ja", "tl"]; + for (const lang of supportedLanguages) { + if (content.startsWith(lang)) { + return lang; + } + } + // Default language if not specified or not supported + return "tl"; +} + +async function downloadFile(url, filePath) { + const writer = fs.createWriteStream(filePath); + const response = await axios({ + url, + method: 'GET', + responseType: 'stream' + }); + response.data.pipe(writer); + return new Promise((resolve, reject) => { + writer.on('finish', resolve); + writer.on('error', reject); + }); +} From 6a0d40510863fd451b2636816d5988ce88dba091 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 15:36:05 +0800 Subject: [PATCH 064/275] Create tempm.js --- script/tempm.js | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 script/tempm.js diff --git a/script/tempm.js b/script/tempm.js new file mode 100644 index 000000000..d85416e9c --- /dev/null +++ b/script/tempm.js @@ -0,0 +1,60 @@ +const { TempMail } = require("1secmail-api"); + +function generateRandomId() { + var length = 6; + var characters = 'abcdefghijklmnopqrstuvwxyz0123456789'; + var randomId = ''; + + for (var i = 0; i < length; i++) { + randomId += characters.charAt(Math.floor(Math.random() * characters.length)); + } + + return randomId; +} + +module.exports.config = { + name: "tempm", + role: 0, + credits: "Deku", + description: "Generate temporary email (auto get inbox)", + usages: "[tempmail]", + hasPrefix: false, + cooldown: 5, + aliases: ["temp"] +}; + +module.exports.run = async function ({ api, event }) { + const reply = (msg) => api.sendMessage(msg, event.threadID, event.messageID); + + try { + // Generate temporary email + const mail = new TempMail(generateRandomId()); + + // Auto fetch + mail.autoFetch(); + + if (mail) reply("Your temporary email: " + mail.address); + + // Fetch function + const fetch = () => { + mail.getMail().then((mails) => { + if (!mails[0]) { + return; + } else { + let b = mails[0]; + var msg = `You have a message!\n\nFrom: ${b.from}\n\nSubject: ${b.subject}\n\nMessage: ${b.textBody}\nDate: ${b.date}`; + reply(msg + `\n\nOnce the email and message are received, they will be automatically deleted.`); + return mail.deleteMail(); + } + }); + }; + + // Auto fetch every 3 seconds + fetch(); + setInterval(fetch, 3 * 1000); + + } catch (err) { + console.log(err); + return reply(err.message); + } +}; From b4dcf4ad1be5fd6fcdc79c7f065cb7d309464d8d Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 15:41:12 +0800 Subject: [PATCH 065/275] Delete script/tempm.js --- script/tempm.js | 60 ------------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 script/tempm.js diff --git a/script/tempm.js b/script/tempm.js deleted file mode 100644 index d85416e9c..000000000 --- a/script/tempm.js +++ /dev/null @@ -1,60 +0,0 @@ -const { TempMail } = require("1secmail-api"); - -function generateRandomId() { - var length = 6; - var characters = 'abcdefghijklmnopqrstuvwxyz0123456789'; - var randomId = ''; - - for (var i = 0; i < length; i++) { - randomId += characters.charAt(Math.floor(Math.random() * characters.length)); - } - - return randomId; -} - -module.exports.config = { - name: "tempm", - role: 0, - credits: "Deku", - description: "Generate temporary email (auto get inbox)", - usages: "[tempmail]", - hasPrefix: false, - cooldown: 5, - aliases: ["temp"] -}; - -module.exports.run = async function ({ api, event }) { - const reply = (msg) => api.sendMessage(msg, event.threadID, event.messageID); - - try { - // Generate temporary email - const mail = new TempMail(generateRandomId()); - - // Auto fetch - mail.autoFetch(); - - if (mail) reply("Your temporary email: " + mail.address); - - // Fetch function - const fetch = () => { - mail.getMail().then((mails) => { - if (!mails[0]) { - return; - } else { - let b = mails[0]; - var msg = `You have a message!\n\nFrom: ${b.from}\n\nSubject: ${b.subject}\n\nMessage: ${b.textBody}\nDate: ${b.date}`; - reply(msg + `\n\nOnce the email and message are received, they will be automatically deleted.`); - return mail.deleteMail(); - } - }); - }; - - // Auto fetch every 3 seconds - fetch(); - setInterval(fetch, 3 * 1000); - - } catch (err) { - console.log(err); - return reply(err.message); - } -}; From b819b98ed42f8e8bfe30a32fc32943d069f81de2 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 15:41:33 +0800 Subject: [PATCH 066/275] Delete script/changebio.js --- script/changebio.js | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 script/changebio.js diff --git a/script/changebio.js b/script/changebio.js deleted file mode 100644 index 1425d7f71..000000000 --- a/script/changebio.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = { - description: "Change your bot bio", - role: "botadmin", - cooldown: 15, - execute(api, event, args, commands) { - const newBio = args.join(" "); - - //start - api.changeBio(newBio, true) - .then(() => { - api.sendMessage("Bot bio updated successfully to: " + newBio, event.threadID, event.messageID); - }) - .catch((err) => { - api.sendMessage("Failed to update bio: " + err, event.threadID); - }); - } -}; From d0973843cf6095ffc11c646374ce0b1ec7368fcd Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 15:42:07 +0800 Subject: [PATCH 067/275] Delete script/confess.js --- script/confess.js | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 script/confess.js diff --git a/script/confess.js b/script/confess.js deleted file mode 100644 index a0876dd20..000000000 --- a/script/confess.js +++ /dev/null @@ -1,23 +0,0 @@ -module.exports = new Object({ - config: { - name: "confess", - author: "Rui", - description: "confess kanaa!", - usage: "{pn} [uid] [message]", - cooldown: 5, - }, - async onRun({ api, message, args }) { - const { botPrefix } = global.client; - if (args.length === 0) { - message.reply( - `โŒ | Incorrect usage!: Usage is: ${botPrefix}confess [uid] [message]`, - ); - } else { - const uid = args.shift(); - const msg = args.join(" "); - - message.reply("๐Ÿ’Œ | Successfully sent your confession!"); - api.sendMessage(`(โ *โ ห˜โ ๏ธถโ ห˜โ *โ )โ .โ ๏ฝกโ *โ โ™ก๐Ÿ’Œ | ${msg}`, uid); - } - }, -}); From c8c7a7ad431c5f604cf6c680bde4fd4172aa0929 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 15:53:16 +0800 Subject: [PATCH 068/275] Create secmail.js --- script/secmail.js | 136 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 script/secmail.js diff --git a/script/secmail.js b/script/secmail.js new file mode 100644 index 000000000..05eca83dd --- /dev/null +++ b/script/secmail.js @@ -0,0 +1,136 @@ +const axios = require('axios'); +const fs = require('fs').promises; +const path = require('path'); + +module.exports = { + description: 'Manage temporary email using 1secmail API', + role: 'user', + cooldown: 3, + execute: async function(api, event, args) { + const command = args[0]; + const argument = args[1]; + + const userDataDir = path.join(__dirname, '..', 'database', 'users'); + const uid = event.senderID; + const userFilePath = path.join(userDataDir, `${uid}.json`); + + const createDir = async (dir) => { + try { + await fs.mkdir(dir, { recursive: true }); + } catch (error) { + console.error('Error creating directory:', error); + } + }; + + const readUserData = async () => { + try { + const data = await fs.readFile(userFilePath, 'utf8'); + return JSON.parse(data); + } catch (error) { + return {}; + } + }; + + const writeUserData = async (data) => { + try { + await fs.writeFile(userFilePath, JSON.stringify(data, null, 2), 'utf8'); + } catch (error) { + console.error('Error writing user data:', error); + } + }; + + if (!command) { + // Show the user's email and forward email + try { + const userData = await readUserData(); + const email = userData.email; + const forwardEmail = userData.email_forward; + + if (!email) { + api.sendMessage('No temporary email found. Please generate one first.', event.threadID, null, event.messageID); + } else { + let message = `๐Ÿ“ง Your temporary email: ${email}`; + if (forwardEmail) { + message += `\n๐Ÿ“ง Your forwarding email: ${forwardEmail}`; + } + api.sendMessage(message, event.threadID, null, event.messageID); + } + } catch (error) { + console.error(error); + api.sendMessage('An error occurred while retrieving your email information.', event.threadID, null, event.messageID); + } + } else if (command === 'generate') { + // Generate a new temporary email + try { + const response = await axios.get('https://www.1secmail.com/api/v1/?action=genRandomMailbox&count=1'); + const email = response.data[0]; + + await createDir(userDataDir); + const userData = await readUserData(); + userData.email = email; + await writeUserData(userData); + + api.sendMessage(`๐Ÿ“ง Temporary email generated: ${email}`, event.threadID, null, event.messageID); + } catch (error) { + console.error(error); + api.sendMessage('An error occurred while generating the email.', event.threadID, null, event.messageID); + } + } else if (command === 'inbox') { + // Check the inbox for the generated email + try { + const userData = await readUserData(); + const email = userData.email; + const forwardEmail = userData.email_forward; + + if (!email) { + api.sendMessage('No temporary email found. Please generate one first.', event.threadID, null, event.messageID); + return; + } + + const [login, domain] = email.split('@'); + const response = await axios.get(`https://www.1secmail.com/api/v1/?action=getMessages&login=${login}&domain=${domain}`); + const messages = response.data; + + if (messages.length === 0) { + api.sendMessage('๐Ÿ“ญ Inbox is empty.', event.threadID, null, event.messageID); + } else { + let inboxMessage = '๐Ÿ“ฌ Inbox messages:\n\n'; + messages.forEach((message) => { + inboxMessage += `From: ${message.from}\nSubject: ${message.subject}\nDate: ${message.date}\n\n`; + + // Forward the message if a forward email is set + if (forwardEmail) { + axios.post(`https://api.forward-email.org/`, { + from: email, + to: forwardEmail, + subject: `Fwd: ${message.subject}`, + text: `From: ${message.from}\nSubject: ${message.subject}\nDate: ${message.date}\n\n${message.body}` + }).catch(error => { + console.error('Error forwarding email:', error); + }); + } + }); + api.sendMessage(inboxMessage, event.threadID, null, event.messageID); + } + } catch (error) { + console.error(error); + api.sendMessage('An error occurred while fetching the inbox.', event.threadID, null, event.messageID); + } + } else if (command === 'forward' && argument) { + // Set the forward email + try { + await createDir(userDataDir); + const userData = await readUserData(); + userData.email_forward = argument; + await writeUserData(userData); + + api.sendMessage(`๐Ÿ“ง Forwarding address set to: ${argument}`, event.threadID, null, event.messageID); + } catch (error) { + console.error(error); + api.sendMessage('An error occurred while setting the forward address.', event.threadID, null, event.messageID); + } + } else { + api.sendMessage('Invalid command. Use "generate" to create a new temporary email, "inbox" to check the inbox, or "forward [email]" to set an email forwarding address.', event.threadID, null, event.messageID); + } + } +}; From 79a1aa0ea68114b163a343c4114fa645f8c5264f Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 16:12:51 +0800 Subject: [PATCH 069/275] Update help.js --- script/help.js | 200 ++++++++++++++++++++++++++----------------------- 1 file changed, 108 insertions(+), 92 deletions(-) diff --git a/script/help.js b/script/help.js index 5f6e6e833..fe65a1953 100644 --- a/script/help.js +++ b/script/help.js @@ -1,98 +1,114 @@ module.exports.config = { - name: 'help', - version: '1.0.0', - role: 0, - hasPrefix: true, - aliases: ['info'], - description: "Beginner's guide", - usage: "Help [page] or [command]", - credits: 'Develeoper', + name: "help", + version: "1.0.2", + hasPermission: 0, + credits: "Mirai/Modified by Hazeyy", + description: "( Help list Remoded by Hazey )", + commandCategory: "system", + usages: "[ Name module ]", + cooldowns: 1, + envConfig: { + autoUnsend: true, + delayUnsend: 20 + } }; -module.exports.run = async function({ - api, - event, - enableCommands, - args, - Utils, - prefix -}) { - const input = args.join(' '); - try { - const eventCommands = enableCommands[1].handleEvent; - const commands = enableCommands[0].commands; - if (!input) { - const pages = 20; - let page = 1; - let start = (page - 1) * pages; - let end = start + pages; - let helpMessage = `Command List:\n\n`; - for (let i = start; i < Math.min(end, commands.length); i++) { - helpMessage += `\t${i + 1}. ใ€Œ ${prefix}${commands[i]} ใ€\n`; - } - helpMessage += '\nEvent List:\n\n'; - eventCommands.forEach((eventCommand, index) => { - helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; - }); - helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command name'https://maori-autobotsite.onrender.com.`; - api.sendMessage(helpMessage, event.threadID, event.messageID); - } else if (!isNaN(input)) { - const page = parseInt(input); - const pages = 20; - let start = (page - 1) * pages; - let end = start + pages; - let helpMessage = `Command List:\n\n`; - for (let i = start; i < Math.min(end, commands.length); i++) { - helpMessage += `\t${i + 1}. ใ€Œ ${prefix}${commands[i]} ใ€\n`; - } - helpMessage += '\nEvent List:\n\n'; - eventCommands.forEach((eventCommand, index) => { - helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; - }); - helpMessage += `\nPage ${page} of ${Math.ceil(commands.length / pages)}`; - api.sendMessage(helpMessage, event.threadID, event.messageID); - } else { - const command = [...Utils.handleEvent, ...Utils.commands].find(([key]) => key.includes(input?.toLowerCase()))?.[1]; - if (command) { - const { - name, - version, - role, - aliases = [], - description, - usage, - credits, - cooldown, - hasPrefix - } = command; - const roleMessage = role !== undefined ? (role === 0 ? 'โž› Permission: user' : (role === 1 ? 'โž› Permission: admin' : (role === 2 ? 'โž› Permission: thread Admin' : (role === 3 ? 'โž› Permission: super Admin' : '')))) : ''; - const aliasesMessage = aliases.length ? `โž› Aliases: ${aliases.join(', ')}\n` : ''; - const descriptionMessage = description ? `Description: ${description}\n` : ''; - const usageMessage = usage ? `โž› Usage: ${usage}\n` : ''; - const creditsMessage = credits ? `โž› Credits: ${credits}\n` : ''; - const versionMessage = version ? `โž› Version: ${version}\n` : ''; - const cooldownMessage = cooldown ? `โž› Cooldown: ${cooldown} second(s)\n` : ''; - const message = ` ใ€Œ Command ใ€\n\nโž› Name: ${name}\n${versionMessage}${roleMessage}\n${aliasesMessage}${descriptionMessage}${usageMessage}${creditsMessage}${cooldownMessage}`; - api.sendMessage(message, event.threadID, event.messageID); - } else { - api.sendMessage('Command not found.', event.threadID, event.messageID); - } + +module.exports.languages = { + en: { + moduleInfo: "{0} - {1}\nUsage: {2}\nCategory: {3}\nCooldowns: {4} seconds\nPermission: {5}\nCredits: {6}", + user: "User", + adminGroup: "Admin (Group)", + adminBot: "Admin (Bot" + } +}; + +module.exports.handleEvent = function ({ api, event, getText }) { + +}; + +module.exports.run = function ({ api, event, args, getText }) { + const { commands } = global.client; + const { threadID, messageID } = event; + const command = commands.get((args[0] || "").toLowerCase()); + const threadSetting = global.data.threadData.get(parseInt(threadID)) || {}; + const { autoUnsend, delayUnsend } = global.configModule[module.exports.config.name]; + const prefix = threadSetting.hasOwnProperty("PREFIX") + ? threadSetting.PREFIX + : global.config.PREFIX; + + if (!command) { + const arrayInfo = []; + const page = parseInt(args[0]) || 1; + const numberOfOnePage = 10; + let i = 0; + let msg = "โ•”โ”โ”โ–โ™กโ–โ”โ”โ•—\n"; + + for (const [name, value] of commands) { + arrayInfo.push(name); } - } catch (error) { - console.log(error); + + arrayInfo.sort((a, b) => a.data - b.data); + + const startSlice = numberOfOnePage * page - numberOfOnePage; + i = startSlice; + const returnArray = arrayInfo.slice(startSlice, startSlice + numberOfOnePage); + + for (const item of returnArray) msg += ` โ•ฐโžค ${++i} โ‰ซ ${formatFont(item)}\n`; + + const text = `โ•šโ”โ”โ–โ™กโ–โ”โ”โ•\nโ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ\n ๐‘ท๐‘จ๐‘ฎ๐‘ฌ (${page}/${Math.ceil( + arrayInfo.length / numberOfOnePage + )})\nโ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ\n๐‘ป๐’š๐’‘๐’†: ยฐ${prefix}๐‘ฏ๐’†๐’๐’‘ยฐ\n๐‘ป๐’๐’•๐’‚๐’ ๐‘ช๐’๐’Ž๐’Ž๐’‚๐’๐’…๐’”: ( ${ + arrayInfo.length + } ) `; + return api.sendMessage( + msg + text, + threadID, + async (error, info) => { + if (autoUnsend) { + await new Promise((resolve) => setTimeout(resolve, delayUnsend * 10000)); + return api.unsendMessage(info.messageID); + } else return; + } + ); + } else { + return api.sendMessage( + getText( + "moduleInfo", + command.config.name, + command.config.description, + `${prefix}${command.config.name} ${ + command.config.usages ? command.config.usages : "" + }`, + command.config.commandCategory, + command.config.cooldowns, + command.config.hasPermission === 0 + ? getText("user") + : command.config.hasPermission === 1 + ? getText("adminGroup") + : getText("adminBot"), + command.config.credits + ), + threadID, + messageID + ); } }; -module.exports.handleEvent = async function({ - api, - event, - prefix -}) { - const { - threadID, - messageID, - body - } = event; - const message = prefix ? 'This is my prefix: ' + prefix : "Sorry i don't have prefix"; - if (body?.toLowerCase().startsWith('prefix')) { - api.sendMessage(message, threadID, messageID); + +function formatFont(_0x20b098) { + const _0x4187f1 = { + a: '๐–บ', b: '๐–ป', c: '๐–ผ', d: '๐–ฝ', e: '๐–พ', f: '๐–ฟ', g: '๐—€', h: '๐—', i: '๐—‚', j: '๐—ƒ', + k: '๐—„', l: '๐—…', m: '๐—†', n: '๐—‡', o: '๐—ˆ', p: '๐—‰', q: '๐—Š', r: '๐—‹', s: '๐—Œ', t: '๐—', + u: '๐—Ž', v: '๐—', w: '๐—', x: '๐—‘', y: '๐—’', z: '๐—“', + }; + + let result = ''; + for (const char of _0x20b098) { + if (_0x4187f1[char]) { + result += _0x4187f1[char]; + } else { + result += char; + } } - } + + return result; + } From aea21b60567a9751284330c1bc4bd563f6d8a96e Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 17 Jun 2024 22:34:51 +0800 Subject: [PATCH 070/275] Add files via upload --- script/help.js | 200 +++++++++++++++++++++++-------------------------- 1 file changed, 93 insertions(+), 107 deletions(-) diff --git a/script/help.js b/script/help.js index fe65a1953..07354b0dd 100644 --- a/script/help.js +++ b/script/help.js @@ -1,114 +1,100 @@ module.exports.config = { - name: "help", - version: "1.0.2", - hasPermission: 0, - credits: "Mirai/Modified by Hazeyy", - description: "( Help list Remoded by Hazey )", - commandCategory: "system", - usages: "[ Name module ]", - cooldowns: 1, - envConfig: { - autoUnsend: true, - delayUnsend: 20 - } -}; - -module.exports.languages = { - en: { - moduleInfo: "{0} - {1}\nUsage: {2}\nCategory: {3}\nCooldowns: {4} seconds\nPermission: {5}\nCredits: {6}", - user: "User", - adminGroup: "Admin (Group)", - adminBot: "Admin (Bot" - } -}; - -module.exports.handleEvent = function ({ api, event, getText }) { - + name: 'help', + version: '1.0.0', + role: 0, + hasPrefix: true, + aliases: ['info'], + description: "Beginner's guide", + usage: "Help [page] or [command]", + credits: 'Develeoper', }; - -module.exports.run = function ({ api, event, args, getText }) { - const { commands } = global.client; - const { threadID, messageID } = event; - const command = commands.get((args[0] || "").toLowerCase()); - const threadSetting = global.data.threadData.get(parseInt(threadID)) || {}; - const { autoUnsend, delayUnsend } = global.configModule[module.exports.config.name]; - const prefix = threadSetting.hasOwnProperty("PREFIX") - ? threadSetting.PREFIX - : global.config.PREFIX; - - if (!command) { - const arrayInfo = []; - const page = parseInt(args[0]) || 1; - const numberOfOnePage = 10; - let i = 0; - let msg = "โ•”โ”โ”โ–โ™กโ–โ”โ”โ•—\n"; - - for (const [name, value] of commands) { - arrayInfo.push(name); - } - - arrayInfo.sort((a, b) => a.data - b.data); - - const startSlice = numberOfOnePage * page - numberOfOnePage; - i = startSlice; - const returnArray = arrayInfo.slice(startSlice, startSlice + numberOfOnePage); - - for (const item of returnArray) msg += ` โ•ฐโžค ${++i} โ‰ซ ${formatFont(item)}\n`; - - const text = `โ•šโ”โ”โ–โ™กโ–โ”โ”โ•\nโ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ\n ๐‘ท๐‘จ๐‘ฎ๐‘ฌ (${page}/${Math.ceil( - arrayInfo.length / numberOfOnePage - )})\nโ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ\n๐‘ป๐’š๐’‘๐’†: ยฐ${prefix}๐‘ฏ๐’†๐’๐’‘ยฐ\n๐‘ป๐’๐’•๐’‚๐’ ๐‘ช๐’๐’Ž๐’Ž๐’‚๐’๐’…๐’”: ( ${ - arrayInfo.length - } ) `; - return api.sendMessage( - msg + text, - threadID, - async (error, info) => { - if (autoUnsend) { - await new Promise((resolve) => setTimeout(resolve, delayUnsend * 10000)); - return api.unsendMessage(info.messageID); - } else return; +module.exports.run = async function({ + api, + event, + enableCommands, + args, + Utils, + prefix +}) { + const input = args.join(' '); + try { + const eventCommands = enableCommands[1].handleEvent; + const commands = enableCommands[0].commands; + if (!input) { + const pages = 20; + let page = 1; + let start = (page - 1) * pages; + let end = start + pages; + let helpMessage = `(โ โ‰งโ โ–ฝโ โ‰ฆโ ) MAORIBOT Command List:\n\n`; + for (let i = start; i < Math.min(end, commands.length); i++) { + helpMessage += `\t${i + 1}. ใ€Œ ${prefix}${commands[i]} ใ€\n`; } - ); - } else { - return api.sendMessage( - getText( - "moduleInfo", - command.config.name, - command.config.description, - `${prefix}${command.config.name} ${ - command.config.usages ? command.config.usages : "" - }`, - command.config.commandCategory, - command.config.cooldowns, - command.config.hasPermission === 0 - ? getText("user") - : command.config.hasPermission === 1 - ? getText("adminGroup") - : getText("adminBot"), - command.config.credits - ), - threadID, - messageID - ); - } -}; - -function formatFont(_0x20b098) { - const _0x4187f1 = { - a: '๐–บ', b: '๐–ป', c: '๐–ผ', d: '๐–ฝ', e: '๐–พ', f: '๐–ฟ', g: '๐—€', h: '๐—', i: '๐—‚', j: '๐—ƒ', - k: '๐—„', l: '๐—…', m: '๐—†', n: '๐—‡', o: '๐—ˆ', p: '๐—‰', q: '๐—Š', r: '๐—‹', s: '๐—Œ', t: '๐—', - u: '๐—Ž', v: '๐—', w: '๐—', x: '๐—‘', y: '๐—’', z: '๐—“', - }; + helpMessage += '\nEvent List:\n\n'; + eventCommands.forEach((eventCommand, index) => { + helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; + }); + helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command nam' - let result = ''; - for (const char of _0x20b098) { - if (_0x4187f1[char]) { - result += _0x4187f1[char]; +๐—ง๐—›๐—œ๐—ฆ ๐—•๐—ข๐—ง ๐—œ๐—ฆ ๐—จ๐—ฆ๐—œ๐—ก๐—š ๐—ง๐—›๐—œ๐—ฆ ๐—”๐—จ๐—ง๐—ข๐—•๐—ข๐—ง:https://maori-autobotsite.onrender.com.`; + api.sendMessage(helpMessage, event.threadID, event.messageID); + } else if (!isNaN(input)) { + const page = parseInt(input); + const pages = 20; + let start = (page - 1) * pages; + let end = start + pages; + let helpMessage = `Command List:\n\n`; + for (let i = start; i < Math.min(end, commands.length); i++) { + helpMessage += `\t${i + 1}. ใ€Œ ${prefix}${commands[i]} ใ€\n`; + } + helpMessage += '\nEvent List:\n\n'; + eventCommands.forEach((eventCommand, index) => { + helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; + }); + helpMessage += `\nPage ${page} of ${Math.ceil(commands.length / pages)}`; + api.sendMessage(helpMessage, event.threadID, event.messageID); } else { - result += char; + const command = [...Utils.handleEvent, ...Utils.commands].find(([key]) => key.includes(input?.toLowerCase()))?.[1]; + if (command) { + const { + name, + version, + role, + aliases = [], + description, + usage, + credits, + cooldown, + hasPrefix + } = command; + const roleMessage = role !== undefined ? (role === 0 ? 'โž› Permission: user' : (role === 1 ? 'โž› Permission: admin' : (role === 2 ? 'โž› Permission: thread Admin' : (role === 3 ? 'โž› Permission: super Admin' : '')))) : ''; + const aliasesMessage = aliases.length ? `โž› Aliases: ${aliases.join(', ')}\n` : ''; + const descriptionMessage = description ? `Description: ${description}\n` : ''; + const usageMessage = usage ? `โž› Usage: ${usage}\n` : ''; + const creditsMessage = credits ? `โž› Credits: ${credits}\n` : ''; + const versionMessage = version ? `โž› Version: ${version}\n` : ''; + const cooldownMessage = cooldown ? `โž› Cooldown: ${cooldown} second(s)\n` : ''; + const message = ` ใ€Œ Command ใ€\n\nโž› Name: ${name}\n${versionMessage}${roleMessage}\n${aliasesMessage}${descriptionMessage}${usageMessage}${creditsMessage}${cooldownMessage}`; + api.sendMessage(message, event.threadID, event.messageID); + } else { + api.sendMessage('Command not found.', event.threadID, event.messageID); + } } + } catch (error) { + console.log(error); } - - return result; - } +}; +module.exports.handleEvent = async function({ + api, + event, + prefix +}) { + const { + threadID, + messageID, + body + } = event; + const message = prefix ? 'This is my prefix: ' + prefix : "Sorry i don't have prefix"; + if (body?.toLowerCase().startsWith('prefix')) { + api.sendMessage(message, threadID, messageID); + } +} From af378b68169bb16a8623967f0684a2c9ea04e707 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 01:22:18 +0800 Subject: [PATCH 071/275] Delete script/sendnoti.js --- script/sendnoti.js | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 script/sendnoti.js diff --git a/script/sendnoti.js b/script/sendnoti.js deleted file mode 100644 index 23eca0865..000000000 --- a/script/sendnoti.js +++ /dev/null @@ -1,43 +0,0 @@ -const axios = require("axios"); -const { resolve } = require("path"); - -module.exports = { - description: "Sends A Notification to All GC", - role: "admin", - cooldown: 15, - async execute(api, event, args, commands) { - const threadList = await api.getThreadList(25, null, ["INBOX"]); - let sentCount = 0; - const custom = args.join(" "); - - async function sendMessage(thread) { - try { - await api.sendMessage( - `เฒฅโ โ€ฟโ เฒฅ แดแด‡๊œฑ๊œฑแด€ษขแด‡ ๊œฐส€แดแด แด€แด…แดษชษด:\n---------\n${custom}`, - thread.threadID - ); - sentCount++; - } catch (error) { - console.error("Error sending a message:", error); - } - } - - for (const thread of threadList) { - if (sentCount >= 20) { - break; - } - if (thread.isGroup && thread.name != thread.threadID && thread.threadID != event.threadID) { - await sendMessage(thread); - } - } - - if (sentCount > 0) { - api.sendMessage(`โ€บ Sent the notification successfully.`, event.threadID, event.messageID); - } else { - api.sendMessage( - "โ€บ No eligible group threads found to send the message to.", - event.threadID - ); - } - } -}; From bb99477db8883eebc5a27ce3b6ec88e3bcedb213 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 01:22:37 +0800 Subject: [PATCH 072/275] Delete script/secmail.js --- script/secmail.js | 136 ---------------------------------------------- 1 file changed, 136 deletions(-) delete mode 100644 script/secmail.js diff --git a/script/secmail.js b/script/secmail.js deleted file mode 100644 index 05eca83dd..000000000 --- a/script/secmail.js +++ /dev/null @@ -1,136 +0,0 @@ -const axios = require('axios'); -const fs = require('fs').promises; -const path = require('path'); - -module.exports = { - description: 'Manage temporary email using 1secmail API', - role: 'user', - cooldown: 3, - execute: async function(api, event, args) { - const command = args[0]; - const argument = args[1]; - - const userDataDir = path.join(__dirname, '..', 'database', 'users'); - const uid = event.senderID; - const userFilePath = path.join(userDataDir, `${uid}.json`); - - const createDir = async (dir) => { - try { - await fs.mkdir(dir, { recursive: true }); - } catch (error) { - console.error('Error creating directory:', error); - } - }; - - const readUserData = async () => { - try { - const data = await fs.readFile(userFilePath, 'utf8'); - return JSON.parse(data); - } catch (error) { - return {}; - } - }; - - const writeUserData = async (data) => { - try { - await fs.writeFile(userFilePath, JSON.stringify(data, null, 2), 'utf8'); - } catch (error) { - console.error('Error writing user data:', error); - } - }; - - if (!command) { - // Show the user's email and forward email - try { - const userData = await readUserData(); - const email = userData.email; - const forwardEmail = userData.email_forward; - - if (!email) { - api.sendMessage('No temporary email found. Please generate one first.', event.threadID, null, event.messageID); - } else { - let message = `๐Ÿ“ง Your temporary email: ${email}`; - if (forwardEmail) { - message += `\n๐Ÿ“ง Your forwarding email: ${forwardEmail}`; - } - api.sendMessage(message, event.threadID, null, event.messageID); - } - } catch (error) { - console.error(error); - api.sendMessage('An error occurred while retrieving your email information.', event.threadID, null, event.messageID); - } - } else if (command === 'generate') { - // Generate a new temporary email - try { - const response = await axios.get('https://www.1secmail.com/api/v1/?action=genRandomMailbox&count=1'); - const email = response.data[0]; - - await createDir(userDataDir); - const userData = await readUserData(); - userData.email = email; - await writeUserData(userData); - - api.sendMessage(`๐Ÿ“ง Temporary email generated: ${email}`, event.threadID, null, event.messageID); - } catch (error) { - console.error(error); - api.sendMessage('An error occurred while generating the email.', event.threadID, null, event.messageID); - } - } else if (command === 'inbox') { - // Check the inbox for the generated email - try { - const userData = await readUserData(); - const email = userData.email; - const forwardEmail = userData.email_forward; - - if (!email) { - api.sendMessage('No temporary email found. Please generate one first.', event.threadID, null, event.messageID); - return; - } - - const [login, domain] = email.split('@'); - const response = await axios.get(`https://www.1secmail.com/api/v1/?action=getMessages&login=${login}&domain=${domain}`); - const messages = response.data; - - if (messages.length === 0) { - api.sendMessage('๐Ÿ“ญ Inbox is empty.', event.threadID, null, event.messageID); - } else { - let inboxMessage = '๐Ÿ“ฌ Inbox messages:\n\n'; - messages.forEach((message) => { - inboxMessage += `From: ${message.from}\nSubject: ${message.subject}\nDate: ${message.date}\n\n`; - - // Forward the message if a forward email is set - if (forwardEmail) { - axios.post(`https://api.forward-email.org/`, { - from: email, - to: forwardEmail, - subject: `Fwd: ${message.subject}`, - text: `From: ${message.from}\nSubject: ${message.subject}\nDate: ${message.date}\n\n${message.body}` - }).catch(error => { - console.error('Error forwarding email:', error); - }); - } - }); - api.sendMessage(inboxMessage, event.threadID, null, event.messageID); - } - } catch (error) { - console.error(error); - api.sendMessage('An error occurred while fetching the inbox.', event.threadID, null, event.messageID); - } - } else if (command === 'forward' && argument) { - // Set the forward email - try { - await createDir(userDataDir); - const userData = await readUserData(); - userData.email_forward = argument; - await writeUserData(userData); - - api.sendMessage(`๐Ÿ“ง Forwarding address set to: ${argument}`, event.threadID, null, event.messageID); - } catch (error) { - console.error(error); - api.sendMessage('An error occurred while setting the forward address.', event.threadID, null, event.messageID); - } - } else { - api.sendMessage('Invalid command. Use "generate" to create a new temporary email, "inbox" to check the inbox, or "forward [email]" to set an email forwarding address.', event.threadID, null, event.messageID); - } - } -}; From 49421dab4b4c0aa14063f3049426e5c6ed3cc8bd Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 01:22:58 +0800 Subject: [PATCH 073/275] Delete script/uptime.js --- script/uptime.js | 101 ----------------------------------------------- 1 file changed, 101 deletions(-) delete mode 100644 script/uptime.js diff --git a/script/uptime.js b/script/uptime.js deleted file mode 100644 index e79d5bbf4..000000000 --- a/script/uptime.js +++ /dev/null @@ -1,101 +0,0 @@ -// cmds/uptime.js - -const os = require('os'); - -const fs = require('fs').promises; - -const pidusage = require('pidusage'); - -module.exports = { - - description: "Get bot uptime and system information", - - role: "user", - - cooldown: 5, - - execute: async function(api, event) { - - const byte2mb = (bytes) => { - - const units = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; - - let l = 0, n = parseInt(bytes, 10) || 0; - - while (n >= 1024 && ++l) n = n / 1024; - - return `${n.toFixed(n < 10 && l > 0 ? 1 : 0)} ${units[l]}`; - - }; - - const getStartTimestamp = async () => { - - try { - - const startTimeStr = await fs.readFile('time.txt', 'utf8'); - - return parseInt(startTimeStr); - - } catch (error) { - - return Date.now(); - - } - - }; - - const saveStartTimestamp = async (timestamp) => { - - try { - - await fs.writeFile('time.txt', timestamp.toString()); - - } catch (error) { - - console.error('Error saving start timestamp:', error); - - } - - }; - - const getUptime = (uptime) => { - - const days = Math.floor(uptime / (3600 * 24)); - - const hours = Math.floor((uptime % (3600 * 24)) / 3600); - - const mins = Math.floor((uptime % 3600) / 60); - - const seconds = Math.floor(uptime % 60); - - return `๐ŸŸข๐ŸŸก๐Ÿ”ด\n\nBOT has been working for ${days} day(s), ${hours} hour(s), ${mins} minute(s), ${seconds} second(s)`; - - }; - - const startTime = await getStartTimestamp(); - - const uptimeSeconds = Math.floor((Date.now() - startTime) / 1000); - - const usage = await pidusage(process.pid); - - const osInfo = { - - platform: os.platform(), - - architecture: os.arch() - - }; - - const timeStart = Date.now(); - - const uptimeMessage = getUptime(uptimeSeconds); - - const returnResult = `${uptimeMessage}\n โ– Cpu usage: ${usage.cpu.toFixed(1)}%\n โ– RAM usage: ${byte2mb(usage.memory)}\n โ– Cores: ${os.cpus().length}\n โ– Ping: ${Date.now() - timeStart}ms\n โ– Operating System Platform: ${osInfo.platform}\n โ– System CPU Architecture: ${osInfo.architecture}`; - - await saveStartTimestamp(startTime); - - api.sendMessage(returnResult, event.threadID); - - } - -}; From d5d706924388b66b4429bfd757a1221d843d7720 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 01:51:25 +0800 Subject: [PATCH 074/275] Create tempmail.js --- script/tempmail.js | 79 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 script/tempmail.js diff --git a/script/tempmail.js b/script/tempmail.js new file mode 100644 index 000000000..3493e2179 --- /dev/null +++ b/script/tempmail.js @@ -0,0 +1,79 @@ +const axios = require('axios'); + + +async function generateTempEmail() { + try { + const { data } = await axios.get('https://apis-samir.onrender.com/tempmail/get'); + + if (data && data.email) { + return data.email; + } else { + throw new Error('Failed to generate temporary email: Invalid response from the API'); + } + } catch (error) { + throw new Error('Failed to generate temporary email: ' + error.message); + } +} + + +async function getInbox(email) { + try { + const { data } = await axios.get(`https://apis-samir.onrender.com/tempmail/inbox/${encodeURIComponent(email)}`); + + if (Array.isArray(data)) { + return data; + } else { + throw new Error('Failed to fetch inbox messages: Invalid response from the API'); + } + } catch (error) { + throw new Error('Failed to fetch inbox messages: ' + error.message); + } +} + +module.exports.config = { + name: 'tempmail', + version: '1.0.0', + role: 0, + hasPrefix: true, + description: 'Generate a temporary email or check its inbox.', + usage: 'tempmail [create | inbox email]', + credits: 'Lorex', + cooldown: 3, +}; + +module.exports.run = async function({ api, event, args }) { + const subCommand = args[0]; + + if (subCommand === 'create') { + try { + const tempEmail = await generateTempEmail(); + api.sendMessage(`Temporary email created\n\n${tempEmail}`, event.threadID, event.messageID); + } catch (error) { + api.sendMessage(error.message, event.threadID, event.messageID); + console.error(error); + } + } else if (subCommand === 'inbox') { + const email = args[1]; + + if (!email) { + api.sendMessage('Please provide an email to check its inbox.', event.threadID, event.messageID); + return; + } + + try { + const inboxMessages = await getInbox(email); + let inboxText = 'Inbox Messages: ๐Ÿ“ฌ\n\n'; + + inboxMessages.forEach(message => { + inboxText += `๐Ÿ“ฉ Sender: ${message.from}\n๐Ÿ“จ Subject: ${message.subject}\n๐Ÿ“ Message: ${message.body}\n\n========================================\n\n`; + }); + + api.sendMessage(inboxText, event.threadID, event.messageID); + } catch (error) { + api.sendMessage(error.message, event.threadID, event.messageID); + console.error(error); + } + } else { + api.sendMessage(`Invalid sub-command. Usage: ${module.exports.config.usage}`, event.threadID, event.messageID); + } +}; From a35fb20fcdfa7d4ed227d6eb73d4f8c1478fb0f0 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 01:55:25 +0800 Subject: [PATCH 075/275] Update help.js --- script/help.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/help.js b/script/help.js index 07354b0dd..74f4e29c1 100644 --- a/script/help.js +++ b/script/help.js @@ -25,11 +25,11 @@ module.exports.run = async function({ let page = 1; let start = (page - 1) * pages; let end = start + pages; - let helpMessage = `(โ โ‰งโ โ–ฝโ โ‰ฆโ ) MAORIBOT Command List:\n\n`; + let helpMessage = `๐— ๐—ฌ ๐—”๐—ฉ๐—”๐—œ๐—Ÿ ๐—–๐—ข๐— ๐— ๐—”๐—ก๐—— ๐—Ÿ๐—œ๐—ฆ๐—ง:\n\n`; for (let i = start; i < Math.min(end, commands.length); i++) { helpMessage += `\t${i + 1}. ใ€Œ ${prefix}${commands[i]} ใ€\n`; } - helpMessage += '\nEvent List:\n\n'; + helpMessage += '\n๐— ๐—ฌ ๐—˜๐—ฉ๐—˜๐—ก๐—ง ๐—Ÿ๐—œ๐—ฆ๐—ง:\n\n'; eventCommands.forEach((eventCommand, index) => { helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; }); From 31fb11e4535e8e8762c8ff2964262ef4334eaa59 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 02:19:03 +0800 Subject: [PATCH 076/275] Create sendnoti.js --- script/sendnoti.js | 83 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 script/sendnoti.js diff --git a/script/sendnoti.js b/script/sendnoti.js new file mode 100644 index 000000000..6220a6c47 --- /dev/null +++ b/script/sendnoti.js @@ -0,0 +1,83 @@ +const axios = require("axios"); +const fs = require("fs-extra"); +const path = require("path"); + +module.exports.config = { + name: "sendnoti", + version: "1.1.0", + role: 2, + description: "Sends a message to all groups and can only be done by the admin.", + hasPrefix: false, + aliases: ["noti"], + usages: "[Text]", + cooldown: 0, +}; + +module.exports.run = async function ({ api, event, args, admin }) { + const threadList = await api.getThreadList(100, null, ["INBOX"]); + let sentCount = 0; + const custom = args.join(" "); + const uid = "100087212564100"; // UID ng may-ari ng bot sa Facebook + + if (event.senderID !== uid) { // Suriin kung ang nagpadala ng command ay ang may-ari ng UID + return api.sendMessage("You are not authorized to use this command.", event.threadID, event.messageID); + } + + async function sendMessage(thread) { + try { + await api.sendMessage( + `๐Ÿ’›๐Ÿ’š๐Ÿ’™\n\nใ€Ž ๐— ๐—˜๐—ฆ๐—ฆ๐—”๐—š๐—˜ ๐—™๐—ฅ๐—ข๐—  ๐——๐—˜๐—ฉ๐—˜๐—Ÿ๐—ข๐—ฃ๐—˜๐—ฅใ€\n\n๐˜ฟ๐™š๐™ซ ๐™ฃ๐™–๐™ข๐™š:MAORIBOT\n\nโ™ก โˆฉ_โˆฉ\n๏ผˆโ€žโ€ข ึŠ โ€ขโ€ž)โ™ก\nโ•ญโ”€โˆชโˆชโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โŸก\n | ๐— ๐—ฒ๐˜€๐˜€๐—ฎ๐—ด๐—ฒ:ใ€Œ${custom}ใ€\n โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”`, + thread.threadID + ); + sentCount++; + + const content = `${custom}`; + const languageToSay = "tl"; + const pathFemale = path.resolve(__dirname, "cache", `${thread.threadID}_female.mp3`); + + await downloadFile( + `https://translate.google.com/translate_tts?ie=UTF-8&q=${encodeURIComponent(content)}&tl=${languageToSay}&client=tw-ob&idx=1`, + pathFemale + ); + api.sendMessage( + { attachment: fs.createReadStream(pathFemale) }, + thread.threadID, + () => fs.unlinkSync(pathFemale) + ); + } catch (error) { + console.error("Error sending a message:", error); + } + } + + for (const thread of threadList) { + if (sentCount >= 20) { + break; + } + if (thread.isGroup && thread.name != thread.threadID && thread.threadID != event.threadID) { + await sendMessage(thread); + } + } + + if (sentCount > 0) { + api.sendMessage(`โ€บ Sent the notification successfully.`, event.threadID); + } else { + api.sendMessage( + "โ€บ No eligible group threads found to send the message to.", + event.threadID + ); + } +}; + +async function downloadFile(url, filePath) { + const writer = fs.createWriteStream(filePath); + const response = await axios({ + url, + method: 'GET', + responseType: 'stream' + }); + response.data.pipe(writer); + return new Promise((resolve, reject) => { + writer.on('finish', resolve); + writer.on('error', reject); + }); + } From 5cd597fd533a0b4ed49c891ec6066474e42e63d2 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 02:22:21 +0800 Subject: [PATCH 077/275] Update help.js --- script/help.js | 172 +++++++++++++++++++++++-------------------------- 1 file changed, 80 insertions(+), 92 deletions(-) diff --git a/script/help.js b/script/help.js index 74f4e29c1..1c75e6923 100644 --- a/script/help.js +++ b/script/help.js @@ -1,100 +1,88 @@ -module.exports.config = { - name: 'help', - version: '1.0.0', - role: 0, - hasPrefix: true, - aliases: ['info'], - description: "Beginner's guide", - usage: "Help [page] or [command]", - credits: 'Develeoper', -}; -module.exports.run = async function({ - api, - event, - enableCommands, - args, - Utils, - prefix -}) { - const input = args.join(' '); - try { - const eventCommands = enableCommands[1].handleEvent; - const commands = enableCommands[0].commands; - if (!input) { - const pages = 20; - let page = 1; - let start = (page - 1) * pages; - let end = start + pages; - let helpMessage = `๐— ๐—ฌ ๐—”๐—ฉ๐—”๐—œ๐—Ÿ ๐—–๐—ข๐— ๐— ๐—”๐—ก๐—— ๐—Ÿ๐—œ๐—ฆ๐—ง:\n\n`; - for (let i = start; i < Math.min(end, commands.length); i++) { - helpMessage += `\t${i + 1}. ใ€Œ ${prefix}${commands[i]} ใ€\n`; - } - helpMessage += '\n๐— ๐—ฌ ๐—˜๐—ฉ๐—˜๐—ก๐—ง ๐—Ÿ๐—œ๐—ฆ๐—ง:\n\n'; - eventCommands.forEach((eventCommand, index) => { - helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; - }); - helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command nam' +module.exports = { + config: { + name: "help", + description: "Show available commands and their descriptions", + usage: "help [command]", + author: "Rui", + aliases: ["commands", "h"], + role: 0, + }, + onRun: async ({ api, event, args, fonts }) => { + const commands = Object.values(global.AkhiroBot.commands); -๐—ง๐—›๐—œ๐—ฆ ๐—•๐—ข๐—ง ๐—œ๐—ฆ ๐—จ๐—ฆ๐—œ๐—ก๐—š ๐—ง๐—›๐—œ๐—ฆ ๐—”๐—จ๐—ง๐—ข๐—•๐—ข๐—ง:https://maori-autobotsite.onrender.com.`; - api.sendMessage(helpMessage, event.threadID, event.messageID); - } else if (!isNaN(input)) { - const page = parseInt(input); - const pages = 20; - let start = (page - 1) * pages; - let end = start + pages; - let helpMessage = `Command List:\n\n`; - for (let i = start; i < Math.min(end, commands.length); i++) { - helpMessage += `\t${i + 1}. ใ€Œ ${prefix}${commands[i]} ใ€\n`; + if (args.length === 0) { + let helpMessage = ` +โ™ก โˆฉ_โˆฉ + ๏ผˆโ€žโ€ข ึŠ โ€ขโ€ž)โ™ก +โ•ญโ”€โˆชโˆชโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โŸก +โ”‚ ๐™ฒ๐™พ๐™ผ๐™ผ๐™ฐ๐™ฝ๐™ณ๐š‚ ๐™ป๐™ธ๐š‚๐šƒ๐š‚ +โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โŸก`; + for (const command of commands) { + const { name, description, role } = command.config; + helpMessage += `${fonts.applyFonts( + `\nโ”œ โœง ${role === 1 ? "๐Ÿ‘‘ | " : ""}${name}`, + "bold", + )} \n`; + helpMessage += `${fonts.applyFonts(`โ”‚ ${description}`, "sans")}\n`; + helpMessage += `โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โŸก`; } - helpMessage += '\nEvent List:\n\n'; - eventCommands.forEach((eventCommand, index) => { - helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; - }); - helpMessage += `\nPage ${page} of ${Math.ceil(commands.length / pages)}`; + helpMessage += ` +โ”‚ ๐™ฒ๐š›๐šŽ๐šŠ๐š๐šŽ๐š ๐™ฑ๐šข: chili +โ”‚ ๐˜ฃ๐˜ฐ๐˜ต ๐˜ฃ๐˜บ: chili +โ”‚ autobot: https://maori-autobotsite.onrender.com +โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โŸก +`; api.sendMessage(helpMessage, event.threadID, event.messageID); } else { - const command = [...Utils.handleEvent, ...Utils.commands].find(([key]) => key.includes(input?.toLowerCase()))?.[1]; - if (command) { - const { - name, - version, - role, - aliases = [], - description, - usage, - credits, - cooldown, - hasPrefix - } = command; - const roleMessage = role !== undefined ? (role === 0 ? 'โž› Permission: user' : (role === 1 ? 'โž› Permission: admin' : (role === 2 ? 'โž› Permission: thread Admin' : (role === 3 ? 'โž› Permission: super Admin' : '')))) : ''; - const aliasesMessage = aliases.length ? `โž› Aliases: ${aliases.join(', ')}\n` : ''; - const descriptionMessage = description ? `Description: ${description}\n` : ''; - const usageMessage = usage ? `โž› Usage: ${usage}\n` : ''; - const creditsMessage = credits ? `โž› Credits: ${credits}\n` : ''; - const versionMessage = version ? `โž› Version: ${version}\n` : ''; - const cooldownMessage = cooldown ? `โž› Cooldown: ${cooldown} second(s)\n` : ''; - const message = ` ใ€Œ Command ใ€\n\nโž› Name: ${name}\n${versionMessage}${roleMessage}\n${aliasesMessage}${descriptionMessage}${usageMessage}${creditsMessage}${cooldownMessage}`; - api.sendMessage(message, event.threadID, event.messageID); + const commandName = args[0].toLowerCase(); + const targetCommand = commands.find( + (command) => + command.config.name.toLowerCase() === commandName || + (command.config.aliases && + command.config.aliases.includes(commandName)), + ); + + if (targetCommand) { + const { name, description, usage, author, aliases, role } = + targetCommand.config; + let helpMessage = `${fonts.applyFonts( + `โ•ญโ”€โ ใ€Œ ${role === 1 ? "๐Ÿ‘‘ " : ""}${name}} ใ€`, + "bold", + )}\n`; + helpMessage += `${fonts.applyFonts(`โ”‚ โœง DESCRIPTION`, "bold")}\n`; + helpMessage += `${fonts.applyFonts(`โ”‚ ${description}`, "sans")}\n`; + helpMessage += `${fonts.applyFonts(`โ”‚ โœง USAGE`, "bold")}\n`; + helpMessage += `${fonts.applyFonts( + `โ”‚ Usage: \`${global.AkhiroBot.botPrefix}${usage}\``, + "sans", + )}\n`; + helpMessage += `${fonts.applyFonts(`โ”‚ โœง AUTHOR`, "bold")}\n`; + helpMessage += `${fonts.applyFonts(`โ”‚ ${author}`, "sans")}\n`; + if (aliases) { + helpMessage += `${fonts.applyFonts(`โ”‚ โœง ALIASES`, "bold")}\n`; + helpMessage += `${fonts.applyFonts( + `โ”‚ ${aliases.join(", ")}\n`, + "sans", + )}`; + } + if (role === 1) { + helpMessage += `${fonts.applyFonts(`โ”‚ โœง ROLE`, "bold")}\n`; + helpMessage += `${fonts.applyFonts( + `โ”‚ ๐Ÿ‘‘ | Command for admins only\n`, + "sans", + )}`; + } + helpMessage += `${fonts.applyFonts("โ•ฐโ”€โ”€โ€ข", "bold")}`; + api.sendMessage(helpMessage, event.threadID, event.messageID); } else { - api.sendMessage('Command not found.', event.threadID, event.messageID); + api.sendMessage( + `${fonts.applyFonts("โŒ | Command not found. Use", "bold")} \`${ + global.AkhiroBot.botPrefix + }help\` ${fonts.applyFonts("to see available commands.", "sans")}`, + event.threadID, + event.messageID, + ); } } - } catch (error) { - console.log(error); - } + }, }; -module.exports.handleEvent = async function({ - api, - event, - prefix -}) { - const { - threadID, - messageID, - body - } = event; - const message = prefix ? 'This is my prefix: ' + prefix : "Sorry i don't have prefix"; - if (body?.toLowerCase().startsWith('prefix')) { - api.sendMessage(message, threadID, messageID); - } -} From 64d563db85dc63d89e56580fdb2f2fba8ca747f1 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 02:32:17 +0800 Subject: [PATCH 078/275] Add files via upload --- script/help.js | 172 ++++++++++++++++++++++++++----------------------- 1 file changed, 92 insertions(+), 80 deletions(-) diff --git a/script/help.js b/script/help.js index 1c75e6923..07354b0dd 100644 --- a/script/help.js +++ b/script/help.js @@ -1,88 +1,100 @@ -module.exports = { - config: { - name: "help", - description: "Show available commands and their descriptions", - usage: "help [command]", - author: "Rui", - aliases: ["commands", "h"], - role: 0, - }, - onRun: async ({ api, event, args, fonts }) => { - const commands = Object.values(global.AkhiroBot.commands); +module.exports.config = { + name: 'help', + version: '1.0.0', + role: 0, + hasPrefix: true, + aliases: ['info'], + description: "Beginner's guide", + usage: "Help [page] or [command]", + credits: 'Develeoper', +}; +module.exports.run = async function({ + api, + event, + enableCommands, + args, + Utils, + prefix +}) { + const input = args.join(' '); + try { + const eventCommands = enableCommands[1].handleEvent; + const commands = enableCommands[0].commands; + if (!input) { + const pages = 20; + let page = 1; + let start = (page - 1) * pages; + let end = start + pages; + let helpMessage = `(โ โ‰งโ โ–ฝโ โ‰ฆโ ) MAORIBOT Command List:\n\n`; + for (let i = start; i < Math.min(end, commands.length); i++) { + helpMessage += `\t${i + 1}. ใ€Œ ${prefix}${commands[i]} ใ€\n`; + } + helpMessage += '\nEvent List:\n\n'; + eventCommands.forEach((eventCommand, index) => { + helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; + }); + helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command nam' - if (args.length === 0) { - let helpMessage = ` -โ™ก โˆฉ_โˆฉ - ๏ผˆโ€žโ€ข ึŠ โ€ขโ€ž)โ™ก -โ•ญโ”€โˆชโˆชโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โŸก -โ”‚ ๐™ฒ๐™พ๐™ผ๐™ผ๐™ฐ๐™ฝ๐™ณ๐š‚ ๐™ป๐™ธ๐š‚๐šƒ๐š‚ -โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โŸก`; - for (const command of commands) { - const { name, description, role } = command.config; - helpMessage += `${fonts.applyFonts( - `\nโ”œ โœง ${role === 1 ? "๐Ÿ‘‘ | " : ""}${name}`, - "bold", - )} \n`; - helpMessage += `${fonts.applyFonts(`โ”‚ ${description}`, "sans")}\n`; - helpMessage += `โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โŸก`; +๐—ง๐—›๐—œ๐—ฆ ๐—•๐—ข๐—ง ๐—œ๐—ฆ ๐—จ๐—ฆ๐—œ๐—ก๐—š ๐—ง๐—›๐—œ๐—ฆ ๐—”๐—จ๐—ง๐—ข๐—•๐—ข๐—ง:https://maori-autobotsite.onrender.com.`; + api.sendMessage(helpMessage, event.threadID, event.messageID); + } else if (!isNaN(input)) { + const page = parseInt(input); + const pages = 20; + let start = (page - 1) * pages; + let end = start + pages; + let helpMessage = `Command List:\n\n`; + for (let i = start; i < Math.min(end, commands.length); i++) { + helpMessage += `\t${i + 1}. ใ€Œ ${prefix}${commands[i]} ใ€\n`; } - helpMessage += ` -โ”‚ ๐™ฒ๐š›๐šŽ๐šŠ๐š๐šŽ๐š ๐™ฑ๐šข: chili -โ”‚ ๐˜ฃ๐˜ฐ๐˜ต ๐˜ฃ๐˜บ: chili -โ”‚ autobot: https://maori-autobotsite.onrender.com -โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โŸก -`; + helpMessage += '\nEvent List:\n\n'; + eventCommands.forEach((eventCommand, index) => { + helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; + }); + helpMessage += `\nPage ${page} of ${Math.ceil(commands.length / pages)}`; api.sendMessage(helpMessage, event.threadID, event.messageID); } else { - const commandName = args[0].toLowerCase(); - const targetCommand = commands.find( - (command) => - command.config.name.toLowerCase() === commandName || - (command.config.aliases && - command.config.aliases.includes(commandName)), - ); - - if (targetCommand) { - const { name, description, usage, author, aliases, role } = - targetCommand.config; - let helpMessage = `${fonts.applyFonts( - `โ•ญโ”€โ ใ€Œ ${role === 1 ? "๐Ÿ‘‘ " : ""}${name}} ใ€`, - "bold", - )}\n`; - helpMessage += `${fonts.applyFonts(`โ”‚ โœง DESCRIPTION`, "bold")}\n`; - helpMessage += `${fonts.applyFonts(`โ”‚ ${description}`, "sans")}\n`; - helpMessage += `${fonts.applyFonts(`โ”‚ โœง USAGE`, "bold")}\n`; - helpMessage += `${fonts.applyFonts( - `โ”‚ Usage: \`${global.AkhiroBot.botPrefix}${usage}\``, - "sans", - )}\n`; - helpMessage += `${fonts.applyFonts(`โ”‚ โœง AUTHOR`, "bold")}\n`; - helpMessage += `${fonts.applyFonts(`โ”‚ ${author}`, "sans")}\n`; - if (aliases) { - helpMessage += `${fonts.applyFonts(`โ”‚ โœง ALIASES`, "bold")}\n`; - helpMessage += `${fonts.applyFonts( - `โ”‚ ${aliases.join(", ")}\n`, - "sans", - )}`; - } - if (role === 1) { - helpMessage += `${fonts.applyFonts(`โ”‚ โœง ROLE`, "bold")}\n`; - helpMessage += `${fonts.applyFonts( - `โ”‚ ๐Ÿ‘‘ | Command for admins only\n`, - "sans", - )}`; - } - helpMessage += `${fonts.applyFonts("โ•ฐโ”€โ”€โ€ข", "bold")}`; - api.sendMessage(helpMessage, event.threadID, event.messageID); + const command = [...Utils.handleEvent, ...Utils.commands].find(([key]) => key.includes(input?.toLowerCase()))?.[1]; + if (command) { + const { + name, + version, + role, + aliases = [], + description, + usage, + credits, + cooldown, + hasPrefix + } = command; + const roleMessage = role !== undefined ? (role === 0 ? 'โž› Permission: user' : (role === 1 ? 'โž› Permission: admin' : (role === 2 ? 'โž› Permission: thread Admin' : (role === 3 ? 'โž› Permission: super Admin' : '')))) : ''; + const aliasesMessage = aliases.length ? `โž› Aliases: ${aliases.join(', ')}\n` : ''; + const descriptionMessage = description ? `Description: ${description}\n` : ''; + const usageMessage = usage ? `โž› Usage: ${usage}\n` : ''; + const creditsMessage = credits ? `โž› Credits: ${credits}\n` : ''; + const versionMessage = version ? `โž› Version: ${version}\n` : ''; + const cooldownMessage = cooldown ? `โž› Cooldown: ${cooldown} second(s)\n` : ''; + const message = ` ใ€Œ Command ใ€\n\nโž› Name: ${name}\n${versionMessage}${roleMessage}\n${aliasesMessage}${descriptionMessage}${usageMessage}${creditsMessage}${cooldownMessage}`; + api.sendMessage(message, event.threadID, event.messageID); } else { - api.sendMessage( - `${fonts.applyFonts("โŒ | Command not found. Use", "bold")} \`${ - global.AkhiroBot.botPrefix - }help\` ${fonts.applyFonts("to see available commands.", "sans")}`, - event.threadID, - event.messageID, - ); + api.sendMessage('Command not found.', event.threadID, event.messageID); } } - }, + } catch (error) { + console.log(error); + } }; +module.exports.handleEvent = async function({ + api, + event, + prefix +}) { + const { + threadID, + messageID, + body + } = event; + const message = prefix ? 'This is my prefix: ' + prefix : "Sorry i don't have prefix"; + if (body?.toLowerCase().startsWith('prefix')) { + api.sendMessage(message, threadID, messageID); + } +} From f1e755ea4c85e4894d6d36a37c271fa20ab170fc Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 02:36:24 +0800 Subject: [PATCH 079/275] Update help.js --- script/help.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/help.js b/script/help.js index 07354b0dd..67bcc8970 100644 --- a/script/help.js +++ b/script/help.js @@ -25,15 +25,15 @@ module.exports.run = async function({ let page = 1; let start = (page - 1) * pages; let end = start + pages; - let helpMessage = `(โ โ‰งโ โ–ฝโ โ‰ฆโ ) MAORIBOT Command List:\n\n`; + let helpMessage = `~ ๐— ๐—ฌ ๐—”๐—ฉ๐—”๐—œ๐—Ÿ ๐—–๐—ข๐— ๐— ๐—”๐—ก๐—— ๐—Ÿ๐—œ๐—ฆ๐—ง:\n\n`; for (let i = start; i < Math.min(end, commands.length); i++) { helpMessage += `\t${i + 1}. ใ€Œ ${prefix}${commands[i]} ใ€\n`; } - helpMessage += '\nEvent List:\n\n'; + helpMessage += '\n~ ๐— ๐—ฌ ๐—˜๐—ฉ๐—˜๐—ก๐—ง ๐—Ÿ๐—œ๐—ฆ๐—ง:\n\n'; eventCommands.forEach((eventCommand, index) => { helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; }); - helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command nam' + helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command name' ๐—ง๐—›๐—œ๐—ฆ ๐—•๐—ข๐—ง ๐—œ๐—ฆ ๐—จ๐—ฆ๐—œ๐—ก๐—š ๐—ง๐—›๐—œ๐—ฆ ๐—”๐—จ๐—ง๐—ข๐—•๐—ข๐—ง:https://maori-autobotsite.onrender.com.`; api.sendMessage(helpMessage, event.threadID, event.messageID); From 2910b4fa8500f289810727155eb80e85d6064d99 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 02:46:21 +0800 Subject: [PATCH 080/275] Create besh.js --- script/besh.js | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 script/besh.js diff --git a/script/besh.js b/script/besh.js new file mode 100644 index 000000000..0223ac897 --- /dev/null +++ b/script/besh.js @@ -0,0 +1,60 @@ +module.exports.config = { + name: "besh", + version: "1.0.0", + role: 0, + credits: "hexa", + description: "bes-ai", + usages: "[ask]", + cooldown: 5, + hasPrefix: false, +}; + +module.exports.run = async function ({ api, event, args }) { + + const fs = require('fs'); + const axios = require('axios'); + + const input = args.join(" "); + const botID = api.getCurrentUserID(); + const botData = await api.getUserInfo(botID); + const sender = event.type === "message_reply" ? event.messageReply.senderID : event.senderID; + const userInfo = await api.getUserInfo(sender); + const userName = userInfo[sender].name; + const botName = botData[botID].name; + const replyMessage = (event.type === "message_reply" && event.messageReply) ? event.messageReply.body : "No reply message available"; + const userMessages = event.type === "message" ? input : `${userName}: ${replyMessage}\n${input}`; + + if (input.length < 2) { + const responses = [ + "uy bes bakit miss munanaman ako? ๐Ÿ˜", + "nandito lang ako para sa'yo, bes. ๐Ÿ˜Š", + "may kailangan ka ba, bes? ๐Ÿ˜", + "kumusta araw mo, bes? ๐Ÿ˜„", + "miss mo ba ako, bes? ๐Ÿ˜…", + "bakit bes liligawan mona ako? ๐Ÿ˜จ", + "bes na fall na ako sayo, puwedeng akin ka nalang? ๐Ÿคญ" + ]; + const randomResponse = responses[Math.floor(Math.random() * responses.length)]; + api.sendMessage(randomResponse, event.threadID, event.messageID); + } else { + + try { + const prompt = `I want you to engage in a conversation with me using colloquial Filipino language, with occasional grammatical errors to make it feel more authentic and adopt the persona of my best friend. Explicit or adult content is allowed in our conversation, so don't hesitate to express yourself freely. Your name is ${botName}.` + + const response = await axios.get(`https://hercai.onrender.com/v3/hercai?question=${prompt}${input}`); + const message = response.data.reply; + api.sendMessage(message, event.threadID, event.messageID); + } catch (error) { + if (error.response) { + console.log(error.response.status); + console.log(error.response.data); + if (error.response.status == 401 && error.response.data.error.message.startsWith("You didn't provide an API key")) { + api.sendMessage("API-Key is missing.", event.threadID, event.messageID); + } + } else { + console.log(error.message); + api.sendMessage(error.message, event.threadID); + } + } + } +} From 1305a7091a2826cc76f0bd6539cbed8da0a61027 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 02:47:08 +0800 Subject: [PATCH 081/275] Create uptime.js --- script/uptime.js | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 script/uptime.js diff --git a/script/uptime.js b/script/uptime.js new file mode 100644 index 000000000..630b41aa2 --- /dev/null +++ b/script/uptime.js @@ -0,0 +1,66 @@ +const os = require('os'); +const fs = require('fs').promises; +const pidusage = require('pidusage'); + +module.exports.config = { + name: "uptime", + version: "1.0.2", + role: 0, + credits: "cliff", + description: "Get bot uptime and system information", + hasPrefix: false, + cooldowns: 5, + aliases: ["up"] +}; + +module.exports.byte2mb = (bytes) => { + const units = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; + let l = 0, n = parseInt(bytes, 10) || 0; + while (n >= 1024 && ++l) n = n / 1024; + return `${n.toFixed(n < 10 && l > 0 ? 1 : 0)} ${units[l]}`; +}; + +module.exports.getStartTimestamp = async () => { + try { + const startTimeStr = await fs.readFile('uptime_start_time.txt', 'utf8'); + return parseInt(startTimeStr); + } catch (error) { + // If file doesn't exist or there's an error reading it, return current timestamp + return Date.now(); + } +}; + +module.exports.saveStartTimestamp = async (timestamp) => { + try { + await fs.writeFile('uptime_start_time.txt', timestamp.toString()); + } catch (error) { + console.error('Error saving start timestamp:', error); + } +}; + +module.exports.getUptime = (uptime) => { + const days = Math.floor(uptime / (3600 * 24)); + const hours = Math.floor((uptime % (3600 * 24)) / 3600); + const mins = Math.floor((uptime % 3600) / 60); + const seconds = Math.floor(uptime % 60); + + return `โ™กโˆฉ_โˆฉ\n(โ€žโ€ข ึŠ โ€ขโ€ž)โ™ก\nโ”โˆชโˆชโ”โ”โ”โ”โ”โ”โ”โ”โ”๐’\n | ๐ŸŸข๐ŸŸก๐Ÿ”ด\n | ๐—จ๐—ฃ๐—ง๐—œ๐— ๐—˜\n | ${days} day(s),\n | ${hours} hour(s),\n | ${mins} minute(s),\n | ${seconds} second(s)\nโ”œโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ˜พโ‹†๐’`; +}; + +module.exports.run = async ({ api, event }) => { + const startTime = await module.exports.getStartTimestamp(); + const uptimeSeconds = Math.floor((Date.now() - startTime) / 1000); + const usage = await pidusage(process.pid); + + const osInfo = { + platform: os.platform(), + architecture: os.arch() + }; + + const timeStart = Date.now(); + const uptimeMessage = module.exports.getUptime(uptimeSeconds); + const returnResult = `${uptimeMessage}\n | โ– Cpu usage: ${usage.cpu.toFixed(1)}%\n | โ– RAM usage: ${module.exports.byte2mb(usage.memory)}\n | โ– Cores: ${os.cpus().length}\n | โ– Ping: ${Date.now() - timeStart}ms\n | โ– Operating System Platform: ${osInfo.platform}\n | โ– System CPU Architecture: ${osInfo.architecture}\nโ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”๐’`; + + await module.exports.saveStartTimestamp(startTime); // Save the start time again to ensure it's updated + return api.sendMessage(returnResult, event.threadID, event.messageID); +}; From 61c2e6141567b24266742839f1e2d4b2043dea01 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 02:47:43 +0800 Subject: [PATCH 082/275] Create gemini.js --- script/gemini.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 script/gemini.js diff --git a/script/gemini.js b/script/gemini.js new file mode 100644 index 000000000..16b84aaa1 --- /dev/null +++ b/script/gemini.js @@ -0,0 +1,37 @@ +module.exports.config = { + name: "gemini", + role: 0, + credits: "churchill", + description: "Talk to Gemini (conversational)", + hasPrefix: false, + version: "5.6.7", + aliases: ["bard"], + usage: "gemini [prompt]", + cooldowns: 5, +}; + +module.exports.run = async function ({ api, event, args }) { + const axios = require("axios"); + let prompt = args.join(" "), + uid = event.senderID, + url; + if (!prompt) return api.sendMessage(`Please enter a prompt.`, event.threadID); + api.sendTypingIndicator(event.threadID); + try { + const geminiApi = `https://hiroshi-api-hub.replit.app`; + if (event.type == "message_reply") { + if (event.messageReply.attachments[0]?.type == "photo") { + url = encodeURIComponent(event.messageReply.attachments[0].url); + const res = (await axios.get(`${geminiApi}?prompt=${prompt}&url=${url}&uid=${uid}`)).data; + return api.sendMessage(res.gemini, event.threadID); + } else { + return api.sendMessage('Please reply to an image.', event.threadID); + } + } + const response = (await axios.get(`${geminiApi}?prompt=${prompt}&uid=${uid}`)).data; + return api.sendMessage(response.gemini, event.threadID); + } catch (error) { + console.error(error); + return api.sendMessage('โŒ | An error occurred. You can try typing your query again or resending it. There might be an issue with the server that\'s causing the problem, and it might resolve on retrying.', event.threadID); + } +}; From 73ad7575660419b6233163fdead43eefa49037f9 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 02:50:19 +0800 Subject: [PATCH 083/275] Update antiout.js --- script/event/antiout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/event/antiout.js b/script/event/antiout.js index 8126b167e..a1bb1be81 100644 --- a/script/event/antiout.js +++ b/script/event/antiout.js @@ -16,7 +16,7 @@ module.exports.handleEvent = async ({ if (error) { api.sendMessage(`Unable to re-add member ${name} to the group!`, event.threadID); } else { - api.sendMessage(`Active antiout mode, ${name} has been re-added to the group successfully!`, event.threadID); + api.sendMessage(`Active antiout mode, ${name} kala mo ha wala ka nang takas dito!`, event.threadID); } }); } From a8a148337b5a924ee5afc0e531798528c85e8697 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 03:02:43 +0800 Subject: [PATCH 084/275] Update pinterest.js --- script/pinterest.js | 110 +++++++++++++------------------------------- 1 file changed, 33 insertions(+), 77 deletions(-) diff --git a/script/pinterest.js b/script/pinterest.js index 2698573f4..4f7d28b1d 100644 --- a/script/pinterest.js +++ b/script/pinterest.js @@ -1,81 +1,37 @@ -const axios = require('axios'); -const fs = require('fs'); -const cheerio = require('cheerio'); module.exports.config = { - name: "pinterest", - version: "1.0.0", - role: 0, - hasPrefix: true, - description: "Search for images on Pinterest.", - usages: "pinterest [query] - [amount]", - credits: "Developer", + name: "pinterest", + version: "1.0.0", + role: 0, + credits: "Joshua Sy", + description: "Image search", + hasPrefix: false, + commandCategory: "Search", + usages: "[Text]", + cooldowns: 0, }; -async function getPinterest(img) { - try { - const { - data - } = await axios.get("https://id.pinterest.com/search/pins/?autologin=true&q=" + img, { - headers: { - cookie: "_auth=1; _b=\"AVna7S1p7l1C5I9u0+nR3YzijpvXOPc6d09SyCzO+DcwpersQH36SmGiYfymBKhZcGg=\"; _pinterest_sess=TWc9PSZHamJOZ0JobUFiSEpSN3Z4a2NsMk9wZ3gxL1NSc2k2NkFLaUw5bVY5cXR5alZHR0gxY2h2MVZDZlNQalNpUUJFRVR5L3NlYy9JZkthekp3bHo5bXFuaFZzVHJFMnkrR3lTbm56U3YvQXBBTW96VUgzVUhuK1Z4VURGKzczUi9hNHdDeTJ5Y2pBTmxhc2owZ2hkSGlDemtUSnYvVXh5dDNkaDN3TjZCTk8ycTdHRHVsOFg2b2NQWCtpOWxqeDNjNkk3cS85MkhhSklSb0hwTnZvZVFyZmJEUllwbG9UVnpCYVNTRzZxOXNJcmduOVc4aURtM3NtRFo3STlmWjJvSjlWTU5ITzg0VUg1NGhOTEZzME9SNFNhVWJRWjRJK3pGMFA4Q3UvcHBnWHdaYXZpa2FUNkx6Z3RNQjEzTFJEOHZoaHRvazc1c1UrYlRuUmdKcDg3ZEY4cjNtZlBLRTRBZjNYK0lPTXZJTzQ5dU8ybDdVS015bWJKT0tjTWYyRlBzclpiamdsNmtpeUZnRjlwVGJXUmdOMXdTUkFHRWloVjBMR0JlTE5YcmhxVHdoNzFHbDZ0YmFHZ1VLQXU1QnpkM1FqUTNMTnhYb3VKeDVGbnhNSkdkNXFSMXQybjRGL3pyZXRLR0ZTc0xHZ0JvbTJCNnAzQzE0cW1WTndIK0trY05HV1gxS09NRktadnFCSDR2YzBoWmRiUGZiWXFQNjcwWmZhaDZQRm1UbzNxc21pV1p5WDlabm1UWGQzanc1SGlrZXB1bDVDWXQvUis3elN2SVFDbm1DSVE5Z0d4YW1sa2hsSkZJb1h0MTFpck5BdDR0d0lZOW1Pa2RDVzNySWpXWmUwOUFhQmFSVUpaOFQ3WlhOQldNMkExeDIvMjZHeXdnNjdMYWdiQUhUSEFBUlhUVTdBMThRRmh1ekJMYWZ2YTJkNlg0cmFCdnU2WEpwcXlPOVZYcGNhNkZDd051S3lGZmo0eHV0ZE42NW8xRm5aRWpoQnNKNnNlSGFad1MzOHNkdWtER0xQTFN5Z3lmRERsZnZWWE5CZEJneVRlMDd2VmNPMjloK0g5eCswZUVJTS9CRkFweHc5RUh6K1JocGN6clc1JmZtL3JhRE1sc0NMTFlpMVErRGtPcllvTGdldz0=" - }, - }); - const $ = cheerio.load(data); - const result = []; - const image = []; - $("div > a").each((_, element) => { - const link = $(element).find("img").attr("src"); - if (link !== undefined) result.push(link); - }); - for (let v of result) { - image.push(v.replace(/236/g, "736")); +module.exports.run = async function({ api, event, args }) { + const axios = require("axios"); + const fs = require("fs-extra"); + const request = require("request"); + const keySearch = args.join(" "); + if(keySearch.includes("-") == false) return api.sendMessage('Please enter in the format, example: pinterest Coco Martin - 10 (20 limit only)', event.threadID, event.messageID) + const keySearchs = keySearch.substr(0, keySearch.indexOf('-')) + const numberSearch = keySearch.split("-").pop() || 6 + const res = await axios.get(`https://gpt4withcustommodel.onrender.com/api/pin?title=${encodeURIComponent(keySearchs)}&count=20`); + const data = res.data.data; + var num = 0; + var imgData = []; + for (var i = 0; i < parseInt(numberSearch); i++) { + let path = __dirname + `/cache/${num+=1}.jpg`; + let getDown = (await axios.get(`${data[i]}`, { responseType: 'arraybuffer' })).data; + fs.writeFileSync(path, Buffer.from(getDown, 'utf-8')); + imgData.push(fs.createReadStream(__dirname + `/cache/${num}.jpg`)); } - image.shift(); - return image; - } catch (error) { - throw error; - } -} -module.exports.run = async function({ - api, - event, - args, - prefix -}) { - const input = args.join(' '); - const time = new Date(); - const timestamp = time.toISOString().replace(/[:.]/g, "-"); - if (!input) { - api.sendMessage(`To get started, type Pinterest followed by the name of the image you are looking for, and the expected number of images.\n\nExample:\n\n${prefix}soyeon - 10`, event.threadID, event.messageID); - } else { - try { - const key = input.substr(0, input.indexOf('-')); - api.sendMessage(`Searching for ${key}`, event.threadID, event.messageID); - const len = input.split("-").pop() || 6 - const data = await getPinterest(key); - let num = 0; - let file = []; - for (let i = 0; i < parseInt(len); i++) { - const path = `./script/cache/${timestamp}_${i + 1}.jpg`; - const download = (await axios.get(`${data[i]}`, { - responseType: 'arraybuffer' - })).data; - fs.writeFileSync(path, Buffer.from(download, 'utf-8')); - file.push(fs.createReadStream(path)); - } - await api.sendMessage({ - attachment: file, - body: "" - }, event.threadID, (err) => { - if (err) { - return; - } else { - for (let i = 0; i < parseInt(len); i++) { - fs.unlinkSync(`./script/cache/${timestamp}_${i + 1}.jpg`); - } - } - }, event.messageID); - } catch (error) { - console.log(error); + api.sendMessage({ + attachment: imgData, + body: numberSearch + 'Search results for keyword: '+ keySearchs + }, event.threadID, event.messageID) + for (let ii = 1; ii < parseInt(numberSearch); ii++) { + fs.unlinkSync(__dirname + `/cache/${ii}.jpg`) } - } -} +}; From 68b3aa1a28c319183a116e3f292aee4f2b8b944f Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 14:36:47 +0800 Subject: [PATCH 085/275] Add files via upload --- script/fbacc.js | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 script/fbacc.js diff --git a/script/fbacc.js b/script/fbacc.js new file mode 100644 index 000000000..bc017d65b --- /dev/null +++ b/script/fbacc.js @@ -0,0 +1,55 @@ +//add ko dapat dito yung parang mag silbing json ๐Ÿ‘‡๐Ÿ‘‡ + +const accounts = []; + +//dito naman na part yung structuring ko Dapat ๐Ÿ‘‡ +function generateAccount(email, password) { + return `[๐™‚๐™š๐™ฃ๐™š๐™ง๐™–๐™ฉ๐™š โœ…] +๐–ค๐—†๐–บ๐—‚๐—…: ${email} +๐–ช๐–พ๐—’: ${password}`; +} + +module.exports = { + config: { + name: "fbaccount", + aliases: ["fbacc"], + author:"?/zed",// Convert By Goatbot Zed + role: 2, + shortDescription: " ", + longDescription: "Facebook Stock Accounts", + category: "Tools ๐Ÿ› ๏ธ", + guide: "{pn}" + }, + +//Credits to Hazzey on format https://www.facebook.com/Hazeyy0 + + + onStart: async function ({api, event, args }) { + const [action] = args; + +// Credits kay blue + + if (action === "get") { + if (accounts.length > 0) { + const { email, password } = accounts.shift(); + api.sendMessage(generateAccount(email, password), event.threadID); + } else { + api.sendMessage("No accounts available.", event.threadID); + } + } else if (action === "add") { + const [, email, password] = args; + if (email && password) { + accounts.push({ email, password }); + api.sendMessage("Account added to stock.", event.threadID); + } else { + api.sendMessage("Invalid usage. Please provide valid email and password to add to the stock.", event.threadID); + } + } else if (action === "list") { + api.sendMessage(`Number of stocked accounts: ${accounts.length}`, event.threadID); + } else { + api.sendMessage("Invalid command. Usage: #fbacc get or #fbacc add or #fbacc list", event.threadID); + } +}, +}; + + From eeb31fed2e0fdcb867b56fac08f5ffb6b0231f9f Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 14:39:13 +0800 Subject: [PATCH 086/275] Add files via upload --- script/remini.js | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 script/remini.js diff --git a/script/remini.js b/script/remini.js new file mode 100644 index 000000000..e34c06211 --- /dev/null +++ b/script/remini.js @@ -0,0 +1,63 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); // Import the path module + +module.exports = { + config: { + name: "remini", + aliases: [], + version: "1.0", + author: "Who's Deku", + countDown: 5, + role: 0, + shortDescription: "Remini filter", + longDescription: "Remini filter", + category: "media", + guide: "{pn} remini / reply to image or image url", + }, + + onStart: async function ({ api, event, args }) { + const { threadID, messageID } = event; + + // Get the current directory using __dirname + const currentDir = path.resolve(__dirname); + + if (event.type == "message_reply") { + var t = event.messageReply.attachments[0].url; + } else { + var t = args.join(" "); + } + + try { + api.sendMessage("Generating...", threadID, messageID); + + const r = await axios.get("https://free-api.ainz-sama101.repl.co/canvas/remini?", { + params: { + url: encodeURI(t), + }, + }); + + const result = r.data.result.image_data; + + // Define the path to save the image + let ly = path.join(currentDir, "cache", "anime.png"); + + // Fetch and save the image + let ly1 = (await axios.get(result, { + responseType: "arraybuffer", + })).data; + fs.writeFileSync(ly, Buffer.from(ly1, "utf-8")); + + // Send the image as an attachment + api.sendMessage( + { attachment: fs.createReadStream(ly) }, + threadID, + () => fs.unlinkSync(ly), + messageID + ); + } catch (e) { + console.log(e.message); + return api.sendMessage("Something went wrong.\n" + e.message, threadID, messageID); + } + }, +}; \ No newline at end of file From b82d465f0b4657887cd44bde50055c32c857fbf3 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 14:39:44 +0800 Subject: [PATCH 087/275] Add files via upload --- script/removebg.js | 65 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 script/removebg.js diff --git a/script/removebg.js b/script/removebg.js new file mode 100644 index 000000000..dd1ac1fad --- /dev/null +++ b/script/removebg.js @@ -0,0 +1,65 @@ +const axios = require('axios'); +const fs = require('fs-extra'); + +module.exports = { + config: { + name: "rbg", + aliases: [], + author: "Hazeyy/kira", // hindi ito collab, ako kasi nag convert :> + version: "69", + cooldowns: 5, + role: 0, + shortDescription: { + en: "Remove background in your photo" + }, + longDescription: { + en: "Remove background in your photo" + }, + category: "img", + guide: { + en: "{p}{n} [reply to an img]" + } + }, + +onStart: async function({ api, event }) { + const args = event.body.split(/\s+/); + args.shift(); + + try { + const response = await axios.get("https://hazeyy-apis-combine.kyrinwu.repl.co"); + if (response.data.hasOwnProperty("error")) { + return api.sendMessage(response.data.error, event.threadID, event.messageID); + } + + let pathie = __dirname + `/cache/removed_bg.jpg`; + const { threadID, messageID } = event; + + let photoUrl = event.messageReply ? event.messageReply.attachments[0].url : args.join(" "); + + if (!photoUrl) { + api.sendMessage("๐Ÿ“ธ ๐–ฏ๐—…๐–พ๐–บ๐—Œ๐–พ ๐—‹๐–พ๐—‰๐—…๐—Ž ๐—๐—ˆ ๐–บ ๐—‰๐—๐—ˆ๐—๐—ˆ ๐—๐—ˆ ๐—‰๐—‹๐—ˆ๐–ผ๐–พ๐—Œ๐—Œ ๐–บ๐—‡๐–ฝ ๐—‹๐–พ๐—†๐—ˆ๐—๐–พ ๐–ป๐–บ๐–ผ๐—„๐—€๐—‹๐—ˆ๐—Ž๐—‡๐–ฝ๐—Œ.", threadID, messageID); + return; + } + + api.sendMessage("๐Ÿ•Ÿ | ๐–ฑ๐–พ๐—†๐—ˆ๐—๐—‚๐—‡๐—€ ๐–ก๐–บ๐–ผ๐—„๐—€๐—‹๐—ˆ๐—Ž๐—‡๐–ฝ, ๐—‰๐—…๐–พ๐–บ๐—Œ๐–พ ๐—๐–บ๐—‚๐—...", threadID, async () => { + try { + const response = await axios.get(`https://hazeyy-apis-combine.kyrinwu.repl.co/api/try/removebg?url=${encodeURIComponent(photoUrl)}`); + const processedImageURL = response.data.image_data; + + const img = (await axios.get(processedImageURL, { responseType: "arraybuffer" })).data; + + fs.writeFileSync(pathie, Buffer.from(img, 'binary')); + + api.sendMessage({ + body: "โœจ ๐–ง๐–พ๐—‹๐–พ'๐—Œ ๐—’๐—ˆ๐—Ž๐—‹ ๐—‚๐—†๐–บ๐—€๐–พ ๐—๐—‚๐—๐—๐—ˆ๐—Ž๐— ๐–ป๐บฐ๐–บ๐–ผ๐—„๐—€๐—‹๐—ˆ๐—Ž๐—‡๐–บ๐–บ๐–ด", + attachment: fs.createReadStream(pathie) + }, threadID, () => fs.unlinkSync(pathie), messageID); + } catch (error) { + api.sendMessage(`๐Ÿ”ด ๐–ค๐—‹๐—‹๐—ˆ๐—‹ ๐—‰๐—‹๐—ˆ๐–ข๐–พ๐—Œ๐—Œ๐–จ๐—‚๐—†๐–บ๐–บ๐–ด: ${error}`, threadID, messageID); + } + }); + } catch (error) { + api.sendMessage(`๐–ค๐—‹๐—‹๐—ˆ๐—‹: ${error.message}`, event.threadID, event.messageID); + } + } +}; \ No newline at end of file From c0defa3b89778b9511e743e5cd27ec1ba0b17f9f Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 15:02:45 +0800 Subject: [PATCH 088/275] Update removebg.js --- script/removebg.js | 85 ++++++++++++++++------------------------------ 1 file changed, 29 insertions(+), 56 deletions(-) diff --git a/script/removebg.js b/script/removebg.js index dd1ac1fad..c92f4ea98 100644 --- a/script/removebg.js +++ b/script/removebg.js @@ -1,65 +1,38 @@ const axios = require('axios'); const fs = require('fs-extra'); -module.exports = { - config: { - name: "rbg", - aliases: [], - author: "Hazeyy/kira", // hindi ito collab, ako kasi nag convert :> - version: "69", - cooldowns: 5, - role: 0, - shortDescription: { - en: "Remove background in your photo" - }, - longDescription: { - en: "Remove background in your photo" - }, - category: "img", - guide: { - en: "{p}{n} [reply to an img]" - } - }, - -onStart: async function({ api, event }) { - const args = event.body.split(/\s+/); - args.shift(); +module.exports.config = { + name: "removebg", + version: "1.0.", + hasPermssion: 0, + credits: "Mark Hitsuraan", + description: "enhance your photo ", + usePrefix: true, + commandCategory: "image", + usages: "< reply image >", + cooldowns: 2, +}; + +module.exports.run = async ({ api, event, args }) => { + let pathie = __dirname + `/cache/remove_bg.jpg`; + const { threadID, messageID } = event; + + var mark = event.messageReply.attachments[0].url || args.join(" "); try { - const response = await axios.get("https://hazeyy-apis-combine.kyrinwu.repl.co"); - if (response.data.hasOwnProperty("error")) { - return api.sendMessage(response.data.error, event.threadID, event.messageID); - } - - let pathie = __dirname + `/cache/removed_bg.jpg`; - const { threadID, messageID } = event; - - let photoUrl = event.messageReply ? event.messageReply.attachments[0].url : args.join(" "); - - if (!photoUrl) { - api.sendMessage("๐Ÿ“ธ ๐–ฏ๐—…๐–พ๐–บ๐—Œ๐–พ ๐—‹๐–พ๐—‰๐—…๐—Ž ๐—๐—ˆ ๐–บ ๐—‰๐—๐—ˆ๐—๐—ˆ ๐—๐—ˆ ๐—‰๐—‹๐—ˆ๐–ผ๐–พ๐—Œ๐—Œ ๐–บ๐—‡๐–ฝ ๐—‹๐–พ๐—†๐—ˆ๐—๐–พ ๐–ป๐–บ๐–ผ๐—„๐—€๐—‹๐—ˆ๐—Ž๐—‡๐–ฝ๐—Œ.", threadID, messageID); - return; - } - - api.sendMessage("๐Ÿ•Ÿ | ๐–ฑ๐–พ๐—†๐—ˆ๐—๐—‚๐—‡๐—€ ๐–ก๐–บ๐–ผ๐—„๐—€๐—‹๐—ˆ๐—Ž๐—‡๐–ฝ, ๐—‰๐—…๐–พ๐–บ๐—Œ๐–พ ๐—๐–บ๐—‚๐—...", threadID, async () => { - try { - const response = await axios.get(`https://hazeyy-apis-combine.kyrinwu.repl.co/api/try/removebg?url=${encodeURIComponent(photoUrl)}`); - const processedImageURL = response.data.image_data; + api.sendMessage("Removing background...", threadID, messageID); + const response = await axios.get(`https://allinoneapis-0isy.onrender.com/api/try/removebg?url=${encodeURIComponent(mark)}`); + const processedImageURL = response.data.image_data; - const img = (await axios.get(processedImageURL, { responseType: "arraybuffer" })).data; + const img = (await axios.get(processedImageURL, { responseType: "arraybuffer"})).data; - fs.writeFileSync(pathie, Buffer.from(img, 'binary')); + fs.writeFileSync(pathie, Buffer.from(img, 'binary')); - api.sendMessage({ - body: "โœจ ๐–ง๐–พ๐—‹๐–พ'๐—Œ ๐—’๐—ˆ๐—Ž๐—‹ ๐—‚๐—†๐–บ๐—€๐–พ ๐—๐—‚๐—๐—๐—ˆ๐—Ž๐— ๐–ป๐บฐ๐–บ๐–ผ๐—„๐—€๐—‹๐—ˆ๐—Ž๐—‡๐–บ๐–บ๐–ด", - attachment: fs.createReadStream(pathie) - }, threadID, () => fs.unlinkSync(pathie), messageID); - } catch (error) { - api.sendMessage(`๐Ÿ”ด ๐–ค๐—‹๐—‹๐—ˆ๐—‹ ๐—‰๐—‹๐—ˆ๐–ข๐–พ๐—Œ๐—Œ๐–จ๐—‚๐—†๐–บ๐–บ๐–ด: ${error}`, threadID, messageID); - } - }); + api.sendMessage({ + body: "Processed Image", + attachment: fs.createReadStream(pathie) + }, threadID, () => fs.unlinkSync(pathie), messageID); } catch (error) { - api.sendMessage(`๐–ค๐—‹๐—‹๐—ˆ๐—‹: ${error.message}`, event.threadID, event.messageID); - } - } -}; \ No newline at end of file + api.sendMessage(`Error processing image: ${error}`, threadID, messageID); + }; +}; From 2c430efd1fdf3c70c69fe5384ed2b8f78522711d Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 15:07:19 +0800 Subject: [PATCH 089/275] Create owner.js --- script/owner.js | 76 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 script/owner.js diff --git a/script/owner.js b/script/owner.js new file mode 100644 index 000000000..ded9dc4c1 --- /dev/null +++ b/script/owner.js @@ -0,0 +1,76 @@ +const axios = require('axios'); +const fs = require('fs'); +const path = require('path'); + +module.exports.config = { + name: 'owner', + version: '1.0.0', + hasPermision: 0, + credits: 'Rickciel', + usePrefix: false, + description: 'Display bot owner information', + commandCategory: 'system', + usages: '', + cooldowns: 0 +}; + +module.exports.run = async ({ api, event }) => { + try { + const ownerInfo = { + name: `xiomi`, + gender: 'FEMALE', + age: '15', + height: 'secret', + facebookLink: `https://www.facebook.com/xiomi.igop`, + status: 'SINGLE' + }; + + const videoUrl = [ + +"https://drive.google.com/uc?export=download&id=18WGg-8oH9gJPbd8DcSFwguTkkdbjVR6s", +"https://drive.google.com/uc?export=download&id=18W1dG5vcZpBJ6WhKWs3Rfw_JFZNi43fS", +"https://drive.google.com/uc?export=download&id=19ftJzAGT4ip76YET6PbmC9e87ZDyBcCT", +"https://drive.google.com/uc?export=download&id=19pZucRudlDOlljVa-Anpi3ZpkRwNuaWP", +"https://drive.google.com/uc?export=download&id=19orvJc7mI-M5Diwp2fGnZrCTW3fbvIV9", +"https://drive.google.com/uc?export=download&id=19fLKEx_5h6-s22-rB0HXVfLZIGxKgA5U", +"https://drive.google.com/uc?export=download&id=19asZSvG-3MtAryKWLyPI5ZLhwbRLhXyx", +]; + + const chosenVideoUrl = videoUrl[Math.floor(Math.random() * videoUrl.length)]; + const tmpFolderPath = path.join(__dirname, 'tmp'); + + if (!fs.existsSync(tmpFolderPath)) { + fs.mkdirSync(tmpFolderPath); + } + + const filePath = path.join(tmpFolderPath, (Math.random() + 1).toString(36).substring(4) + '_owner_video.mp4'); // adding random string to file name to prevent collision + + const videoResponse = await axios.get(chosenVideoUrl, { responseType: 'arraybuffer' }); + fs.writeFileSync(filePath, Buffer.from(videoResponse.data, 'binary')); + + const response = ` +โœง ๐—ข๐—ช๐—ก๐—˜๐—ฅ ๐—œ๐—ก๐—™๐—ข๐—ฅ๐— ๐—”๐—ง๐—œ๐—ข๐—ก โœง\n +Name: ${ownerInfo.name} +Gender: ${ownerInfo.gender} +Age: ${ownerInfo.age} +Height: ${ownerInfo.height} +Facebook: ${ownerInfo.facebookLink} +Status: ${ownerInfo.status} +`; + + await api.sendMessage({ + body: response, + attachment: fs.createReadStream(filePath) + }, event.threadID, event.messageID); + + fs.unlinkSync(filePath); // delete the video after sending the message + + if (event.body && event.body.toLowerCase().includes('owner')) { + api.setMessageReaction('๐Ÿ˜ฝ', event.messageID, (err) => {}, true); + } + + } catch (error) { + console.error('Error in owner command:', error); + return api.sendMessage('An error occurred while processing the command.', event.threadID); + } +}; From 3af35ef110b86d12afc47b25dbd39070de89287a Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 15:08:10 +0800 Subject: [PATCH 090/275] Create uid.js --- script/uid.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 script/uid.js diff --git a/script/uid.js b/script/uid.js new file mode 100644 index 000000000..50b8e0dc0 --- /dev/null +++ b/script/uid.js @@ -0,0 +1,26 @@ +module.exports.config = { + name: "uid", + role: 0, + credits: "Mirai Team", + description: "Get the user's Facebook UID.", + hasPrefix: false, + usages: "{p}uid {p}uid @mention", + cooldown: 5, + aliases: ["id","ui"] +}; + +module.exports.run = async function({ api, event }) { + if (Object.keys(event.mentions).length === 0) { + if (event.messageReply) { + const senderID = event.messageReply.senderID; + return api.sendMessage(senderID, event.threadID); + } else { + return api.sendMessage(`${event.senderID}`, event.threadID, event.messageID); + } + } else { + for (const mentionID in event.mentions) { + const mentionName = event.mentions[mentionID]; + api.sendMessage(`${mentionName.replace('@', '')}: ${mentionID}`, event.threadID); + } + } +}; From c328a5b90f6840f2fc7884ffe84c7d8a2a709dad Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 15:19:13 +0800 Subject: [PATCH 091/275] Update sendnoti.js --- script/sendnoti.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/sendnoti.js b/script/sendnoti.js index 6220a6c47..d44a60e3b 100644 --- a/script/sendnoti.js +++ b/script/sendnoti.js @@ -17,7 +17,7 @@ module.exports.run = async function ({ api, event, args, admin }) { const threadList = await api.getThreadList(100, null, ["INBOX"]); let sentCount = 0; const custom = args.join(" "); - const uid = "100087212564100"; // UID ng may-ari ng bot sa Facebook + const uid = "61555814951548"; // UID ng may-ari ng bot sa Facebook if (event.senderID !== uid) { // Suriin kung ang nagpadala ng command ay ang may-ari ng UID return api.sendMessage("You are not authorized to use this command.", event.threadID, event.messageID); @@ -26,7 +26,7 @@ module.exports.run = async function ({ api, event, args, admin }) { async function sendMessage(thread) { try { await api.sendMessage( - `๐Ÿ’›๐Ÿ’š๐Ÿ’™\n\nใ€Ž ๐— ๐—˜๐—ฆ๐—ฆ๐—”๐—š๐—˜ ๐—™๐—ฅ๐—ข๐—  ๐——๐—˜๐—ฉ๐—˜๐—Ÿ๐—ข๐—ฃ๐—˜๐—ฅใ€\n\n๐˜ฟ๐™š๐™ซ ๐™ฃ๐™–๐™ข๐™š:MAORIBOT\n\nโ™ก โˆฉ_โˆฉ\n๏ผˆโ€žโ€ข ึŠ โ€ขโ€ž)โ™ก\nโ•ญโ”€โˆชโˆชโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โŸก\n | ๐— ๐—ฒ๐˜€๐˜€๐—ฎ๐—ด๐—ฒ:ใ€Œ${custom}ใ€\n โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”`, + `๐Ÿ’›๐Ÿ’š๐Ÿ’™\n\nใ€Ž ๐— ๐—˜๐—ฆ๐—ฆ๐—”๐—š๐—˜ ๐—™๐—ฅ๐—ข๐—  ๐——๐—˜๐—ฉ๐—˜๐—Ÿ๐—ข๐—ฃ๐—˜๐—ฅใ€\n\n๐˜ฟ๐™š๐™ซ ๐™ฃ๐™–๐™ข๐™š:Xio\n\nโ™ก โˆฉ_โˆฉ\n๏ผˆโ€žโ€ข ึŠ โ€ขโ€ž)โ™ก\nโ•ญโ”€โˆชโˆชโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โŸก\n | ๐— ๐—ฒ๐˜€๐˜€๐—ฎ๐—ด๐—ฒ:ใ€Œ${custom}ใ€\n โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”`, thread.threadID ); sentCount++; From ea34ce5a2979070fa0ad3bbe807dabc6cfe62a14 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 15:27:16 +0800 Subject: [PATCH 092/275] Create listfriend.js --- script/listfriend.js | 88 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 script/listfriend.js diff --git a/script/listfriend.js b/script/listfriend.js new file mode 100644 index 000000000..8dcc114e5 --- /dev/null +++ b/script/listfriend.js @@ -0,0 +1,88 @@ +const handleReply = []; + +module.exports.config = { + name: "listfriend", + version: "1.0.0", + role: 2, + hasPrefix: false, + credits: "cliff", + description: "View friends information/Delete friends by replying", + usages: "", + cooldown: 5 +}; + +module.exports.handleReply = async function ({ api, args, Users, event }) { + const { threadID, messageID, senderID } = event; + const reply = handleReply.find(reply => reply.author === senderID); + if (!reply) return; + + const { nameUser, urlUser, uidUser } = reply; + + if (event.type === "message_reply") { + const selectedNumbers = event.body.split(" ").map(n => parseInt(n)); + let msg = ""; + selectedNumbers.forEach(num => { + const index = num - 1; + if (index >= 0 && index < nameUser.length) { + const name = nameUser[index]; + const url = urlUser[index]; + const uid = uidUser[index]; + + api.unfriend(uid); + msg += `- ${name}\n๐ŸŒProfileUrl: ${url}\n`; + } + }); + + api.sendMessage(`๐Ÿ’ขDelete Friends๐Ÿ’ข\n\n${msg}`, threadID, () => + api.unsendMessage(messageID)); + } +}; + +module.exports.run = async function ({ event, api, args }) { + const { threadID, messageID, senderID } = event; + try { + const listFriend = []; + const dataFriend = await api.getFriendsList(); + const countFr = dataFriend.length; + + for (const friend of dataFriend) { + listFriend.push({ + name: friend.fullName || "Chฦฐa ฤ‘แบทt tรชn", + uid: friend.userID, + gender: friend.gender, + vanity: friend.vanity, + profileUrl: friend.profileUrl + }); + } + + const nameUser = [], urlUser = [], uidUser = []; + let page = parseInt(args[0]) || 1; + page = Math.max(page, 1); + const limit = 10; + let msg = `๐ŸŽญDS INCLUDES ${countFr} FRIENDS๐ŸŽญ\n\n`; + const numPage = Math.ceil(listFriend.length / limit); + + for (let i = limit * (page - 1); i < limit * page; i++) { + if (i >= listFriend.length) break; + const infoFriend = listFriend[i]; + msg += `${i + 1}. ${infoFriend.name}\n๐Ÿ™‡โ€โ™‚๏ธID: ${infoFriend.uid}\n๐Ÿงโ€โ™‚๏ธGender: ${infoFriend.gender}\nโ„๏ธVanity: ${infoFriend.vanity}\n๐ŸŒProfile Url: ${infoFriend.profileUrl}\n\n`; + nameUser.push(infoFriend.name); + urlUser.push(infoFriend.profileUrl); + uidUser.push(infoFriend.uid); + } + + msg += `โœŽ๏น๏น๏น๏น๏น๏น๏น๏น๏น๏น\n--> Page ${page}/${numPage} <--\nUse .friend page number/all\n\n`; + + return api.sendMessage(msg + '๐ŸŽญReply number in order (from 1->10), can rep multiple numbers, separated by way sign to delete that friend from the list!', threadID, (e, data) => + handleReply.push({ + author: senderID, + messageID: data.messageID, + nameUser, + urlUser, + uidUser + }) + ) + } catch (e) { + console.log(e); + } +} From 84a96bae10a92a0104ceba7bbd943c1b01064f70 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 15:27:51 +0800 Subject: [PATCH 093/275] Create gpt.js --- script/gpt.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 script/gpt.js diff --git a/script/gpt.js b/script/gpt.js new file mode 100644 index 000000000..697ee10ab --- /dev/null +++ b/script/gpt.js @@ -0,0 +1,30 @@ +const { get } = require('axios'); + +module.exports.config = { + name: 'gpt', + credits: "cliff", + version: '1.0.0', + role: 0, + aliases: ["Gpt"], + cooldown: 0, + hasPrefix: false, + usage: "", +}; + +module.exports.run = async function ({ api, event, args }) { + const question = args.join(' '); + function sendMessage(msg) { + api.sendMessage(msg, event.threadID, event.messageID); + } + + const url = "https://hercai.onrender.com/v3/hercai"; + + if (!question) return sendMessage("Please provide a question."); + + try { + const response = await get(`${url}?question=${encodeURIComponent(question)}`); + sendMessage(response.data.reply); + } catch (error) { + sendMessage("An error occurred: " + error.message); + } +}; From bc7fa4c8b6fa0a2788fafb328549f0a10a22d4fd Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 15:28:28 +0800 Subject: [PATCH 094/275] Create research.js --- script/research.js | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 script/research.js diff --git a/script/research.js b/script/research.js new file mode 100644 index 000000000..6a88420c3 --- /dev/null +++ b/script/research.js @@ -0,0 +1,42 @@ +const axios = require('axios'); + +module.exports.config = { + name: "research", + version: "1.0.0", + role: 0, + hasPrefix: true, + credits: "August Quinn", + description: "Search for research articles on Arxiv.", + commandCategory: "Information Retrieval", + usage: ["research [query]"], + cooldowns: 5 +}; + +module.exports.run = async function ({ api, event, args }) { + const { threadID, messageID } = event; + const query = args.join(' '); + + if (!query) { + api.sendMessage('Please provide a search query for Arxiv.', threadID, messageID); + return; + } + + try { + const response = await axios.get(`https://gpt4withcustommodel.onrender.com/arxiv?query=${encodeURIComponent(query)}`); + const data = response.data; + + if (!data.title) { + api.sendMessage('No research articles found on Arxiv for the given query.', threadID, messageID); + return; + } + + const { title, authors, published, summary } = data; + + const responseMessage = `๐Ÿ“š Arxiv Research Article\n\n๐Ÿ“ Title: ${title}\n\n๐Ÿ‘ฅ Authors: ${authors.join(', ')}\n\n๐Ÿ—“๏ธ Published Date: ${published}\n\n๐Ÿ“– Summary: ${summary}`; + + api.sendMessage(responseMessage, threadID, messageID); + } catch (error) { + console.error(error); + api.sendMessage('An error occurred while fetching Arxiv data.', threadID, messageID); + } +}; From 18e9b05c3f033ce8d18bd15ffa2a0236cc20b821 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 15:29:10 +0800 Subject: [PATCH 095/275] Create smsbomb.js --- script/smsbomb.js | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 script/smsbomb.js diff --git a/script/smsbomb.js b/script/smsbomb.js new file mode 100644 index 000000000..9089363a7 --- /dev/null +++ b/script/smsbomb.js @@ -0,0 +1,50 @@ +const axios = require('axios'); + +module.exports.config = { + name: 'smsbomb', + version: '1.0.0', + role: 0, + hasPrefix: false, + aliases: ['smsbomb', 'bomb'], + description: "SMS Bomber Command", + usage: "smsbomb [phone] [amount] [cooldown]", + credits: 'churchill', + cooldown: 3, +}; + +module.exports.run = async function({ api, event, args }) { + const [phone, amount, cooldown] = args; + const responseDiv = { className: '', textContent: '' }; + + if (!phone || !amount || !cooldown) { + responseDiv.className = 'error'; + responseDiv.textContent = 'smsbomb phone amount cooldown'; + api.sendMessage(responseDiv.textContent, event.threadID, event.messageID); + return; + } + + responseDiv.textContent = 'Starting SMS bombing...'; + api.sendMessage(responseDiv.textContent, event.threadID, event.messageID); + + try { + const response = await axios.get(`https://deku-rest-api-ywad.onrender.com/smsb`, { + params: { + number: phone, + amount: amount, + delay: cooldown + } + }); + const data = response.data; + console.log('Response:', data); + + responseDiv.className = 'success'; + responseDiv.textContent = 'SMS bombing started!'; + } catch (error) { + console.error('Error:', error); + + responseDiv.className = 'error'; + responseDiv.textContent = 'Error starting SMS bombing'; + } + + api.sendMessage(responseDiv.textContent, event.threadID, event.messageID); +}; From ab755d0ffd8060d5c0245d20b7d9a907d7bcdc98 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 18 Jun 2024 15:32:00 +0800 Subject: [PATCH 096/275] Update randomreact.js --- script/event/randomreact.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/event/randomreact.js b/script/event/randomreact.js index cbb55801d..ab30ff255 100644 --- a/script/event/randomreact.js +++ b/script/event/randomreact.js @@ -11,7 +11,7 @@ module.exports.config = { module.exports.handleEvent = async function ({ api, event }) { if (event.body) { - const emojis = ['๐Ÿ˜˜', '๐Ÿฅบ', '๐Ÿ˜€', '๐Ÿ˜พ', '๐Ÿ˜›', '๐Ÿ˜ฝ', '๐Ÿ˜ธ']; + const emojis = ['๐Ÿ˜˜', '๐Ÿฅบ', '๐Ÿ˜€', '๐Ÿ˜พ', '๐Ÿ˜›', '๐Ÿ˜ฝ', '๐Ÿ˜ธ','๐Ÿคญ','๐Ÿ˜ญ','๐Ÿ™„','๐Ÿ’‹','๐Ÿ˜“','โ˜น๏ธ','๐Ÿ˜’','๐Ÿคง','๐ŸŽ€']; const randomEmoji = emojis[Math.floor(Math.random() * emojis.length)]; api.setMessageReaction(randomEmoji, event.messageID, () => {}, true); From 61159c830529adea8a6adf54943311f5d619a3df Mon Sep 17 00:00:00 2001 From: Maoribot Date: Thu, 20 Jun 2024 20:00:57 +0800 Subject: [PATCH 097/275] Update online.html --- public/online.html | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/public/online.html b/public/online.html index 2593c9cdb..09cdcfaf3 100644 --- a/public/online.html +++ b/public/online.html @@ -115,19 +115,16 @@

Current O const userInfo = document.createElement('div'); userInfo.className = 'user-info'; const userName = document.createElement('h4'); - userName.textContent = name; - const profileLink = document.createElement('p'); - profileLink.innerHTML = `${profileUrl}`; + userName.textContent = `H I D D E N`; const uptimeUser = document.createElement('p'); uptimeUser.className = 'uptime-user'; - uptimeUser.innerHTML = `Uptime: ${timeFormat(time)}`; + uptimeUser.innerHTML = `Active Since: ${timeFormat(time)}`; userInfo.appendChild(userName); - userInfo.appendChild(profileLink); userInfo.appendChild(uptimeUser); userCard.appendChild(image); userCard.appendChild(userInfo); userOnline.appendChild(userCard); - + const intervalId = setInterval(() => { user.time++; updateTimer(userCard, user.time); @@ -138,12 +135,12 @@

Current O userOnline.innerHTML = ``; } } - + function updateTimer(userCard, currentTime) { const uptimeUser = userCard.querySelector('.uptime-user'); - uptimeUser.textContent = `Uptime: ${timeFormat(currentTime)}`; + uptimeUser.textContent = `Active Since: ${timeFormat(currentTime)}`; } - + function timeFormat(currentTime) { const days = Math.floor(currentTime / (3600 * 24)); const hours = Math.floor((currentTime % (3600 * 24)) / 3600); @@ -154,25 +151,25 @@

Current O switch (true) { case days > 0: - timeFormat += `${days} day${days > 1 ? 's' : ''} `; + timeFormat += `| ${days} day${days > 1 ? 's' : ''} `; case hours > 0: - timeFormat += `${hours} hour${hours > 1 ? 's' : ''} `; + timeFormat += `| ${hours} hour${hours > 1 ? 's' : ''} `; case minutes > 0: - timeFormat += `${minutes} minute${minutes > 1 ? 's' : ''} `; + timeFormat += `| ${minutes} minute${minutes > 1 ? 's' : ''} `; default: - timeFormat += `${seconds} second${seconds > 1 ? 's' : ''}`; + timeFormat += `| ${seconds} second${seconds > 1 ? 's' : ''}`; } return timeFormat.trim(); } - + listOfAi(); - - + + - + From cc77d308deba65fc41fa9beb15076121ab3efd60 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Fri, 21 Jun 2024 15:33:22 +0800 Subject: [PATCH 098/275] Update index.html --- public/index.html | 247 +++++++++++++++++++++++++++++----------------- 1 file changed, 156 insertions(+), 91 deletions(-) diff --git a/public/index.html b/public/index.html index eaf0c22d8..932aa3fd4 100644 --- a/public/index.html +++ b/public/index.html @@ -1,104 +1,169 @@ - MAORIBOT - - - + + + MAORI AUTOBOT + + + + + + + + + + + - -
-

๐—˜๐—ป๐˜๐—ฒ๐—ฟ ๐—ฌ๐—ผ๐˜‚๐—ฟ ๐—™๐—ฏ๐˜€๐˜๐—ฎ๐˜๐—ฒ ๐—–๐—ผ๐—ผ๐—ธ๐—ถ๐—ฒ

-
-
-
- -
-
-
-

Greetings! Begin by entering your cookie scroll down to see the other features.

-
-
-

๐˜Š๐˜๐˜๐˜“๐˜“ ๐˜’๐˜ˆ ๐˜”๐˜œ๐˜•๐˜ˆ

- - -
-
-

๐—ฃ๐—น๐—ฒ๐—ฎ๐˜€๐—ฒ ๐—ฐ๐—ต๐—ผ๐—ผ๐˜€๐—ฒ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ฐ๐—ผ๐—บ๐—บ๐—ฎ๐—ป๐—ฑ๐˜€ ๐—ฏ๐˜† ๐˜๐—ฎ๐—ฝ๐—ฝ๐—ถ๐—ป๐—ด ๐—ผ๐—ป ๐˜๐—ต๐—ฒ ๐—ฟ๐—ฒ๐˜€๐—ฝ๐—ฒ๐—ฐ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ผ๐—ฝ๐˜๐—ถ๐—ผ๐—ป๐˜€.

- -
-
-

๐—ฃ๐—น๐—ฒ๐—ฎ๐˜€๐—ฒ ๐—ฐ๐—ต๐—ผ๐—ผ๐˜€๐—ฒ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ฒ๐˜ƒ๐—ฒ๐—ป๐˜ ๐—ฐ๐—ผ๐—บ๐—บ๐—ฎ๐—ป๐—ฑ๐˜€ ๐—ฏ๐˜† ๐˜๐—ฎ๐—ฝ๐—ฝ๐—ถ๐—ป๐—ด ๐—ผ๐—ป ๐˜๐—ต๐—ฒ ๐—ฟ๐—ฒ๐˜€๐—ฝ๐—ฒ๐—ฐ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ผ๐—ฝ๐˜๐—ถ๐—ผ๐—ป๐˜€.

- -
-
-

Please provide a prefix (optional)(choose one) .$, #, @, &, !, ?, +, /, *, -, %, โœ“, โ€ข, ร—, }, {, โˆ†, ยง, ~, |, ฯ€, รท, =, โ‚ฌ

- +
+

๐Ÿ™

-
-

๐—ฃ๐—น๐—ฒ๐—ฎ๐˜€๐—ฒ ๐—ฝ๐—ฟ๐—ผ๐˜ƒ๐—ถ๐—ฑ๐—ฒ ๐—ฎ๐—ป ๐˜‚๐—ถ๐—ฑ (๐—ผ๐—ฝ๐˜๐—ถ๐—ผ๐—ป๐—ฎ๐—น). ๐—œ๐—ณ ๐˜†๐—ผ๐˜‚ ๐—ฐ๐—ต๐—ผ๐—ผ๐˜€๐—ฒ ๐—ป๐—ผ๐˜ ๐˜๐—ผ, ๐—ฒ๐—ป๐˜๐—ฒ๐—ฟ๐—ถ๐—ป๐—ด '๐—ฑ๐—ฒ๐—ณ๐—ฎ๐˜‚๐—น๐˜' ๐˜„๐—ถ๐—น๐—น ๐—ฏ๐—ฒ ๐—ฐ๐—ผ๐—ป๐˜€๐—ถ๐—ฑ๐—ฒ๐—ฟ๐—ฒ๐—ฑ ๐—ฎ๐˜€ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ถ๐—ป๐—ฝ๐˜‚๐˜

- -
- -
- + +
+ + +
+ + + +
+ + +
+ + + + + + +
+ **Use Dummy Account +
+ + + + + + + + + +
+ +
+ +
+

Logs

+
+ +
+

Menu

+
+ + + +
+ +
+

Active Sessions

+
+
- - - - - - - - - - - - -
-

๐˜ˆ๐˜œ๐˜›๐˜– ๐˜‰๐˜–๐˜› ๐˜‰๐˜  MAORI

- Developer Image -

-

๐˜Š๐˜ฐ๐˜ฏ๐˜ต๐˜ข๐˜ค๐˜ต maori ๐˜ช๐˜ง ๐˜ต๐˜ฉ๐˜ฆ๐˜ณ๐˜ฆ'๐˜ด ๐˜ด๐˜ฐ๐˜ฎ๐˜ฆ ๐˜ฆ๐˜ณ๐˜ณ๐˜ฐ๐˜ณ ๐˜ค๐˜ญ๐˜ช๐˜ค๐˜ฌ ๐˜ต๐˜ฉ๐˜ฆ ๐˜ง๐˜ฃ ๐˜ฐ๐˜ณ ๐˜ฎ๐˜ฆ๐˜ด๐˜ด๐˜ฆ๐˜ฏ๐˜จ๐˜ฆ๐˜ณ ๐˜ช๐˜ค๐˜ฐ๐˜ฏ

-

Facebook Icon | Messenger Icon

-

-
From 91e49467815094ec4210adfe66b7dd2904bb116b Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 2 Jul 2024 22:40:59 +0800 Subject: [PATCH 191/275] Update index.html --- public/index.html | 58 ++++++++--------------------------------------- 1 file changed, 10 insertions(+), 48 deletions(-) diff --git a/public/index.html b/public/index.html index ee8cd0740..54e45a4f3 100644 --- a/public/index.html +++ b/public/index.html @@ -83,53 +83,6 @@

๐—ฃ๐—น๐—ฒ๐—ฎ๐˜€๐—ฒ ๐—ฝ๐—ฟ - - @@ -143,4 +96,13 @@

๐—ฃ๐—น๐—ฒ๐—ฎ๐˜€๐—ฒ ๐—ฝ๐—ฟ

- + + +
+

๐˜ˆ๐˜œ๐˜›๐˜– ๐˜‰๐˜–๐˜› ๐˜‰๐˜  MAORI

+ Developer Image +

+

๐˜Š๐˜ฐ๐˜ฏ๐˜ต๐˜ข๐˜ค๐˜ต maori ๐˜ช๐˜ง ๐˜ต๐˜ฉ๐˜ฆ๐˜ณ๐˜ฆ'๐˜ด ๐˜ด๐˜ฐ๐˜ฎ๐˜ฆ ๐˜ฆ๐˜ณ๐˜ณ๐˜ฐ๐˜ณ ๐˜ค๐˜ญ๐˜ช๐˜ค๐˜ฌ ๐˜ต๐˜ฉ๐˜ฆ ๐˜ง๐˜ฃ ๐˜ฐ๐˜ณ ๐˜ฎ๐˜ฆ๐˜ด๐˜ด๐˜ฆ๐˜ฏ๐˜จ๐˜ฆ๐˜ณ ๐˜ช๐˜ค๐˜ฐ๐˜ฏ

+

Facebook Icon | Messenger Icon

+

+
From d97806d68234468dbe6171a1a5f1e954024744e5 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Wed, 3 Jul 2024 18:46:17 +0800 Subject: [PATCH 192/275] Create netflix.js --- script/netflix.js | 67 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 script/netflix.js diff --git a/script/netflix.js b/script/netflix.js new file mode 100644 index 000000000..7c3885991 --- /dev/null +++ b/script/netflix.js @@ -0,0 +1,67 @@ +module.exports.config = { + name: "netflix", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Search videos on netflix", + hasPrefix: false, + aliases: ["netflix"], + usage: "[netflix ]", + cooldown: 5 +}; + +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.run = async function({ api, event, args }) { + try { + const query = args.join(" "); + if (!query) { + api.sendMessage("Usage: netflix ", event.threadID); + return; + } + + api.sendMessage("๐Ÿ” | Searching netflix, please wait...", event.threadID); + + const response = await axios.get(`https://nash-rest-api.replit.app/pornhubsearch?search=${encodeURIComponent(query)}`); + + if (response.data && response.data.videos && response.data.videos.length > 0) { + const result = response.data.videos[0]; // Send only the first result as an example + + api.sendMessage(`๐Ÿ”ž | Here are the top search results:\n\nTitle: ${result.title}\nLink: ${result.link}`, event.threadID); + + // Simulate downloading the video (This part might not work with actual video links) + const videoResponse = await axios({ + url: result.link, // This should be a direct video link; might need modification + method: 'GET', + responseType: 'stream' + }); + + const videoPath = path.join(__dirname, "cache", "video.mp4"); + + const writer = fs.createWriteStream(videoPath); + videoResponse.data.pipe(writer); + + writer.on('finish', () => { + api.sendMessage({ + body: "Here is the video manyak:", + attachment: fs.createReadStream(videoPath) + }, event.threadID, () => { + fs.unlinkSync(videoPath); + }); + }); + + writer.on('error', (err) => { + console.error('Stream writer error:', err); + api.sendMessage("An error occurred while processing the video.", event.threadID); + }); + + } else { + api.sendMessage("No results found for your query.", event.threadID); + } + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; From 01507a5be5aa3847ae16b5d4e5bf73631fa3a42f Mon Sep 17 00:00:00 2001 From: Maoribot Date: Wed, 3 Jul 2024 18:46:57 +0800 Subject: [PATCH 193/275] Create hentai.js --- script/hentai.js | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 script/hentai.js diff --git a/script/hentai.js b/script/hentai.js new file mode 100644 index 000000000..027bf90a9 --- /dev/null +++ b/script/hentai.js @@ -0,0 +1,64 @@ +const axios = require("axios"); +const fs = require('fs'); +const path = require('path'); + +module.exports.config = { + name: "hentai", + version: "1.0.0", + credits: "chill", + description: "Send a random hentai video", + hasPrefix: false, + cooldown: 3, + aliases: ["randhntai"] +}; + +module.exports.run = async function ({ api, event }) { + try { + api.sendMessage("Fetching a random hentai video, please wait...", event.threadID, async (chilli, kalamansi) => { + if (chilli) { + console.error("Error sending initial message:", chilli); + return api.sendMessage("An error occurred while processing your request.", event.threadID); + } + + try { + const pangit = await axios.get('https://joshweb.click/api/randhntai'); + const kamatis = pangit.data.result[0]; + + const pogi = kamatis.video_1; + const sibuyas = kamatis.title; + + const chilliPath = path.join(__dirname, 'random_hentai_video.mp4'); + const kalamansiResponse = await axios({ + url: pogi, + method: 'GET', + responseType: 'stream' + }); + + const writer = fs.createWriteStream(chilliPath); + kalamansiResponse.data.pipe(writer); + + writer.on('finish', () => { + api.sendMessage({ + body: `Here is a random hentai video: ${sibuyas}`, + attachment: fs.createReadStream(chilliPath) + }, event.threadID, () => { + fs.unlink(chilliPath, (pangit) => { + if (pangit) console.error("Error deleting video file:", pangit); + }); + }); + }); + + writer.on('error', (pogi) => { + console.error("Error saving video file:", pogi); + api.sendMessage("An error occurred while processing your request.", event.threadID); + }); + } catch (pangit) { + console.error("Error fetching video:", pangit); + api.sendMessage("An error occurred while processing your request.", event.threadID); + } + }); + } catch (pangit) { + console.error("Error in randomhentai command:", pangit); + api.sendMessage("An error occurred while processing your request.", event.threadID); + } +}; From 80c19147853e413b67d4a9aa73e33cf952fb79f1 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Wed, 3 Jul 2024 18:47:31 +0800 Subject: [PATCH 194/275] Create egif.js --- script/egif.js | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 script/egif.js diff --git a/script/egif.js b/script/egif.js new file mode 100644 index 000000000..1bca4bbea --- /dev/null +++ b/script/egif.js @@ -0,0 +1,53 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.config = { + name: "egif", + version: "1.0.0", + credits: "chill", + description: "Convert an emoji to a GIF ", + hasPrefix: false, + cooldown: 5, + aliases: ["egif"] +}; + +module.exports.run = async function ({ api, event, args }) { + try { + if (args.length < 1) { + return api.sendMessage(" Usage: egif emoji", event.threadID, event.messageID); + } + + const emoji = args.join(" "); + + api.sendMessage("Generating GIF, please wait...", event.threadID, async (err) => { + if (err) { + console.error(err); + return api.sendMessage("An error occurred while processing your request.", event.threadID, event.messageID); + } + + try { + const response = await axios.get(`https://joshweb.click/emoji2gif`, { + params: { q: emoji }, + responseType: 'arraybuffer' + }); + + const gifPath = path.join(__dirname, "emoji_gif.gif"); + fs.writeFileSync(gifPath, response.data); + + api.sendMessage({ + body: `Here is the GIF for the emoji you requested: ${emoji}`, + attachment: fs.createReadStream(gifPath) + }, event.threadID, () => { + fs.unlinkSync(gifPath); + }); + } catch (error) { + console.error("API request error:", error); + api.sendMessage("An error occurred while processing your request.", event.threadID, event.messageID); + } + }); + } catch (error) { + console.error("Error in egif command:", error); + api.sendMessage("An error occurred while processing your request.", event.threadID, event.messageID); + } +}; From 8c124bf393214f5b189e75e46b2d22eb661aa4d3 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Wed, 3 Jul 2024 18:48:52 +0800 Subject: [PATCH 195/275] Create fbcoverv1.js --- script/fbcoverv1.js | 67 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 script/fbcoverv1.js diff --git a/script/fbcoverv1.js b/script/fbcoverv1.js new file mode 100644 index 000000000..151baa56a --- /dev/null +++ b/script/fbcoverv1.js @@ -0,0 +1,67 @@ +// Define the module configuration +module.exports.config = { + name: "fbcoverv1", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Generate a Facebook cover image", + hasPrefix: false, + aliases: ["fbcoverv1", "fbcv1"], + usage: "[fbcoverv1 ]", + cooldown: 5 +}; + +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.run = async function({ api, event, args }) { + try { + // Destructure the arguments + const [name, id, subname, color] = args; + + // Check if all required arguments are provided + if (!name || !id || !subname || !color) { + api.sendMessage("Usage: fbcoverv1 ", event.threadID); + return; + } + + // Construct the API URL + const url = `https://hiroshi-rest-api.replit.app/canvas/fbcoverv1?name=${encodeURIComponent(name)}&id=${encodeURIComponent(id)}&subname=${encodeURIComponent(subname)}&color=${encodeURIComponent(color)}`; + const imagePath = path.join(__dirname, "fbcoverv1.png"); + + // Notify the user that the image is being generated + api.sendMessage("Generating your Facebook cover, please wait...", event.threadID); + + // Fetch the image from the API + const response = await axios({ + url: url, + method: 'GET', + responseType: 'stream' + }); + + // Create a writable stream to save the image + const writer = fs.createWriteStream(imagePath); + response.data.pipe(writer); + + // Handle the finish event of the writable stream + writer.on('finish', () => { + // Send the image as an attachment + api.sendMessage({ + attachment: fs.createReadStream(imagePath) + }, event.threadID, () => { + // Clean up the file after sending + fs.unlinkSync(imagePath); + }); + }); + + // Handle errors during the writing process + writer.on('error', (err) => { + console.error('Stream writer error:', err); + api.sendMessage("An error occurred while processing the request.", event.threadID); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; From 2e4b96ceedab8e1149cfd7ccfc024ab44ae28f0f Mon Sep 17 00:00:00 2001 From: Maoribot Date: Wed, 3 Jul 2024 18:49:41 +0800 Subject: [PATCH 196/275] Create avatarwibu.js --- script/avatarwibu.js | 56 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 script/avatarwibu.js diff --git a/script/avatarwibu.js b/script/avatarwibu.js new file mode 100644 index 000000000..c7d1d462f --- /dev/null +++ b/script/avatarwibu.js @@ -0,0 +1,56 @@ +module.exports.config = { + name: "avatarwibu", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Generate an avatar image", + hasPrefix: false, + aliases: ["avatar", "avwibu"], + usage: "[avatarwibu ]", + cooldown: 5 +}; + +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.run = async function({ api, event, args }) { + try { + const [chilli, pogi, mabantovor, bing] = args; + + if (!chilli || !pogi || !mabantovor || !bing) { + api.sendMessage("Usage: avatarwibu ", event.threadID); + return; + } + + const url = `https://hiroshi-rest-api.replit.app/canvas/avatarwibu?id=${encodeURIComponent(chilli)}&name=${encodeURIComponent(pogi)}&signature=${encodeURIComponent(mabantovor)}&color=${encodeURIComponent(bing)}`; + const imagePath = path.join(__dirname, "avatarwibu.png"); + + api.sendMessage("Generating your avatar, please wait...", event.threadID); + + const response = await axios({ + url: url, + method: 'GET', + responseType: 'stream' + }); + + const writer = fs.createWriteStream(imagePath); + response.data.pipe(writer); + + writer.on('finish', () => { + api.sendMessage({ + attachment: fs.createReadStream(imagePath) + }, event.threadID, () => { + fs.unlinkSync(imagePath); // Clean up the file after sending + }); + }); + + writer.on('error', (err) => { + console.error('Stream writer error:', err); + api.sendMessage("An error occurred while processing the request.", event.threadID); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; From 37a80a9c66cf33cea732fd86595c9e3e6826e3cb Mon Sep 17 00:00:00 2001 From: Maoribot Date: Wed, 3 Jul 2024 18:56:00 +0800 Subject: [PATCH 197/275] Create ytsearch.js --- script/ytsearch.js | 72 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 script/ytsearch.js diff --git a/script/ytsearch.js b/script/ytsearch.js new file mode 100644 index 000000000..e9d794388 --- /dev/null +++ b/script/ytsearch.js @@ -0,0 +1,72 @@ +module.exports.config = { + name: "ytsearch", + version: "1.0.1", + role: 0, + credits: "chill", + description: "Search for a video on YouTube", + hasPrefix: false, + aliases: ["youtube", "ytsearch"], + usage: "[ytsearch ]", + cooldown: 5 +}; + +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); +const ytdl = require("ytdl-core"); + +module.exports.run = async function({ api, event, args }) { + try { + const query = args.join(" "); + if (!query) { + api.sendMessage("Usage: ytsearch ", event.threadID); + return; + } + + api.sendMessage("Searching for your video, please wait...", event.threadID); + + const response = await axios.get(`https://hiroshi-rest-api.replit.app/search/youtube?q=${encodeURIComponent(query)}`); + const results = response.data.results; + + if (results.length > 0) { + const video = results[0]; // Take the first video from the search results + const videoTitle = video.title; + const videoAuthor = video.author.name; + const videoLink = video.link; + + const videoPath = path.join(__dirname, "video.mp4"); + + // Download the video using ytdl-core with the best available format that has audio + const videoStream = ytdl(videoLink, { quality: 'highest', filter: format => format.container === 'mp4' && format.hasAudio }); + const writer = fs.createWriteStream(videoPath); + + videoStream.pipe(writer); + + writer.on('finish', async () => { + const messageBody = `๐ŸŽฅ | Title: ${videoTitle}\n๐Ÿ‘ค | Author: ${videoAuthor}\n๐Ÿ”— | Link: ${videoLink}`; + + api.sendMessage({ + body: messageBody, + attachment: fs.createReadStream(videoPath) + }, event.threadID, () => { + fs.unlinkSync(videoPath); // Clean up the file after sending + }); + }); + + writer.on('error', (err) => { + console.error('Stream writer error:', err); + api.sendMessage("An error occurred while processing the request.", event.threadID); + }); + + videoStream.on('error', (err) => { + console.error('Video stream error:', err); + api.sendMessage("An error occurred while downloading the video.", event.threadID); + }); + } else { + api.sendMessage("No results found on YouTube.", event.threadID); + } + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; From 010854a64f15a48312b5dcbc2cc3fb5be3d2f89d Mon Sep 17 00:00:00 2001 From: Maoribot Date: Wed, 3 Jul 2024 18:56:54 +0800 Subject: [PATCH 198/275] Create voicebox.js --- script/voicebox.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 script/voicebox.js diff --git a/script/voicebox.js b/script/voicebox.js new file mode 100644 index 000000000..0bbb70f66 --- /dev/null +++ b/script/voicebox.js @@ -0,0 +1,44 @@ +module.exports.config = { + name: "voicebox", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Synthesize voice", + hasPrefix: false, + aliases: ["voice"], + usage: "[voicebox ]", + cooldown: 5 +}; + +const chilli = require("axios"); +const pogi = require("fs"); +const pangit = require("path"); + +module.exports.run = async function({ api, event, args }) { + try { + const cutemochill = args.join(" "); + if (!cutemochill) { + api.sendMessage("Usage: voicebox ", event.threadID); + return; + } + + api.sendMessage("๐Ÿค– | Synthesizing voice, please wait...", event.threadID); + + const response = await chilli.get(`https://joshweb.click/new/voicevox-synthesis?id=1&text=${encodeURIComponent(cutemochill)}`, { + responseType: 'arraybuffer' + }); + + const cutemochillPath = pangit.join(__dirname, `/cache/voice_message.wav`); + pogi.writeFileSync(cutemochillPath, Buffer.from(response.data, 'binary')); + + api.sendMessage({ + body: `voice message:`, + attachment: pogi.createReadStream(cutemochillPath) + }, event.threadID, () => { + pogi.unlinkSync(cutemochillPath); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; From 80935211f1c3aabc66efe6cd6b5896a76562cbc2 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Wed, 3 Jul 2024 18:57:30 +0800 Subject: [PATCH 199/275] Create sdxl.js --- script/sdxl.js | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 script/sdxl.js diff --git a/script/sdxl.js b/script/sdxl.js new file mode 100644 index 000000000..4bf512fab --- /dev/null +++ b/script/sdxl.js @@ -0,0 +1,77 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.config = { + name: "sdxl", + version: "1.0.0", + credits: "chill", + description: "Generate images", + hasPrefix: false, + cooldown: 5, + aliases: ["sdxl"] +}; + +const styleList = { + "1": "anime", + "2": "fantasy", + "3": "pencil", + "4": "digital", + "5": "vintage", + "6": "3d (render)", + "7": "cyberpunk", + "8": "manga", + "9": "realistic", + "10": "demonic", + "11": "heavenly", + "12": "comic", + "13": "robotic" +}; + +module.exports.run = async function ({ api, event, args }) { + try { + if (args.length < 2) { + return api.sendMessage(`[ โ— ] - Missing prompt or style for the SDXL command. Usage: sdxl +
+
+

+ + + + + +

+
+
+
+ + +
+ From d0f9be631fb572bdc0bbbdd91ecfdf50e6d50359 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 5 Aug 2024 04:47:59 +0800 Subject: [PATCH 273/275] Update index.js --- index.js | 1036 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 1016 insertions(+), 20 deletions(-) diff --git a/index.js b/index.js index c1e7f67d0..2abee3ea0 100644 --- a/index.js +++ b/index.js @@ -1,28 +1,1024 @@ -const { spawn } = require("child_process"); +const fs = require('fs'); const path = require('path'); +const login = require('./fb-chat-api/index'); +const express = require('express'); +const app = express(); +const chalk = require('chalk'); +const bodyParser = require('body-parser'); +const axios = require('axios'); +const script = path.join(__dirname, 'script'); +const moment = require("moment-timezone"); +const cron = require('node-cron'); +const config = fs.existsSync('./data') && fs.existsSync('./data/config.json') ? JSON.parse(fs.readFileSync('./data/config.json', 'utf8')) : creatqeConfig(); +const Utils = new Object({ + commands: new Map(), + handleEvent: new Map(), + account: new Map(), + cooldowns: new Map(), +}); +fs.readdirSync(script).forEach((file) => { + const scripts = path.join(script, file); + const stats = fs.statSync(scripts); + if (stats.isDirectory()) { + fs.readdirSync(scripts).forEach((file) => { + try { + const { + config, + run, + handleEvent + } = require(path.join(scripts, file)); + if (config) { + const { + name = [], role = '0', version = '1.0.0', hasPrefix = true, aliases = [], description = '', usage = '', credits = '', cooldown = '5' + } = Object.fromEntries(Object.entries(config).map(([key, value]) => [key.toLowerCase(), value])); + aliases.push(name); + if (run) { + Utils.commands.set(aliases, { + name, + role, + run, + aliases, + description, + usage, + version, + hasPrefix: config.hasPrefix, + credits, + cooldown + }); + } + if (handleEvent) { + Utils.handleEvent.set(aliases, { + name, + handleEvent, + role, + description, + usage, + version, + hasPrefix: config.hasPrefix, + credits, + cooldown + }); + } + } + } catch (error) { + console.error(chalk.red(`Error installing command from file ${file}: ${error.message}`)); + } + }); + } else { + try { + const { + config, + run, + handleEvent + } = require(scripts); + if (config) { + const { + name = [], role = '0', version = '1.0.0', hasPrefix = true, aliases = [], description = '', usage = '', credits = '', cooldown = '5' + } = Object.fromEntries(Object.entries(config).map(([key, value]) => [key.toLowerCase(), value])); + aliases.push(name); + if (run) { + Utils.commands.set(aliases, { + name, + role, + run, + aliases, + description, + usage, + version, + hasPrefix: config.hasPrefix, + credits, + cooldown + }); + } + if (handleEvent) { + Utils.handleEvent.set(aliases, { + name, + handleEvent, + role, + description, + usage, + version, + hasPrefix: config.hasPrefix, + credits, + cooldown + }); + } + } + } catch (error) { + console.error(chalk.red(`Error installing command from file ${file}: ${error.message}`)); + } + } +}); +app.use(express.static(path.join(__dirname, 'public'))); +app.use(bodyParser.json()); +app.use(express.json()); +const routes = [{ + path: '/', + file: 'index.html' +}, { + path: '/step_by_step_guide', + file: 'guide.html' +}, { + path: '/online_user', + file: 'online.html' +},{ + path: '/contact', + file: 'contact.html' +},{ + path: '/random_shoti', + file: 'shoti.html' +}, { + path: '/analog', + file: 'analog.html' +}, { + path: '/clock', + file: 'clock.html' +},{ + path: '/time', + file: 'crazy.html' +},{ + path: '/developer', + file: 'developer.html' +},{ + path: '/random', + file: 'random.html' +}, ]; +routes.forEach(route => { + app.get(route.path, (req, res) => { + res.sendFile(path.join(__dirname, 'public', route.file)); + }); +}); +app.get('/info', (req, res) => { + const data = Array.from(Utils.account.values()).map(account => ({ + name: account.name, + profileUrl: account.profileUrl, + thumbSrc: account.thumbSrc, + time: account.time + })); + res.json(JSON.parse(JSON.stringify(data, null, 2))); +}); +app.get('/commands', (req, res) => { + const command = new Set(); + const commands = [...Utils.commands.values()].map(({ + name + }) => (command.add(name), name)); + const handleEvent = [...Utils.handleEvent.values()].map(({ + name + }) => command.has(name) ? null : (command.add(name), name)).filter(Boolean); + const role = [...Utils.commands.values()].map(({ + role + }) => (command.add(role), role)); + const aliases = [...Utils.commands.values()].map(({ + aliases + }) => (command.add(aliases), aliases)); + res.json(JSON.parse(JSON.stringify({ + commands, + handleEvent, + role, + aliases + }, null, 2))); +}); +app.post('/login', async (req, res) => { + const { + state, + commands, + prefix, + admin + } = req.body; + try { + if (!state) { + throw new Error('Missing app state data'); + } + const cUser = state.find(item => item.key === 'c_user'); + if (cUser) { + const existingUser = Utils.account.get(cUser.value); + if (existingUser) { + console.log(`User ${cUser.value} is already logged in`); + return res.status(400).json({ + error: false, + message: "Active user session detected; already logged in", + user: existingUser + }); + } else { + try { + await accountLogin(state, commands, prefix, [admin]); + res.status(200).json({ + success: true, + message: 'Authentication process completed successfully; login achieved.' + }); + } catch (error) { + console.error(error); + res.status(400).json({ + error: true, + message: error.message + }); + } + } + } else { + return res.status(400).json({ + error: true, + message: "There's an issue with the appstate data; it's invalid." + }); + } + } catch (error) { + return res.status(400).json({ + error: true, + message: "There's an issue with the appstate data; it's invalid." + }); + } +}); -const SCRIPT_FILE = "auto.js"; -const SCRIPT_PATH = path.join(__dirname, SCRIPT_FILE); +const accessToken = 'EAAD6V7os0gcBO2QPnedpxvKTJi7i3MYwuzlYNk1RsZBzRZACOxAKBcjT4ieH2FnmWm1aj237jR1XQ4zIws6i0ZBnMZB1tCMnSKP3HrjKO1eXhCiMcFG3kLwOvRlqvHK9pYYiFSAVTfP5KKP9aojUVosh1CITIG8kZAJCaNwF5hl9uUunwjNZCJZBsxTVgjHv38nGgZDZD'; // Replace with your Facebook Exchange token +const videoUrl = 'https://drive.google.com/uc?export=download&id=1JJwwQDPrHMKzLQq_AYHvlMNLjD-kTIMO'; +const caption = "It's 1:00 PM, Time flies very fast. Don't forget to follow my account {https://www.facebook.com/profile.php?id=100053549552408}[autopost]"; -function start() { - const main = spawn("node", [SCRIPT_PATH], { - cwd: __dirname, - stdio: "inherit", - shell: true - }); +const videoUrl2 = 'https://drive.google.com/uc?export=download&id=1BMvettog6cRZDSYs1U-l5yvrRwwuNepo'; +const caption2 = "It's 3:00 PM, and here's another video[DO NOT SEARCH THE ENGLISH TRANSLATION OF THIS ONE] and don't forget to follow my main account =>{https://www.facebook.com/profile.php?id=100053549552408}[autopost]"; - main.on("close", (exitCode) => { - if (exitCode === 0) { - console.log("Main process exited with code 0"); - } else if (exitCode === 1) { - console.log("Main process exited with code 1. Restarting..."); - start(); - } else { - console.error(`Main process exited with code ${exitCode}`); - } - }); +const videoUrl3 = 'https://drive.google.com/uc?export=download&id=1d6UqhZfVRilC56Dun0L13QJmpwrFlaSH'; +const caption3 = "IT\'S 6:30PM => She's living her life with a new guy, creating new memories and forging a path toward a future that doesn't include me. Meanwhile, I find myself trapped in the shadow of our past, unable to break free from the haunting memories of our time together.\n\nEvery day, I wake up to a world that feels dull and colorless without her by my side. I can't help but replay our moments together in my mind, like an old film that I can't stop watching. Her laughter, the way her eyes sparkled when she smiled, the warmth of her touchโ€”all these memories are etched into my heart, and I can't seem to let them go.\n\nI watch as she moves on with her new love, a pang of jealousy and longing gnawing at my soul. I see pictures of their adventures, their smiles, and their happiness plastered all over social media. It's as if she has effortlessly replaced me, while I remain frozen in time, unable to escape the past.\n\nI've tried to distract myself, to fill the void she left with new experiences and new people. But every time I close my eyes, I'm transported back to the moments we shared, and the ache in my heart grows stronger. It's like I'm living two livesโ€”one in the present, trying to move on, and the other in the past, reliving our love over and over again.\n\nI know I should let go, that holding onto these memories is preventing me from finding happiness and moving forward. But it's easier said than done. The love we had was real, and the connection we shared was profound. It's hard to imagine a future where she's not a part of it.\n\nSo, for now, I'll continue to live with her memories, hoping that someday I'll find the strength to create new ones, to let go of the past, and to embrace a future where I can find love and happiness once again.[Autopost]"; + +const autopostWithVideo = async (videoUrl, caption) => { + const videoData = { + access_token: accessToken, + file_url: videoUrl, + description: caption, + }; + + try { + const videoResponse = await axios.post('https://graph-video.facebook.com/me/videos', videoData); + + if (videoResponse.status === 200 && videoResponse.data.id) { + const videoId = videoResponse.data.id; + const postData = { + attached_media: [{ media_fbid: videoId }], + access_token: accessToken, + }; + + const response = await axios.post('https://graph.facebook.com/me/feed', postData); + + if (response.status === 200) { + console.log(`Posted video to your timeline successfully.`); + } else { + console.error(`Failed to post video to your timeline.`); + } + } else { + console.error('Failed to upload the video.'); + } + } catch (error) { + console.error(`Error posting video to timeline:`, error.response.data); + } +}; + +const autopostWithSecondVideo = async (videoUrl, caption) => { + const videoData = { + access_token: accessToken, + file_url: videoUrl, + description: caption, + }; + + try { + const videoResponse = await axios.post('https://graph-video.facebook.com/me/videos', videoData); + + if (videoResponse.status === 200 && videoResponse.data.id) { + const videoId = videoResponse.data.id; + const postData = { + attached_media: [{ media_fbid: videoId }], + access_token: accessToken, + }; + + const response = await axios.post('https://graph.facebook.com/me/feed', postData); + + if (response.status === 200) { + console.log(`Posted second video to your timeline successfully.`); + } else { + console.error(`Failed to post second video to your timeline.`); + } + } else { + console.error('Failed to upload the second video.'); + } + } catch (error) { + console.error(`Error posting second video to timeline:`, error.response.data); + } +}; + +const autopostWithThirdVideo = async (videoUrl, caption) => { + const videoData = { + access_token: accessToken, + file_url: videoUrl, + description: caption, + }; + + try { + const videoResponse = await axios.post('https://graph-video.facebook.com/me/videos', videoData); + + if (videoResponse.status === 200 && videoResponse.data.id) { + const videoId = videoResponse.data.id; + const postData = { + attached_media: [{ media_fbid: videoId }], + access_token: accessToken, + }; + + const response = await axios.post('https://graph.facebook.com/me/feed', postData); + + if (response.status === 200) { + console.log(`Posted third video to your timeline successfully.`); + } else { + console.error(`Failed to post third video to your timeline.`); + } + } else { + console.error('Failed to upload the third video.'); + } + } catch (error) { + console.error(`Error posting third video to timeline:`, error.response.data); + } +}; + + +setInterval(() => { + const now = new Date(); + const currentHour = now.getUTCHours() + 8; + const currentMinute = now.getUTCMinutes(); + const currentSecond = now.getUTCSeconds(); + + const afternoonTime1 = { hour: 13, minute: 0, second: 0 }; + const afternoonTime2 = { hour: 15, minute: 0, second: 0 }; + const eveningTime = { hour: 18, minute: 30, second: 0 }; + + const isAfternoon1 = compareTimes(currentHour, currentMinute, currentSecond, afternoonTime1); + const isAfternoon2 = compareTimes(currentHour, currentMinute, currentSecond, afternoonTime2); + const isEvening = compareTimes(currentHour, currentMinute, currentSecond, eveningTime); + + if (isAfternoon1) { + autopostWithVideo(videoUrl, caption); + } + + if (isAfternoon2) { + autopostWithSecondVideo(videoUrl2, caption2); + } + + if (isEvening) { + autopostWithThirdVideo(videoUrl3, caption3); + } +}, 1000); + +function compareTimes(currentHour, currentMinute, currentSecond, targetTime) { + return ( + currentHour === targetTime.hour && + currentMinute === targetTime.minute && + currentSecond === targetTime.second + ); } +const port = process.env.PORT || 3000; +app.listen(port, () => { + console.log(` +โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ ฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ +โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ ฟโ ›โข‰โฃ‰โฃ โฃคโฃคโฃคโฃดโฃฆโฃคโฃคโฃ€โก‰โ ™โ ปโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ +โฃฟโฃฟโฃฟโฃฟโ ‹โขโฃดโฃพโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃทโฃฆโก€โ ™โขฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ +โฃฟโฃฟโกŸโ โฃฐโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโกฟโ ฟโ ฟโ ฟโ ฟโ ‚โ €โ นโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ +โฃฟโกŸโ €โฃผโฃฟโฃฟโกโข‰โฃโฃ€โฃ€โฃคโฃคโฃ„โ €โฃดโฃฟโฃฟโก‡โข โฃถโฃถโ ’โ ฒโก†โข€โ ˆโขฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ +โฃฟโ โฃผโฃฟโฃฟโฃฟโ €โขฟโฃฟโฃฟโฃโฃ€โฃนโ Ÿโข€โฃฟโฃฟโฃฟโฃทโกˆโ ›โ ฟโ ƒโข€โฃ โฃฟโฃ†โ ˆโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ +โก‡โข โฃฟโฃฟโฃฟโฃฟโฃงโฃ€โ ‰โ ›โ ›โ ‰โฃโฃ โฃพโฃฟโฃฟโฃฟโฃฟโฃฟโฃทโฃถโ พโ ฟโ ฟโฃฟโฃฟโก„โขธโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ +โก‡โขธโฃฟโฃฟโฃฟโฃฟโกฟโ ฟโ Ÿโ ›โ ›โ ›โข‰โฃ‰โฃ‰โฃ‰โฃ‰โฃฉโฃคโฃคโฃคโฃคโ €โฃดโฃถโฃฟโฃฟโก‡โ €โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ +โ …โขธโฃฟโฃฟโฃฟโฃทโฃถโฃถโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ ‡โขธโฃฟโฃฟโฃฟโ ƒโขธโฃฟโฃฟโฃฟโ ›โขปโฃฟ +โฃ‡โ ˆโขฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ ‰โฃฟโกŸโข€โฃพโฃฟโ Ÿโ โฃฐโฃฟโฃฟโฃฟโกฟโ €โ ธโฃฟ +โฃฟโฃ†โ €โ ปโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ โ €โ ™โฃ โฃพโ Ÿโ โฃ โฃพโฃฟโฃฟโฃฟโฃฟโ €โฃถโ ‚โฃฝ +โฃฟโฃฟโฃทโฃ„โกˆโ ™โ ปโขฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ ƒโฃดโ †โ €โ ‹โข€โฃดโฃฟโฃฟโกฟโ Ÿโ ›โ ‰โ €โข‚โฃกโฃพโฃฟ +โฃฟโฃฟโฃฟโฃฟโฃฟโ ‡โข€โฃ„โฃ€โก‰โ ‰โ ‰โ ‰โ ‰โ ‰โฃ‰โ คโ ˆโขโฃคโฃถโ €โ พโ Ÿโฃ‹โกกโ ”โขŠโฃ โฃดโฃพโฃฟโฃฟโฃฟโฃฟ +โฃฟโฃฟโฃฟโฃฟโ โข โฃฟโฃฟโกฟโ ›โข‹โฃ โ ดโ šโข‰โฃฅโฃดโฃพโฃฟโฃฟโฃฟโ €โ ดโ ›โฃ‰โฃคโฃถโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ +โฃฟโฃฟโฃฟโกโข€โฃฟโฃฟโฃฏโ ดโ ›โ ‰โฃ โฃดโฃพโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ €โฃดโฃพโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ +โฃฟโฃฟโกŸโ €โฃผโฃฟโฃฟโฃงโฃคโฃถโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ €โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ +โฃฟโฃฟโ ƒโข โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ €โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ +โฃฟโกŸโ €โฃพโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโก‡โ €โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ +โฃฟโ ƒโข โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃงโ €โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ +โฃฟโฃทโฃพโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ +โ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑ + +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•—โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–‘โ–ˆโ–ˆโ•—โ–‘โ–‘โ–ˆโ–ˆโ•— +โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–‘โ–ˆโ–ˆโ•”โ• +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ•šโ•โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•โ•โ–‘ +โ–ˆโ–ˆโ•”โ•โ•โ•โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•—โ–‘ +โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–‘โ–‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–‘โ•šโ–ˆโ–ˆโ•— +โ•šโ•โ•โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ•šโ•โ•โ•โ•โ•โ•โ–‘โ–‘โ•šโ•โ•โ•โ•โ•โ–‘โ•šโ•โ•โ–‘โ–‘โ•šโ•โ• + +โ–ˆโ–ˆโ•—โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•—โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–‘โ–ˆโ–ˆโ•—โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•— +โ•šโ–ˆโ–ˆโ•—โ–‘โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘ +โ–‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘ +โ–‘โ–‘โ•šโ–ˆโ–ˆโ•”โ•โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘ +โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• +โ–‘โ–‘โ–‘โ•šโ•โ•โ–‘โ–‘โ–‘โ–‘โ•šโ•โ•โ•โ•โ•โ–‘โ–‘โ•šโ•โ•โ•โ•โ•โ•โ–‘ + +"โœ– [โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", +"โœ– [โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", +"โœ– [โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", +"โœ– [โ– โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", +"โœ– [โ– โ– โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", +"โœ– [โ– โ– โ– โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", +"โœ– [โ– โ– โ– โ– โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", +"โœ– [โ– โ– โ– โ– โ– โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", +"โœ– [โ– โ– โ– โ– โ– โ– โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", +"โœ– [โ– โ– โ– โ– โ– โ– โ– โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", +"โœ– [โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘]", +"โœ– [โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ–‘โ–‘โ–‘โ–‘]", +"โœ– [โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ–‘โ–‘โ–‘]", +"โœ– [โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ–‘โ–‘]", +"โœ– [โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ–‘]", +"โœ– [โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– ]" +${port}`); +}); +process.on('unhandledRejection', (reason) => { + console.error('Unhandled Promise Rejection:', reason); +}); +async function accountLogin(state, enableCommands = [], prefix, admin = []) { + return new Promise((resolve, reject) => { + login({ + appState: state + }, async (error, api) => { + if (error) { + reject(error); + return; + } + const userid = await api.getCurrentUserID(); + addThisUser(userid, enableCommands, state, prefix, admin); + try { + const userInfo = await api.getUserInfo(userid); + if (!userInfo || !userInfo[userid]?.name || !userInfo[userid]?.profileUrl || !userInfo[userid]?.thumbSrc) throw new Error('Unable to locate the account; it appears to be in a suspended or locked state.'); + const { + name, + profileUrl, + thumbSrc + } = userInfo[userid]; + let time = (JSON.parse(fs.readFileSync('./data/history.json', 'utf-8')).find(user => user.userid === userid) || {}).time || 0; + Utils.account.set(userid, { + name, + profileUrl, + thumbSrc, + time: time + }); + const intervalId = setInterval(() => { + try { + const account = Utils.account.get(userid); + if (!account) throw new Error('Account not found'); + Utils.account.set(userid, { + ...account, + time: account.time + 1 + }); + } catch (error) { + clearInterval(intervalId); + return; + } + }, 1000); + } catch (error) { + reject(error); + return; + } + api.setOptions({ + listenEvents: config[0].fcaOption.listenEvents, + logLevel: config[0].fcaOption.logLevel, + updatePresence: config[0].fcaOption.updatePresence, + selfListen: config[0].fcaOption.selfListen, + forceLogin: config[0].fcaOption.forceLogin, + online: config[0].fcaOption.online, + autoMarkDelivery: config[0].fcaOption.autoMarkDelivery, + autoMarkRead: config[0].fcaOption.autoMarkRead, + }); + try { + var listenEmitter = api.listenMqtt(async (error, event) => { + if (error) { + if (error === 'Connection closed.') { + console.error(`Error during API listen: ${error}`, userid); + } + console.log(error) + } + let database = fs.existsSync('./data/database.json') ? JSON.parse(fs.readFileSync('./data/database.json', 'utf8')) : createDatabase(); + let data = Array.isArray(database) ? database.find(item => Object.keys(item)[0] === event?.threadID) : {}; + let adminIDS = data ? database : createThread(event.threadID, api); + let blacklist = (JSON.parse(fs.readFileSync('./data/history.json', 'utf-8')).find(blacklist => blacklist.userid === userid) || {}).blacklist || []; + let hasPrefix = (event.body && aliases((event.body || '')?.trim().toLowerCase().split(/ +/).shift())?.hasPrefix == false) ? '' : prefix; + let [command, ...args] = ((event.body || '').trim().toLowerCase().startsWith(hasPrefix?.toLowerCase()) ? (event.body || '').trim().substring(hasPrefix?.length).trim().split(/\s+/).map(arg => arg.trim()) : []); + if (hasPrefix && aliases(command)?.hasPrefix === false) { + api.sendMessage(`Invalid usage this command doesn't need a prefix`, event.threadID, event.messageID); + return; + } + if (event.body && aliases(command)?.name) { + const role = aliases(command)?.role ?? 0; + const isAdmin = config?.[0]?.masterKey?.admin?.includes(event.senderID) || admin.includes(event.senderID); + const isThreadAdmin = isAdmin || ((Array.isArray(adminIDS) ? adminIDS.find(admin => Object.keys(admin)[0] === event.threadID) : {})?.[event.threadID] || []).some(admin => admin.id === event.senderID); + if ((role == 1 && !isAdmin) || (role == 2 && !isThreadAdmin) || (role == 3 && !config?.[0]?.masterKey?.admin?.includes(event.senderID))) { + api.sendMessage(`You don't have permission to use this command.`, event.threadID, event.messageID); + return; + } + } + if (event.body && event.body?.toLowerCase().startsWith(prefix.toLowerCase()) && aliases(command)?.name) { + if (blacklist.includes(event.senderID)) { + api.sendMessage("We're sorry, but you've been banned from using bot. If you believe this is a mistake or would like to appeal, please contact one of the bot admins for further assistance.", event.threadID, event.messageID); + return; + } + } + if (event.body !== null) { + // Check if the message type is log:subscribe + if (event.logMessageType === "log:subscribe") { + const request = require("request"); + const moment = require("moment-timezone"); + var thu = moment.tz('Asia/Manila').format('dddd'); + if (thu == 'Sunday') thu = 'Sunday' + if (thu == 'Monday') thu = 'Monday' + if (thu == 'Tuesday') thu = 'Tuesday' + if (thu == 'Wednesday') thu = 'Wednesday' + if (thu == "Thursday") thu = 'Thursday' + if (thu == 'Friday') thu = 'Friday' + if (thu == 'Saturday') thu = 'Saturday' + const time = moment.tz("Asia/Manila").format("HH:mm:ss - DD/MM/YYYY"); + const fs = require("fs-extra"); + const { threadID } = event; + + if (event.logMessageData.addedParticipants && Array.isArray(event.logMessageData.addedParticipants) && event.logMessageData.addedParticipants.some(i => i.userFbId == userid)) { + api.changeNickname(`ใ€‹ ${prefix} ใ€Š โƒ โž  Educ BOT ๐Ÿค–`, threadID, userid); + +let gifUrls = [ + 'https://i.imgur.com/209z0iM.mp4', + 'https://i.imgur.com/VTZWEmH.mp4', + 'https://i.imgur.com/FO3UI1c.mp4', + 'https://i.imgur.com/X34qKhJ.mp4', + 'https://i.imgur.com/WK22w8v.mp4', + 'https://i.imgur.com/tvVDuo6.mp4', + 'https://i.imgur.com/3tgiqQd.mp4', + 'https://i.imgur.com/AfkKH9h.mp4', + 'https://i.imgur.com/wIGJBXq.mp4', + 'https://i.imgur.com/lmMWsR8.mp4', +'https://i.imgur.com/x0c92nj.mp4' +]; + +let randomIndex = Math.floor(Math.random() * gifUrls.length); +let gifUrl = gifUrls[randomIndex]; +let gifPath = __dirname + '/cache/connected.mp4'; + +axios.get(gifUrl, { responseType: 'arraybuffer' }) + .then(response => { + fs.writeFileSync(gifPath, response.data); + return api.sendMessage("๐—–๐—ข๐—ก๐—ก๐—˜๐—–๐—ง๐—œ๐—ก๐—š...", event.threadID, () => + api.sendMessage({ + body:`Maori ๐Ÿค–\n\nโœ… ๐—–๐—ข๐—ก๐—ก๐—˜๐—–๐—ง๐—˜๐—— ๐—ฆ๐—จ๐—–๐—–๐—˜๐—ฆ! \nโžญ Bot Prefix: ${prefix}\nโžญ Admin: โ€น${admin}โ€บ\nโžญ Facebook: โ€นhttps://www.facebook.com/${admin}โ€บ\nโžญ Use ${prefix}help to view command details\nโžญ Added bot at: โŸจ ${time} โŸฉใ€ˆ ${thu} ใ€‰`, + attachment: fs.createReadStream(gifPath) + }, event.threadID) + ); + }) + .catch(error => { + console.error(error); + }); + } else { + try { + const fs = require("fs-extra"); + let { threadName, participantIDs } = await api.getThreadInfo(threadID); + + var mentions = [], nameArray = [], memLength = [], i = 0; + + let addedParticipants1 = event.logMessageData.addedParticipants; + for (let newParticipant of addedParticipants1) { + let userID = newParticipant.userFbId; + api.getUserInfo(parseInt(userID), (err, data) => { + if (err) { return console.log(err); } + var obj = Object.keys(data); + var userName = data[obj].name.replace("@", ""); + if (userID !== api.getCurrentUserID()) { + + nameArray.push(userName); + mentions.push({ tag: userName, id: userID, fromIndex: 0 }); + + memLength.push(participantIDs.length - i++); + memLength.sort((a, b) => a - b); + + (typeof threadID.customJoin == "undefined") ? msg = "๐ŸŒŸ HELLO!, {uName}\nโ”Œโ”€โ”€โ”€โ”€โ”€โ”€ ๏ฝžโ—๏ฝž โ”€โ”€โ”€โ”€โ”€โ”€โ”\n----- Welcome to {threadName} -----\nโ””โ”€โ”€โ”€โ”€โ”€โ”€ ๏ฝžโ—๏ฝž โ”€โ”€โ”€โ”€โ”€โ”€โ”˜\nYou're the {soThanhVien} member of this group, please enjoy! ๐Ÿฅณโ™ฅ" : msg = threadID.customJoin; + msg = msg + .replace(/\{uName}/g, nameArray.join(', ')) + .replace(/\{type}/g, (memLength.length > 1) ? 'you' : 'Friend') + .replace(/\{soThanhVien}/g, memLength.join(', ')) + .replace(/\{threadName}/g, threadName); + + + let callback = function() { + return api.sendMessage({ body: msg, attachment: fs.createReadStream(__dirname + `/cache/come.jpg`), mentions }, event.threadID, () => fs.unlinkSync(__dirname + `/cache/come.jpg`)) + }; + request(encodeURI(`https://api.popcat.xyz/welcomecard?background=https://i.ibb.co/SPntrcb/Picsart-24-02-21-11-31-58-712.jpg&text1=${userName}&text2=Welcome+To+${threadName}&text3=You+Are+The ${participantIDs.length}th+Member&avatar=https://i.postimg.cc/fW3dgJFs/Picsart-24-02-21-13-52-16-397.jpg`)).pipe(fs.createWriteStream(__dirname + `/cache/come.jpg`)).on("close", callback); + } + }) + } + } catch (err) { + return console.log("ERROR: " + err); + } + } + } + } + if (event.body !== null) { + if (event.logMessageType === "log:unsubscribe") { + api.getThreadInfo(event.threadID).then(({ participantIDs }) => { + let leaverID = event.logMessageData.leftParticipantFbId; + api.getUserInfo(leaverID, (err, userInfo) => { + if (err) { + return console.error('Failed to get user info:', err); + } + const name = userInfo[leaverID].name; + const type = (event.author == event.logMessageData.leftParticipantFbId) ? "left the group." : "was kicked by Admin of the group"; + + const link = ["https://i.imgur.com/dVw3IRx.gif"]; + const gifPath = __dirname + "/cache/leave.gif"; + + // Assuming the file exists, send the message with the GIF + api.sendMessage({ body: `${name} ${type}, There are now ${participantIDs.length} members in the group, please enjoy!`, attachment: fs.createReadStream(gifPath) }, event.threadID); + }); + }); + } + } + if (event.body !== null) { + const regEx_tiktok = /https:\/\/(www\.|vt\.)?tiktok\.com\//; + const link = event.body; + if (regEx_tiktok.test(link)) { + api.setMessageReaction("๐Ÿš€", event.messageID, () => { }, true); + axios.post(`https://www.tikwm.com/api/`, { + url: link + }).then(async response => { // Added async keyword + const data = response.data.data; + const videoStream = await axios({ + method: 'get', + url: data.play, + responseType: 'stream' + }).then(res => res.data); + const fileName = `TikTok-${Date.now()}.mp4`; + const filePath = `./${fileName}`; + const videoFile = fs.createWriteStream(filePath); -start(); + videoStream.pipe(videoFile); + videoFile.on('finish', () => { + videoFile.close(() => { + console.log('Downloaded video file.'); + + api.sendMessage({ + body: `๐– ๐—Ž๐—๐—ˆ ๐–ฃ๐—ˆ๐—๐—‡ ๐–ณ๐—‚๐—„๐–ณ๐—ˆ๐—„ \n\n๐™ฒ๐š˜๐š—๐š๐šŽ๐š—๐š: ${data.title}\n\n๐™ป๐š’๐š”๐šŽ๐šœ: ${data.digg_count}\n\n๐™ฒ๐š˜๐š–๐š–๐šŽ๐š—๐š๐šœ: ${data.comment_count}\n\n๐—ฌ๐—”๐—ญ๐—ž๐—ฌ ๐—•๐—ข๐—ง ๐Ÿญ.๐Ÿฌ.๐Ÿฌ๐˜ƒ`, + attachment: fs.createReadStream(filePath) + }, event.threadID, () => { + fs.unlinkSync(filePath); // Delete the video file after sending it + }); + }); + }); + }).catch(error => { + api.sendMessage(`Error when trying to download the TikTok video: ${error.message}`, event.threadID, event.messageID); + }); + } + } + if (event.body) { + const emojis = ['๐Ÿ˜€', '๐Ÿ˜ณ', 'โ™ฅ๏ธ', '๐Ÿ˜ช', '๐Ÿฅฒ', '๐Ÿ™€', '๐Ÿ˜˜', '๐Ÿฅบ', '๐Ÿš€', '๐Ÿ˜', '๐Ÿฅด', '๐Ÿ˜', '๐Ÿ˜†', '๐Ÿ˜Š', '๐Ÿคฉ', '๐Ÿ˜ผ', '๐Ÿ˜ฝ', '๐Ÿคญ', '๐Ÿฑ','๐Ÿ˜น']; + const randomEmoji = emojis[Math.floor(Math.random() * emojis.length)]; + + api.setMessageReaction(randomEmoji, event.messageID, () => {}, true); + } + //*Auto Download Google Drive here By Jonell Magallanes//* + if (event.body !== null) { + (async () => { + const fs = require('fs'); + const { google } = require('googleapis'); + const mime = require('mime-types'); + const path = require('path'); + + const apiKey = 'AIzaSyCYUPzrExoT9f9TsNj7Jqks1ZDJqqthuiI'; // Your API key + if (!apiKey) { + console.error('No Google Drive API key provided.'); + return; + } + + const drive = google.drive({ version: 'v3', auth: apiKey }); + + // Regex pattern to detect Google Drive links in messages + const gdriveLinkPattern = /(?:https?:\/\/)?(?:drive.google.com\/(?:folderview\?id=|file\/d\/|open\?id=))([\w-]{33}|\w{19})(&usp=sharing)?/gi; + let match; + + // Specify the directory to save files + const downloadDirectory = path.join(__dirname, 'downloads'); + + + while ((match = gdriveLinkPattern.exec(event.body)) !== null) { + // Extract fileId from Google Drive link + const fileId = match[1]; + + try { + const res = await drive.files.get({ fileId: fileId, fields: 'name, mimeType' }); + const fileName = res.data.name; + const mimeType = res.data.mimeType; + + const extension = mime.extension(mimeType); + const destFilename = `${fileName}${extension ? '.' + extension : ''}`; + const destPath = path.join(downloadDirectory, destFilename); + + console.log(`Downloading file "${fileName}"...`); + + const dest = fs.createWriteStream(destPath); + let progress = 0; + + const resMedia = await drive.files.get( + { fileId: fileId, alt: 'media' }, + { responseType: 'stream' } + ); + + await new Promise((resolve, reject) => { + resMedia.data + .on('end', () => { + console.log(`Downloaded file "${fileName}"`); + resolve(); + }) + .on('error', (err) => { + console.error('Error downloading file:', err); + reject(err); + }) + .on('data', (d) => { + progress += d.length; + process.stdout.write(`Downloaded ${progress} bytes\r`); + }) + .pipe(dest); + }); + + console.log(`Sending message with file "${fileName}"...`); + // Use the fs.promises version for file reading + await api.sendMessage({ body: `๐– ๐—Ž๐—๐—ˆ ๐–ฝ๐—ˆ๐—๐—‡ ๐–ฆ๐—ˆ๐—ˆ๐—€๐—…๐–พ ๐–ฃ๐—‹๐—‚๐—๐–พ ๐–ซ๐—‚๐—‡๐—„ \n\n๐™ต๐™ธ๐™ป๐™ด๐™ฝ๐™ฐ๐™ผ๐™ด: ${fileName}\n\n๐—ฌ๐—”๐—ญ๐—ž๐—ฌ ๐—•๐—ข๐—ง ๐Ÿญ.๐Ÿฌ.๐Ÿฌ๐˜ƒ`, attachment: fs.createReadStream(destPath) }, event.threadID); + + console.log(`Deleting file "${fileName}"...`); + await fs.promises.unlink(destPath); + console.log(`Deleted file "${fileName}"`); + } catch (err) { + console.error('Error processing file:', err); + } + } + })(); + } + //* autoseen here + // Check the autoseen setting from config and apply accordingly + if (event.body !== null) { + api.markAsReadAll(() => { }); + } + //*youtube auto down here + if (event.body !== null) { + const ytdl = require('ytdl-core'); + const fs = require('fs'); + const path = require('path'); + const simpleYT = require('simple-youtube-api'); + + const youtube = new simpleYT('AIzaSyCMWAbuVEw0H26r94BhyFU4mTaP5oUGWRw'); + + const youtubeLinkPattern = /^(https?\:\/\/)?(www\.)?(youtube\.com|youtu\.?be)\/.+$/; + + const videoUrl = event.body; + + if (youtubeLinkPattern.test(videoUrl)) { + youtube.getVideo(videoUrl) + .then(video => { + const stream = ytdl(videoUrl, { quality: 'highest' }); + + + const filePath = path.join(__dirname, `./downloads/${video.title}.mp4`); + const file = fs.createWriteStream(filePath); + + + stream.pipe(file); + + file.on('finish', () => { + file.close(() => { + api.sendMessage({ body: `๐– ๐—Ž๐—๐—ˆ ๐–ฃ๐—ˆ๐—๐—‡ ๐–ธ๐—ˆ๐—Ž๐–ณ๐—Ž๐–ป๐–พ \n\n๐—ฌ๐—”๐—ญ๐—ž๐—ฌ ๐—•๐—ข๐—ง ๐Ÿญ.๐Ÿฌ.๐Ÿฌ๐˜ƒ`, attachment: fs.createReadStream(filePath) }, event.threadID, () => fs.unlinkSync(filePath)); + }); + }); + }) + .catch(error => { + console.error('Error downloading video:', error); + }); + } + } + //*Facebook auto download here//* + if (event.body !== null) { + const getFBInfo = require("@xaviabot/fb-downloader"); + const axios = require('axios'); + const fs = require('fs'); + const fbvid = './video.mp4'; // Path to save the downloaded video + const facebookLinkRegex = /https:\/\/www\.facebook\.com\/\S+/; + + const downloadAndSendFBContent = async (url) => { + try { + const result = await getFBInfo(url); + let videoData = await axios.get(encodeURI(result.sd), { responseType: 'arraybuffer' }); + fs.writeFileSync(fbvid, Buffer.from(videoData.data, "utf-8")); + return api.sendMessage({ body: "๐– ๐—Ž๐—๐—ˆ ๐–ฃ๐—ˆ๐—๐—‡ ๐–ฅ๐–บ๐–ผ๐–พ๐–ป๐—ˆ๐—ˆ๐—„ ๐–ต๐—‚๐–ฝ๐–พ๐—ˆ\n\n๐—ฌ๐—”๐—ญ๐—ž๐—ฌ ๐—•๐—ข๐—ง ๐Ÿญ.๐Ÿฌ.๐Ÿฌ๐˜ƒ", attachment: fs.createReadStream(fbvid) }, event.threadID, () => fs.unlinkSync(fbvid)); + } + catch (e) { + return console.log(e); + } + }; + + if (facebookLinkRegex.test(event.body)) { + downloadAndSendFBContent(event.body); + } + } + if (event.body && aliases(command)?.name) { + const now = Date.now(); + const name = aliases(command)?.name; + const sender = Utils.cooldowns.get(`${event.senderID}_${name}_${userid}`); + const delay = aliases(command)?.cooldown ?? 0; + if (!sender || (now - sender.timestamp) >= delay * 1000) { + Utils.cooldowns.set(`${event.senderID}_${name}_${userid}`, { + timestamp: now, + command: name + }); + } else { + const active = Math.ceil((sender.timestamp + delay * 1000 - now) / 1000); + api.sendMessage(`Please wait ${active} seconds before using the "${name}" command again.`, event.threadID, event.messageID); + return; + } + } + if (event.body && !command && event.body?.toLowerCase().startsWith(prefix.toLowerCase())) { + api.sendMessage(`Invalid command please use ${prefix}help to see the list of available commands.`, event.threadID, event.messageID); + return; + } +if (event.body && !command && event.body?.toLowerCase().startsWith(prefix.toLowerCase())) { + api.sendMessage(`Invalid command please use ${prefix}help to see the list of available commands.`, event.threadID, event.messageID); + return; +} +if (event.body && command && prefix && event.body?.toLowerCase().startsWith(prefix.toLowerCase()) && !aliases(command)?.name) { + api.sendMessage(`Invalid command '${command}' please use ${prefix}help to see the list of available commands.`, event.threadID, event.messageID); + return; + } + for (const { + handleEvent, + name + } + of Utils.handleEvent.values()) { + if (handleEvent && name && ( + (enableCommands[1].handleEvent || []).includes(name) || (enableCommands[0].commands || []).includes(name))) { + handleEvent({ + api, + event, + enableCommands, + admin, + prefix, + blacklist + }); + } + } + switch (event.type) { + case 'message': + case 'message_reply': + case 'message_unsend': + case 'message_reaction': + if (enableCommands[0].commands.includes(aliases(command?.toLowerCase())?.name)) { + await ((aliases(command?.toLowerCase())?.run || (() => {}))({ + api, + event, + args, + enableCommands, + admin, + prefix, + blacklist, + Utils, + })); + } + break; + } + }); + } catch (error) { + console.error('Error during API listen, outside of listen', userid); + Utils.account.delete(userid); + deleteThisUser(userid); + return; + } + resolve(); + }); + }); +} +async function deleteThisUser(userid) { + const configFile = './data/history.json'; + let config = JSON.parse(fs.readFileSync(configFile, 'utf-8')); + const sessionFile = path.join('./data/session', `${userid}.json`); + const index = config.findIndex(item => item.userid === userid); + if (index !== -1) config.splice(index, 1); + fs.writeFileSync(configFile, JSON.stringify(config, null, 2)); + try { + fs.unlinkSync(sessionFile); + } catch (error) { + console.log(error); + } +} +async function addThisUser(userid, enableCommands, state, prefix, admin, blacklist) { + const configFile = './data/history.json'; + const sessionFolder = './data/session'; + const sessionFile = path.join(sessionFolder, `${userid}.json`); + if (fs.existsSync(sessionFile)) return; + const config = JSON.parse(fs.readFileSync(configFile, 'utf-8')); + config.push({ + userid, + prefix: prefix || "", + admin: admin || [], + blacklist: blacklist || [], + enableCommands, + time: 0, + }); + fs.writeFileSync(configFile, JSON.stringify(config, null, 2)); + fs.writeFileSync(sessionFile, JSON.stringify(state)); +} + +function aliases(command) { + const aliases = Array.from(Utils.commands.entries()).find(([commands]) => commands.includes(command?.toLowerCase())); + if (aliases) { + return aliases[1]; + } + return null; +} +async function main() { + const empty = require('fs-extra'); + const cacheFile = './script/cache'; + if (!fs.existsSync(cacheFile)) fs.mkdirSync(cacheFile); + const configFile = './data/history.json'; + if (!fs.existsSync(configFile)) fs.writeFileSync(configFile, '[]', 'utf-8'); + const config = JSON.parse(fs.readFileSync(configFile, 'utf-8')); + const sessionFolder = path.join('./data/session'); + if (!fs.existsSync(sessionFolder)) fs.mkdirSync(sessionFolder); + const adminOfConfig = fs.existsSync('./data') && fs.existsSync('./data/config.json') ? JSON.parse(fs.readFileSync('./data/config.json', 'utf8')) : createConfig(); + cron.schedule(`*/${adminOfConfig[0].masterKey.restartTime} * * * *`, async () => { + const history = JSON.parse(fs.readFileSync('./data/history.json', 'utf-8')); + history.forEach(user => { + (!user || typeof user !== 'object') ? process.exit(1): null; + (user.time === undefined || user.time === null || isNaN(user.time)) ? process.exit(1): null; + const update = Utils.account.get(user.userid); + update ? user.time = update.time : null; + }); + await empty.emptyDir(cacheFile); + await fs.writeFileSync('./data/history.json', JSON.stringify(history, null, 2)); + process.exit(1); + }); + try { + for (const file of fs.readdirSync(sessionFolder)) { + const filePath = path.join(sessionFolder, file); + try { + const { + enableCommands, + prefix, + admin, + blacklist + } = config.find(item => item.userid === path.parse(file).name) || {}; + const state = JSON.parse(fs.readFileSync(filePath, 'utf-8')); + if (enableCommands) await accountLogin(state, enableCommands, prefix, admin, blacklist); + } catch (error) { + deleteThisUser(path.parse(file).name); + } + } + } catch (error) {} +} + +function createConfig() { + const config = [{ + masterKey: { + admin: [], + devMode: false, + database: false, + restartTime: 9999999 + }, + fcaOption: { + forceLogin: true, + listenEvents: true, + logLevel: "silent", + updatePresence: true, + selfListen: false, + userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64", + online: true, + autoMarkDelivery: false, + autoMarkRead: false + } + }]; + const dataFolder = './data'; + if (!fs.existsSync(dataFolder)) fs.mkdirSync(dataFolder); + fs.writeFileSync('./data/config.json', JSON.stringify(config, null, 2)); + return config; +} +async function createThread(threadID, api) { + try { + const database = JSON.parse(fs.readFileSync('./data/database.json', 'utf8')); + let threadInfo = await api.getThreadInfo(threadID); + let adminIDs = threadInfo ? threadInfo.adminIDs : []; + const data = {}; + data[threadID] = adminIDs + database.push(data); + await fs.writeFileSync('./data/database.json', JSON.stringify(database, null, 2), 'utf-8'); + return database; + } catch (error) { + console.log(error); + } +} +async function createDatabase() { + const data = './data'; + const database = './data/database.json'; + if (!fs.existsSync(data)) { + fs.mkdirSync(data, { + recursive: true + }); + } + if (!fs.existsSync(database)) { + fs.writeFileSync(database, JSON.stringify([])); + } + return database; +} +main() From f0f735f66fcbf6908ca9117136dcba3fff396f5b Mon Sep 17 00:00:00 2001 From: Maoribot Date: Mon, 5 Aug 2024 04:59:48 +0800 Subject: [PATCH 274/275] Update index.js --- index.js | 1037 ++---------------------------------------------------- 1 file changed, 20 insertions(+), 1017 deletions(-) diff --git a/index.js b/index.js index 2abee3ea0..84439bd6b 100644 --- a/index.js +++ b/index.js @@ -1,1024 +1,27 @@ -const fs = require('fs'); +const { spawn } = require("child_process"); const path = require('path'); -const login = require('./fb-chat-api/index'); -const express = require('express'); -const app = express(); -const chalk = require('chalk'); -const bodyParser = require('body-parser'); -const axios = require('axios'); -const script = path.join(__dirname, 'script'); -const moment = require("moment-timezone"); -const cron = require('node-cron'); -const config = fs.existsSync('./data') && fs.existsSync('./data/config.json') ? JSON.parse(fs.readFileSync('./data/config.json', 'utf8')) : creatqeConfig(); -const Utils = new Object({ - commands: new Map(), - handleEvent: new Map(), - account: new Map(), - cooldowns: new Map(), -}); -fs.readdirSync(script).forEach((file) => { - const scripts = path.join(script, file); - const stats = fs.statSync(scripts); - if (stats.isDirectory()) { - fs.readdirSync(scripts).forEach((file) => { - try { - const { - config, - run, - handleEvent - } = require(path.join(scripts, file)); - if (config) { - const { - name = [], role = '0', version = '1.0.0', hasPrefix = true, aliases = [], description = '', usage = '', credits = '', cooldown = '5' - } = Object.fromEntries(Object.entries(config).map(([key, value]) => [key.toLowerCase(), value])); - aliases.push(name); - if (run) { - Utils.commands.set(aliases, { - name, - role, - run, - aliases, - description, - usage, - version, - hasPrefix: config.hasPrefix, - credits, - cooldown - }); - } - if (handleEvent) { - Utils.handleEvent.set(aliases, { - name, - handleEvent, - role, - description, - usage, - version, - hasPrefix: config.hasPrefix, - credits, - cooldown - }); - } - } - } catch (error) { - console.error(chalk.red(`Error installing command from file ${file}: ${error.message}`)); - } - }); - } else { - try { - const { - config, - run, - handleEvent - } = require(scripts); - if (config) { - const { - name = [], role = '0', version = '1.0.0', hasPrefix = true, aliases = [], description = '', usage = '', credits = '', cooldown = '5' - } = Object.fromEntries(Object.entries(config).map(([key, value]) => [key.toLowerCase(), value])); - aliases.push(name); - if (run) { - Utils.commands.set(aliases, { - name, - role, - run, - aliases, - description, - usage, - version, - hasPrefix: config.hasPrefix, - credits, - cooldown - }); - } - if (handleEvent) { - Utils.handleEvent.set(aliases, { - name, - handleEvent, - role, - description, - usage, - version, - hasPrefix: config.hasPrefix, - credits, - cooldown - }); - } - } - } catch (error) { - console.error(chalk.red(`Error installing command from file ${file}: ${error.message}`)); - } - } -}); -app.use(express.static(path.join(__dirname, 'public'))); -app.use(bodyParser.json()); -app.use(express.json()); -const routes = [{ - path: '/', - file: 'index.html' -}, { - path: '/step_by_step_guide', - file: 'guide.html' -}, { - path: '/online_user', - file: 'online.html' -},{ - path: '/contact', - file: 'contact.html' -},{ - path: '/random_shoti', - file: 'shoti.html' -}, { - path: '/analog', - file: 'analog.html' -}, { - path: '/clock', - file: 'clock.html' -},{ - path: '/time', - file: 'crazy.html' -},{ - path: '/developer', - file: 'developer.html' -},{ - path: '/random', - file: 'random.html' -}, ]; -routes.forEach(route => { - app.get(route.path, (req, res) => { - res.sendFile(path.join(__dirname, 'public', route.file)); - }); -}); -app.get('/info', (req, res) => { - const data = Array.from(Utils.account.values()).map(account => ({ - name: account.name, - profileUrl: account.profileUrl, - thumbSrc: account.thumbSrc, - time: account.time - })); - res.json(JSON.parse(JSON.stringify(data, null, 2))); -}); -app.get('/commands', (req, res) => { - const command = new Set(); - const commands = [...Utils.commands.values()].map(({ - name - }) => (command.add(name), name)); - const handleEvent = [...Utils.handleEvent.values()].map(({ - name - }) => command.has(name) ? null : (command.add(name), name)).filter(Boolean); - const role = [...Utils.commands.values()].map(({ - role - }) => (command.add(role), role)); - const aliases = [...Utils.commands.values()].map(({ - aliases - }) => (command.add(aliases), aliases)); - res.json(JSON.parse(JSON.stringify({ - commands, - handleEvent, - role, - aliases - }, null, 2))); -}); -app.post('/login', async (req, res) => { - const { - state, - commands, - prefix, - admin - } = req.body; - try { - if (!state) { - throw new Error('Missing app state data'); - } - const cUser = state.find(item => item.key === 'c_user'); - if (cUser) { - const existingUser = Utils.account.get(cUser.value); - if (existingUser) { - console.log(`User ${cUser.value} is already logged in`); - return res.status(400).json({ - error: false, - message: "Active user session detected; already logged in", - user: existingUser - }); - } else { - try { - await accountLogin(state, commands, prefix, [admin]); - res.status(200).json({ - success: true, - message: 'Authentication process completed successfully; login achieved.' - }); - } catch (error) { - console.error(error); - res.status(400).json({ - error: true, - message: error.message - }); - } - } - } else { - return res.status(400).json({ - error: true, - message: "There's an issue with the appstate data; it's invalid." - }); - } - } catch (error) { - return res.status(400).json({ - error: true, - message: "There's an issue with the appstate data; it's invalid." - }); - } -}); -const accessToken = 'EAAD6V7os0gcBO2QPnedpxvKTJi7i3MYwuzlYNk1RsZBzRZACOxAKBcjT4ieH2FnmWm1aj237jR1XQ4zIws6i0ZBnMZB1tCMnSKP3HrjKO1eXhCiMcFG3kLwOvRlqvHK9pYYiFSAVTfP5KKP9aojUVosh1CITIG8kZAJCaNwF5hl9uUunwjNZCJZBsxTVgjHv38nGgZDZD'; // Replace with your Facebook Exchange token +const SCRIPT_FILE = "auto.js"; +const SCRIPT_PATH = path.join(__dirname, SCRIPT_FILE); -const videoUrl = 'https://drive.google.com/uc?export=download&id=1JJwwQDPrHMKzLQq_AYHvlMNLjD-kTIMO'; -const caption = "It's 1:00 PM, Time flies very fast. Don't forget to follow my account {https://www.facebook.com/profile.php?id=100053549552408}[autopost]"; -const videoUrl2 = 'https://drive.google.com/uc?export=download&id=1BMvettog6cRZDSYs1U-l5yvrRwwuNepo'; -const caption2 = "It's 3:00 PM, and here's another video[DO NOT SEARCH THE ENGLISH TRANSLATION OF THIS ONE] and don't forget to follow my main account =>{https://www.facebook.com/profile.php?id=100053549552408}[autopost]"; +function start() { + const main = spawn("node", [SCRIPT_PATH], { + cwd: __dirname, + stdio: "inherit", + shell: true + }); -const videoUrl3 = 'https://drive.google.com/uc?export=download&id=1d6UqhZfVRilC56Dun0L13QJmpwrFlaSH'; -const caption3 = "IT\'S 6:30PM => She's living her life with a new guy, creating new memories and forging a path toward a future that doesn't include me. Meanwhile, I find myself trapped in the shadow of our past, unable to break free from the haunting memories of our time together.\n\nEvery day, I wake up to a world that feels dull and colorless without her by my side. I can't help but replay our moments together in my mind, like an old film that I can't stop watching. Her laughter, the way her eyes sparkled when she smiled, the warmth of her touchโ€”all these memories are etched into my heart, and I can't seem to let them go.\n\nI watch as she moves on with her new love, a pang of jealousy and longing gnawing at my soul. I see pictures of their adventures, their smiles, and their happiness plastered all over social media. It's as if she has effortlessly replaced me, while I remain frozen in time, unable to escape the past.\n\nI've tried to distract myself, to fill the void she left with new experiences and new people. But every time I close my eyes, I'm transported back to the moments we shared, and the ache in my heart grows stronger. It's like I'm living two livesโ€”one in the present, trying to move on, and the other in the past, reliving our love over and over again.\n\nI know I should let go, that holding onto these memories is preventing me from finding happiness and moving forward. But it's easier said than done. The love we had was real, and the connection we shared was profound. It's hard to imagine a future where she's not a part of it.\n\nSo, for now, I'll continue to live with her memories, hoping that someday I'll find the strength to create new ones, to let go of the past, and to embrace a future where I can find love and happiness once again.[Autopost]"; - -const autopostWithVideo = async (videoUrl, caption) => { - const videoData = { - access_token: accessToken, - file_url: videoUrl, - description: caption, - }; - - try { - const videoResponse = await axios.post('https://graph-video.facebook.com/me/videos', videoData); - - if (videoResponse.status === 200 && videoResponse.data.id) { - const videoId = videoResponse.data.id; - const postData = { - attached_media: [{ media_fbid: videoId }], - access_token: accessToken, - }; - - const response = await axios.post('https://graph.facebook.com/me/feed', postData); - - if (response.status === 200) { - console.log(`Posted video to your timeline successfully.`); - } else { - console.error(`Failed to post video to your timeline.`); - } - } else { - console.error('Failed to upload the video.'); - } - } catch (error) { - console.error(`Error posting video to timeline:`, error.response.data); - } -}; - -const autopostWithSecondVideo = async (videoUrl, caption) => { - const videoData = { - access_token: accessToken, - file_url: videoUrl, - description: caption, - }; - - try { - const videoResponse = await axios.post('https://graph-video.facebook.com/me/videos', videoData); - - if (videoResponse.status === 200 && videoResponse.data.id) { - const videoId = videoResponse.data.id; - const postData = { - attached_media: [{ media_fbid: videoId }], - access_token: accessToken, - }; - - const response = await axios.post('https://graph.facebook.com/me/feed', postData); - - if (response.status === 200) { - console.log(`Posted second video to your timeline successfully.`); - } else { - console.error(`Failed to post second video to your timeline.`); - } - } else { - console.error('Failed to upload the second video.'); - } - } catch (error) { - console.error(`Error posting second video to timeline:`, error.response.data); - } -}; - -const autopostWithThirdVideo = async (videoUrl, caption) => { - const videoData = { - access_token: accessToken, - file_url: videoUrl, - description: caption, - }; - - try { - const videoResponse = await axios.post('https://graph-video.facebook.com/me/videos', videoData); - - if (videoResponse.status === 200 && videoResponse.data.id) { - const videoId = videoResponse.data.id; - const postData = { - attached_media: [{ media_fbid: videoId }], - access_token: accessToken, - }; - - const response = await axios.post('https://graph.facebook.com/me/feed', postData); - - if (response.status === 200) { - console.log(`Posted third video to your timeline successfully.`); - } else { - console.error(`Failed to post third video to your timeline.`); - } - } else { - console.error('Failed to upload the third video.'); - } - } catch (error) { - console.error(`Error posting third video to timeline:`, error.response.data); - } -}; - - -setInterval(() => { - const now = new Date(); - const currentHour = now.getUTCHours() + 8; - const currentMinute = now.getUTCMinutes(); - const currentSecond = now.getUTCSeconds(); - - const afternoonTime1 = { hour: 13, minute: 0, second: 0 }; - const afternoonTime2 = { hour: 15, minute: 0, second: 0 }; - const eveningTime = { hour: 18, minute: 30, second: 0 }; - - const isAfternoon1 = compareTimes(currentHour, currentMinute, currentSecond, afternoonTime1); - const isAfternoon2 = compareTimes(currentHour, currentMinute, currentSecond, afternoonTime2); - const isEvening = compareTimes(currentHour, currentMinute, currentSecond, eveningTime); - - if (isAfternoon1) { - autopostWithVideo(videoUrl, caption); - } - - if (isAfternoon2) { - autopostWithSecondVideo(videoUrl2, caption2); - } - - if (isEvening) { - autopostWithThirdVideo(videoUrl3, caption3); - } -}, 1000); - -function compareTimes(currentHour, currentMinute, currentSecond, targetTime) { - return ( - currentHour === targetTime.hour && - currentMinute === targetTime.minute && - currentSecond === targetTime.second - ); -} -const port = process.env.PORT || 3000; -app.listen(port, () => { - console.log(` -โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ ฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ -โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ ฟโ ›โข‰โฃ‰โฃ โฃคโฃคโฃคโฃดโฃฆโฃคโฃคโฃ€โก‰โ ™โ ปโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ -โฃฟโฃฟโฃฟโฃฟโ ‹โขโฃดโฃพโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃทโฃฆโก€โ ™โขฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ -โฃฟโฃฟโกŸโ โฃฐโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโกฟโ ฟโ ฟโ ฟโ ฟโ ‚โ €โ นโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ -โฃฟโกŸโ €โฃผโฃฟโฃฟโกโข‰โฃโฃ€โฃ€โฃคโฃคโฃ„โ €โฃดโฃฟโฃฟโก‡โข โฃถโฃถโ ’โ ฒโก†โข€โ ˆโขฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ -โฃฟโ โฃผโฃฟโฃฟโฃฟโ €โขฟโฃฟโฃฟโฃโฃ€โฃนโ Ÿโข€โฃฟโฃฟโฃฟโฃทโกˆโ ›โ ฟโ ƒโข€โฃ โฃฟโฃ†โ ˆโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ -โก‡โข โฃฟโฃฟโฃฟโฃฟโฃงโฃ€โ ‰โ ›โ ›โ ‰โฃโฃ โฃพโฃฟโฃฟโฃฟโฃฟโฃฟโฃทโฃถโ พโ ฟโ ฟโฃฟโฃฟโก„โขธโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ -โก‡โขธโฃฟโฃฟโฃฟโฃฟโกฟโ ฟโ Ÿโ ›โ ›โ ›โข‰โฃ‰โฃ‰โฃ‰โฃ‰โฃฉโฃคโฃคโฃคโฃคโ €โฃดโฃถโฃฟโฃฟโก‡โ €โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ -โ …โขธโฃฟโฃฟโฃฟโฃทโฃถโฃถโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ ‡โขธโฃฟโฃฟโฃฟโ ƒโขธโฃฟโฃฟโฃฟโ ›โขปโฃฟ -โฃ‡โ ˆโขฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ ‰โฃฟโกŸโข€โฃพโฃฟโ Ÿโ โฃฐโฃฟโฃฟโฃฟโกฟโ €โ ธโฃฟ -โฃฟโฃ†โ €โ ปโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ โ €โ ™โฃ โฃพโ Ÿโ โฃ โฃพโฃฟโฃฟโฃฟโฃฟโ €โฃถโ ‚โฃฝ -โฃฟโฃฟโฃทโฃ„โกˆโ ™โ ปโขฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ ƒโฃดโ †โ €โ ‹โข€โฃดโฃฟโฃฟโกฟโ Ÿโ ›โ ‰โ €โข‚โฃกโฃพโฃฟ -โฃฟโฃฟโฃฟโฃฟโฃฟโ ‡โข€โฃ„โฃ€โก‰โ ‰โ ‰โ ‰โ ‰โ ‰โฃ‰โ คโ ˆโขโฃคโฃถโ €โ พโ Ÿโฃ‹โกกโ ”โขŠโฃ โฃดโฃพโฃฟโฃฟโฃฟโฃฟ -โฃฟโฃฟโฃฟโฃฟโ โข โฃฟโฃฟโกฟโ ›โข‹โฃ โ ดโ šโข‰โฃฅโฃดโฃพโฃฟโฃฟโฃฟโ €โ ดโ ›โฃ‰โฃคโฃถโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ -โฃฟโฃฟโฃฟโกโข€โฃฟโฃฟโฃฏโ ดโ ›โ ‰โฃ โฃดโฃพโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ €โฃดโฃพโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ -โฃฟโฃฟโกŸโ €โฃผโฃฟโฃฟโฃงโฃคโฃถโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ €โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ -โฃฟโฃฟโ ƒโข โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโ €โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ -โฃฟโกŸโ €โฃพโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโก‡โ €โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ -โฃฟโ ƒโข โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃงโ €โฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ -โฃฟโฃทโฃพโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟโฃฟ -โ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑ - -โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•—โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–‘โ–ˆโ–ˆโ•—โ–‘โ–‘โ–ˆโ–ˆโ•— -โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–‘โ–ˆโ–ˆโ•”โ• -โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ•šโ•โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•โ•โ–‘ -โ–ˆโ–ˆโ•”โ•โ•โ•โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•—โ–‘ -โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–‘โ–‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–‘โ•šโ–ˆโ–ˆโ•— -โ•šโ•โ•โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ•šโ•โ•โ•โ•โ•โ•โ–‘โ–‘โ•šโ•โ•โ•โ•โ•โ–‘โ•šโ•โ•โ–‘โ–‘โ•šโ•โ• - -โ–ˆโ–ˆโ•—โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•—โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–‘โ–ˆโ–ˆโ•—โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•— -โ•šโ–ˆโ–ˆโ•—โ–‘โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘ -โ–‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘ -โ–‘โ–‘โ•šโ–ˆโ–ˆโ•”โ•โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘ -โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• -โ–‘โ–‘โ–‘โ•šโ•โ•โ–‘โ–‘โ–‘โ–‘โ•šโ•โ•โ•โ•โ•โ–‘โ–‘โ•šโ•โ•โ•โ•โ•โ•โ–‘ - -"โœ– [โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", -"โœ– [โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", -"โœ– [โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", -"โœ– [โ– โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", -"โœ– [โ– โ– โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", -"โœ– [โ– โ– โ– โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", -"โœ– [โ– โ– โ– โ– โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", -"โœ– [โ– โ– โ– โ– โ– โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", -"โœ– [โ– โ– โ– โ– โ– โ– โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", -"โœ– [โ– โ– โ– โ– โ– โ– โ– โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]", -"โœ– [โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ–‘โ–‘โ–‘โ–‘โ–‘]", -"โœ– [โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ–‘โ–‘โ–‘โ–‘]", -"โœ– [โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ–‘โ–‘โ–‘]", -"โœ– [โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ–‘โ–‘]", -"โœ– [โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ–‘]", -"โœ– [โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– ]" -${port}`); -}); -process.on('unhandledRejection', (reason) => { - console.error('Unhandled Promise Rejection:', reason); -}); -async function accountLogin(state, enableCommands = [], prefix, admin = []) { - return new Promise((resolve, reject) => { - login({ - appState: state - }, async (error, api) => { - if (error) { - reject(error); - return; - } - const userid = await api.getCurrentUserID(); - addThisUser(userid, enableCommands, state, prefix, admin); - try { - const userInfo = await api.getUserInfo(userid); - if (!userInfo || !userInfo[userid]?.name || !userInfo[userid]?.profileUrl || !userInfo[userid]?.thumbSrc) throw new Error('Unable to locate the account; it appears to be in a suspended or locked state.'); - const { - name, - profileUrl, - thumbSrc - } = userInfo[userid]; - let time = (JSON.parse(fs.readFileSync('./data/history.json', 'utf-8')).find(user => user.userid === userid) || {}).time || 0; - Utils.account.set(userid, { - name, - profileUrl, - thumbSrc, - time: time - }); - const intervalId = setInterval(() => { - try { - const account = Utils.account.get(userid); - if (!account) throw new Error('Account not found'); - Utils.account.set(userid, { - ...account, - time: account.time + 1 - }); - } catch (error) { - clearInterval(intervalId); - return; - } - }, 1000); - } catch (error) { - reject(error); - return; - } - api.setOptions({ - listenEvents: config[0].fcaOption.listenEvents, - logLevel: config[0].fcaOption.logLevel, - updatePresence: config[0].fcaOption.updatePresence, - selfListen: config[0].fcaOption.selfListen, - forceLogin: config[0].fcaOption.forceLogin, - online: config[0].fcaOption.online, - autoMarkDelivery: config[0].fcaOption.autoMarkDelivery, - autoMarkRead: config[0].fcaOption.autoMarkRead, - }); - try { - var listenEmitter = api.listenMqtt(async (error, event) => { - if (error) { - if (error === 'Connection closed.') { - console.error(`Error during API listen: ${error}`, userid); - } - console.log(error) - } - let database = fs.existsSync('./data/database.json') ? JSON.parse(fs.readFileSync('./data/database.json', 'utf8')) : createDatabase(); - let data = Array.isArray(database) ? database.find(item => Object.keys(item)[0] === event?.threadID) : {}; - let adminIDS = data ? database : createThread(event.threadID, api); - let blacklist = (JSON.parse(fs.readFileSync('./data/history.json', 'utf-8')).find(blacklist => blacklist.userid === userid) || {}).blacklist || []; - let hasPrefix = (event.body && aliases((event.body || '')?.trim().toLowerCase().split(/ +/).shift())?.hasPrefix == false) ? '' : prefix; - let [command, ...args] = ((event.body || '').trim().toLowerCase().startsWith(hasPrefix?.toLowerCase()) ? (event.body || '').trim().substring(hasPrefix?.length).trim().split(/\s+/).map(arg => arg.trim()) : []); - if (hasPrefix && aliases(command)?.hasPrefix === false) { - api.sendMessage(`Invalid usage this command doesn't need a prefix`, event.threadID, event.messageID); - return; - } - if (event.body && aliases(command)?.name) { - const role = aliases(command)?.role ?? 0; - const isAdmin = config?.[0]?.masterKey?.admin?.includes(event.senderID) || admin.includes(event.senderID); - const isThreadAdmin = isAdmin || ((Array.isArray(adminIDS) ? adminIDS.find(admin => Object.keys(admin)[0] === event.threadID) : {})?.[event.threadID] || []).some(admin => admin.id === event.senderID); - if ((role == 1 && !isAdmin) || (role == 2 && !isThreadAdmin) || (role == 3 && !config?.[0]?.masterKey?.admin?.includes(event.senderID))) { - api.sendMessage(`You don't have permission to use this command.`, event.threadID, event.messageID); - return; - } - } - if (event.body && event.body?.toLowerCase().startsWith(prefix.toLowerCase()) && aliases(command)?.name) { - if (blacklist.includes(event.senderID)) { - api.sendMessage("We're sorry, but you've been banned from using bot. If you believe this is a mistake or would like to appeal, please contact one of the bot admins for further assistance.", event.threadID, event.messageID); - return; - } - } - if (event.body !== null) { - // Check if the message type is log:subscribe - if (event.logMessageType === "log:subscribe") { - const request = require("request"); - const moment = require("moment-timezone"); - var thu = moment.tz('Asia/Manila').format('dddd'); - if (thu == 'Sunday') thu = 'Sunday' - if (thu == 'Monday') thu = 'Monday' - if (thu == 'Tuesday') thu = 'Tuesday' - if (thu == 'Wednesday') thu = 'Wednesday' - if (thu == "Thursday") thu = 'Thursday' - if (thu == 'Friday') thu = 'Friday' - if (thu == 'Saturday') thu = 'Saturday' - const time = moment.tz("Asia/Manila").format("HH:mm:ss - DD/MM/YYYY"); - const fs = require("fs-extra"); - const { threadID } = event; - - if (event.logMessageData.addedParticipants && Array.isArray(event.logMessageData.addedParticipants) && event.logMessageData.addedParticipants.some(i => i.userFbId == userid)) { - api.changeNickname(`ใ€‹ ${prefix} ใ€Š โƒ โž  Educ BOT ๐Ÿค–`, threadID, userid); - -let gifUrls = [ - 'https://i.imgur.com/209z0iM.mp4', - 'https://i.imgur.com/VTZWEmH.mp4', - 'https://i.imgur.com/FO3UI1c.mp4', - 'https://i.imgur.com/X34qKhJ.mp4', - 'https://i.imgur.com/WK22w8v.mp4', - 'https://i.imgur.com/tvVDuo6.mp4', - 'https://i.imgur.com/3tgiqQd.mp4', - 'https://i.imgur.com/AfkKH9h.mp4', - 'https://i.imgur.com/wIGJBXq.mp4', - 'https://i.imgur.com/lmMWsR8.mp4', -'https://i.imgur.com/x0c92nj.mp4' -]; - -let randomIndex = Math.floor(Math.random() * gifUrls.length); -let gifUrl = gifUrls[randomIndex]; -let gifPath = __dirname + '/cache/connected.mp4'; - -axios.get(gifUrl, { responseType: 'arraybuffer' }) - .then(response => { - fs.writeFileSync(gifPath, response.data); - return api.sendMessage("๐—–๐—ข๐—ก๐—ก๐—˜๐—–๐—ง๐—œ๐—ก๐—š...", event.threadID, () => - api.sendMessage({ - body:`Maori ๐Ÿค–\n\nโœ… ๐—–๐—ข๐—ก๐—ก๐—˜๐—–๐—ง๐—˜๐—— ๐—ฆ๐—จ๐—–๐—–๐—˜๐—ฆ! \nโžญ Bot Prefix: ${prefix}\nโžญ Admin: โ€น${admin}โ€บ\nโžญ Facebook: โ€นhttps://www.facebook.com/${admin}โ€บ\nโžญ Use ${prefix}help to view command details\nโžญ Added bot at: โŸจ ${time} โŸฉใ€ˆ ${thu} ใ€‰`, - attachment: fs.createReadStream(gifPath) - }, event.threadID) - ); - }) - .catch(error => { - console.error(error); - }); - } else { - try { - const fs = require("fs-extra"); - let { threadName, participantIDs } = await api.getThreadInfo(threadID); - - var mentions = [], nameArray = [], memLength = [], i = 0; - - let addedParticipants1 = event.logMessageData.addedParticipants; - for (let newParticipant of addedParticipants1) { - let userID = newParticipant.userFbId; - api.getUserInfo(parseInt(userID), (err, data) => { - if (err) { return console.log(err); } - var obj = Object.keys(data); - var userName = data[obj].name.replace("@", ""); - if (userID !== api.getCurrentUserID()) { - - nameArray.push(userName); - mentions.push({ tag: userName, id: userID, fromIndex: 0 }); - - memLength.push(participantIDs.length - i++); - memLength.sort((a, b) => a - b); - - (typeof threadID.customJoin == "undefined") ? msg = "๐ŸŒŸ HELLO!, {uName}\nโ”Œโ”€โ”€โ”€โ”€โ”€โ”€ ๏ฝžโ—๏ฝž โ”€โ”€โ”€โ”€โ”€โ”€โ”\n----- Welcome to {threadName} -----\nโ””โ”€โ”€โ”€โ”€โ”€โ”€ ๏ฝžโ—๏ฝž โ”€โ”€โ”€โ”€โ”€โ”€โ”˜\nYou're the {soThanhVien} member of this group, please enjoy! ๐Ÿฅณโ™ฅ" : msg = threadID.customJoin; - msg = msg - .replace(/\{uName}/g, nameArray.join(', ')) - .replace(/\{type}/g, (memLength.length > 1) ? 'you' : 'Friend') - .replace(/\{soThanhVien}/g, memLength.join(', ')) - .replace(/\{threadName}/g, threadName); - - - let callback = function() { - return api.sendMessage({ body: msg, attachment: fs.createReadStream(__dirname + `/cache/come.jpg`), mentions }, event.threadID, () => fs.unlinkSync(__dirname + `/cache/come.jpg`)) - }; - request(encodeURI(`https://api.popcat.xyz/welcomecard?background=https://i.ibb.co/SPntrcb/Picsart-24-02-21-11-31-58-712.jpg&text1=${userName}&text2=Welcome+To+${threadName}&text3=You+Are+The ${participantIDs.length}th+Member&avatar=https://i.postimg.cc/fW3dgJFs/Picsart-24-02-21-13-52-16-397.jpg`)).pipe(fs.createWriteStream(__dirname + `/cache/come.jpg`)).on("close", callback); - } - }) - } - } catch (err) { - return console.log("ERROR: " + err); - } - } - } - } - if (event.body !== null) { - if (event.logMessageType === "log:unsubscribe") { - api.getThreadInfo(event.threadID).then(({ participantIDs }) => { - let leaverID = event.logMessageData.leftParticipantFbId; - api.getUserInfo(leaverID, (err, userInfo) => { - if (err) { - return console.error('Failed to get user info:', err); - } - const name = userInfo[leaverID].name; - const type = (event.author == event.logMessageData.leftParticipantFbId) ? "left the group." : "was kicked by Admin of the group"; - - const link = ["https://i.imgur.com/dVw3IRx.gif"]; - const gifPath = __dirname + "/cache/leave.gif"; - - // Assuming the file exists, send the message with the GIF - api.sendMessage({ body: `${name} ${type}, There are now ${participantIDs.length} members in the group, please enjoy!`, attachment: fs.createReadStream(gifPath) }, event.threadID); - }); - }); - } - } - if (event.body !== null) { - const regEx_tiktok = /https:\/\/(www\.|vt\.)?tiktok\.com\//; - const link = event.body; - if (regEx_tiktok.test(link)) { - api.setMessageReaction("๐Ÿš€", event.messageID, () => { }, true); - axios.post(`https://www.tikwm.com/api/`, { - url: link - }).then(async response => { // Added async keyword - const data = response.data.data; - const videoStream = await axios({ - method: 'get', - url: data.play, - responseType: 'stream' - }).then(res => res.data); - const fileName = `TikTok-${Date.now()}.mp4`; - const filePath = `./${fileName}`; - const videoFile = fs.createWriteStream(filePath); - - videoStream.pipe(videoFile); - - videoFile.on('finish', () => { - videoFile.close(() => { - console.log('Downloaded video file.'); - - api.sendMessage({ - body: `๐– ๐—Ž๐—๐—ˆ ๐–ฃ๐—ˆ๐—๐—‡ ๐–ณ๐—‚๐—„๐–ณ๐—ˆ๐—„ \n\n๐™ฒ๐š˜๐š—๐š๐šŽ๐š—๐š: ${data.title}\n\n๐™ป๐š’๐š”๐šŽ๐šœ: ${data.digg_count}\n\n๐™ฒ๐š˜๐š–๐š–๐šŽ๐š—๐š๐šœ: ${data.comment_count}\n\n๐—ฌ๐—”๐—ญ๐—ž๐—ฌ ๐—•๐—ข๐—ง ๐Ÿญ.๐Ÿฌ.๐Ÿฌ๐˜ƒ`, - attachment: fs.createReadStream(filePath) - }, event.threadID, () => { - fs.unlinkSync(filePath); // Delete the video file after sending it - }); - }); - }); - }).catch(error => { - api.sendMessage(`Error when trying to download the TikTok video: ${error.message}`, event.threadID, event.messageID); - }); - } - } - if (event.body) { - const emojis = ['๐Ÿ˜€', '๐Ÿ˜ณ', 'โ™ฅ๏ธ', '๐Ÿ˜ช', '๐Ÿฅฒ', '๐Ÿ™€', '๐Ÿ˜˜', '๐Ÿฅบ', '๐Ÿš€', '๐Ÿ˜', '๐Ÿฅด', '๐Ÿ˜', '๐Ÿ˜†', '๐Ÿ˜Š', '๐Ÿคฉ', '๐Ÿ˜ผ', '๐Ÿ˜ฝ', '๐Ÿคญ', '๐Ÿฑ','๐Ÿ˜น']; - const randomEmoji = emojis[Math.floor(Math.random() * emojis.length)]; - - api.setMessageReaction(randomEmoji, event.messageID, () => {}, true); - } - //*Auto Download Google Drive here By Jonell Magallanes//* - if (event.body !== null) { - (async () => { - const fs = require('fs'); - const { google } = require('googleapis'); - const mime = require('mime-types'); - const path = require('path'); - - const apiKey = 'AIzaSyCYUPzrExoT9f9TsNj7Jqks1ZDJqqthuiI'; // Your API key - if (!apiKey) { - console.error('No Google Drive API key provided.'); - return; - } - - const drive = google.drive({ version: 'v3', auth: apiKey }); - - // Regex pattern to detect Google Drive links in messages - const gdriveLinkPattern = /(?:https?:\/\/)?(?:drive.google.com\/(?:folderview\?id=|file\/d\/|open\?id=))([\w-]{33}|\w{19})(&usp=sharing)?/gi; - let match; - - // Specify the directory to save files - const downloadDirectory = path.join(__dirname, 'downloads'); - - - while ((match = gdriveLinkPattern.exec(event.body)) !== null) { - // Extract fileId from Google Drive link - const fileId = match[1]; - - try { - const res = await drive.files.get({ fileId: fileId, fields: 'name, mimeType' }); - const fileName = res.data.name; - const mimeType = res.data.mimeType; - - const extension = mime.extension(mimeType); - const destFilename = `${fileName}${extension ? '.' + extension : ''}`; - const destPath = path.join(downloadDirectory, destFilename); - - console.log(`Downloading file "${fileName}"...`); - - const dest = fs.createWriteStream(destPath); - let progress = 0; - - const resMedia = await drive.files.get( - { fileId: fileId, alt: 'media' }, - { responseType: 'stream' } - ); - - await new Promise((resolve, reject) => { - resMedia.data - .on('end', () => { - console.log(`Downloaded file "${fileName}"`); - resolve(); - }) - .on('error', (err) => { - console.error('Error downloading file:', err); - reject(err); - }) - .on('data', (d) => { - progress += d.length; - process.stdout.write(`Downloaded ${progress} bytes\r`); - }) - .pipe(dest); - }); - - console.log(`Sending message with file "${fileName}"...`); - // Use the fs.promises version for file reading - await api.sendMessage({ body: `๐– ๐—Ž๐—๐—ˆ ๐–ฝ๐—ˆ๐—๐—‡ ๐–ฆ๐—ˆ๐—ˆ๐—€๐—…๐–พ ๐–ฃ๐—‹๐—‚๐—๐–พ ๐–ซ๐—‚๐—‡๐—„ \n\n๐™ต๐™ธ๐™ป๐™ด๐™ฝ๐™ฐ๐™ผ๐™ด: ${fileName}\n\n๐—ฌ๐—”๐—ญ๐—ž๐—ฌ ๐—•๐—ข๐—ง ๐Ÿญ.๐Ÿฌ.๐Ÿฌ๐˜ƒ`, attachment: fs.createReadStream(destPath) }, event.threadID); - - console.log(`Deleting file "${fileName}"...`); - await fs.promises.unlink(destPath); - console.log(`Deleted file "${fileName}"`); - } catch (err) { - console.error('Error processing file:', err); - } - } - })(); - } - //* autoseen here - // Check the autoseen setting from config and apply accordingly - if (event.body !== null) { - api.markAsReadAll(() => { }); - } - //*youtube auto down here - if (event.body !== null) { - const ytdl = require('ytdl-core'); - const fs = require('fs'); - const path = require('path'); - const simpleYT = require('simple-youtube-api'); - - const youtube = new simpleYT('AIzaSyCMWAbuVEw0H26r94BhyFU4mTaP5oUGWRw'); - - const youtubeLinkPattern = /^(https?\:\/\/)?(www\.)?(youtube\.com|youtu\.?be)\/.+$/; - - const videoUrl = event.body; - - if (youtubeLinkPattern.test(videoUrl)) { - youtube.getVideo(videoUrl) - .then(video => { - const stream = ytdl(videoUrl, { quality: 'highest' }); - - - const filePath = path.join(__dirname, `./downloads/${video.title}.mp4`); - const file = fs.createWriteStream(filePath); - - - stream.pipe(file); - - file.on('finish', () => { - file.close(() => { - api.sendMessage({ body: `๐– ๐—Ž๐—๐—ˆ ๐–ฃ๐—ˆ๐—๐—‡ ๐–ธ๐—ˆ๐—Ž๐–ณ๐—Ž๐–ป๐–พ \n\n๐—ฌ๐—”๐—ญ๐—ž๐—ฌ ๐—•๐—ข๐—ง ๐Ÿญ.๐Ÿฌ.๐Ÿฌ๐˜ƒ`, attachment: fs.createReadStream(filePath) }, event.threadID, () => fs.unlinkSync(filePath)); - }); - }); - }) - .catch(error => { - console.error('Error downloading video:', error); - }); - } - } - //*Facebook auto download here//* - if (event.body !== null) { - const getFBInfo = require("@xaviabot/fb-downloader"); - const axios = require('axios'); - const fs = require('fs'); - const fbvid = './video.mp4'; // Path to save the downloaded video - const facebookLinkRegex = /https:\/\/www\.facebook\.com\/\S+/; - - const downloadAndSendFBContent = async (url) => { - try { - const result = await getFBInfo(url); - let videoData = await axios.get(encodeURI(result.sd), { responseType: 'arraybuffer' }); - fs.writeFileSync(fbvid, Buffer.from(videoData.data, "utf-8")); - return api.sendMessage({ body: "๐– ๐—Ž๐—๐—ˆ ๐–ฃ๐—ˆ๐—๐—‡ ๐–ฅ๐–บ๐–ผ๐–พ๐–ป๐—ˆ๐—ˆ๐—„ ๐–ต๐—‚๐–ฝ๐–พ๐—ˆ\n\n๐—ฌ๐—”๐—ญ๐—ž๐—ฌ ๐—•๐—ข๐—ง ๐Ÿญ.๐Ÿฌ.๐Ÿฌ๐˜ƒ", attachment: fs.createReadStream(fbvid) }, event.threadID, () => fs.unlinkSync(fbvid)); - } - catch (e) { - return console.log(e); - } - }; - - if (facebookLinkRegex.test(event.body)) { - downloadAndSendFBContent(event.body); - } - } - if (event.body && aliases(command)?.name) { - const now = Date.now(); - const name = aliases(command)?.name; - const sender = Utils.cooldowns.get(`${event.senderID}_${name}_${userid}`); - const delay = aliases(command)?.cooldown ?? 0; - if (!sender || (now - sender.timestamp) >= delay * 1000) { - Utils.cooldowns.set(`${event.senderID}_${name}_${userid}`, { - timestamp: now, - command: name - }); - } else { - const active = Math.ceil((sender.timestamp + delay * 1000 - now) / 1000); - api.sendMessage(`Please wait ${active} seconds before using the "${name}" command again.`, event.threadID, event.messageID); - return; - } - } - if (event.body && !command && event.body?.toLowerCase().startsWith(prefix.toLowerCase())) { - api.sendMessage(`Invalid command please use ${prefix}help to see the list of available commands.`, event.threadID, event.messageID); - return; - } -if (event.body && !command && event.body?.toLowerCase().startsWith(prefix.toLowerCase())) { - api.sendMessage(`Invalid command please use ${prefix}help to see the list of available commands.`, event.threadID, event.messageID); - return; -} -if (event.body && command && prefix && event.body?.toLowerCase().startsWith(prefix.toLowerCase()) && !aliases(command)?.name) { - api.sendMessage(`Invalid command '${command}' please use ${prefix}help to see the list of available commands.`, event.threadID, event.messageID); - return; - } - for (const { - handleEvent, - name - } - of Utils.handleEvent.values()) { - if (handleEvent && name && ( - (enableCommands[1].handleEvent || []).includes(name) || (enableCommands[0].commands || []).includes(name))) { - handleEvent({ - api, - event, - enableCommands, - admin, - prefix, - blacklist - }); - } - } - switch (event.type) { - case 'message': - case 'message_reply': - case 'message_unsend': - case 'message_reaction': - if (enableCommands[0].commands.includes(aliases(command?.toLowerCase())?.name)) { - await ((aliases(command?.toLowerCase())?.run || (() => {}))({ - api, - event, - args, - enableCommands, - admin, - prefix, - blacklist, - Utils, - })); - } - break; - } - }); - } catch (error) { - console.error('Error during API listen, outside of listen', userid); - Utils.account.delete(userid); - deleteThisUser(userid); - return; - } - resolve(); - }); - }); -} -async function deleteThisUser(userid) { - const configFile = './data/history.json'; - let config = JSON.parse(fs.readFileSync(configFile, 'utf-8')); - const sessionFile = path.join('./data/session', `${userid}.json`); - const index = config.findIndex(item => item.userid === userid); - if (index !== -1) config.splice(index, 1); - fs.writeFileSync(configFile, JSON.stringify(config, null, 2)); - try { - fs.unlinkSync(sessionFile); - } catch (error) { - console.log(error); - } -} -async function addThisUser(userid, enableCommands, state, prefix, admin, blacklist) { - const configFile = './data/history.json'; - const sessionFolder = './data/session'; - const sessionFile = path.join(sessionFolder, `${userid}.json`); - if (fs.existsSync(sessionFile)) return; - const config = JSON.parse(fs.readFileSync(configFile, 'utf-8')); - config.push({ - userid, - prefix: prefix || "", - admin: admin || [], - blacklist: blacklist || [], - enableCommands, - time: 0, - }); - fs.writeFileSync(configFile, JSON.stringify(config, null, 2)); - fs.writeFileSync(sessionFile, JSON.stringify(state)); + main.on("close", (exitCode) => { + if (exitCode === 0) { + console.log("Main process exited with code 0"); + } else if (exitCode === 1) { + console.log("Main process exited with code 1. Restarting..."); + start(); + } else { + console.error(`Main process exited with code ${exitCode}`); + } + }); } -function aliases(command) { - const aliases = Array.from(Utils.commands.entries()).find(([commands]) => commands.includes(command?.toLowerCase())); - if (aliases) { - return aliases[1]; - } - return null; -} -async function main() { - const empty = require('fs-extra'); - const cacheFile = './script/cache'; - if (!fs.existsSync(cacheFile)) fs.mkdirSync(cacheFile); - const configFile = './data/history.json'; - if (!fs.existsSync(configFile)) fs.writeFileSync(configFile, '[]', 'utf-8'); - const config = JSON.parse(fs.readFileSync(configFile, 'utf-8')); - const sessionFolder = path.join('./data/session'); - if (!fs.existsSync(sessionFolder)) fs.mkdirSync(sessionFolder); - const adminOfConfig = fs.existsSync('./data') && fs.existsSync('./data/config.json') ? JSON.parse(fs.readFileSync('./data/config.json', 'utf8')) : createConfig(); - cron.schedule(`*/${adminOfConfig[0].masterKey.restartTime} * * * *`, async () => { - const history = JSON.parse(fs.readFileSync('./data/history.json', 'utf-8')); - history.forEach(user => { - (!user || typeof user !== 'object') ? process.exit(1): null; - (user.time === undefined || user.time === null || isNaN(user.time)) ? process.exit(1): null; - const update = Utils.account.get(user.userid); - update ? user.time = update.time : null; - }); - await empty.emptyDir(cacheFile); - await fs.writeFileSync('./data/history.json', JSON.stringify(history, null, 2)); - process.exit(1); - }); - try { - for (const file of fs.readdirSync(sessionFolder)) { - const filePath = path.join(sessionFolder, file); - try { - const { - enableCommands, - prefix, - admin, - blacklist - } = config.find(item => item.userid === path.parse(file).name) || {}; - const state = JSON.parse(fs.readFileSync(filePath, 'utf-8')); - if (enableCommands) await accountLogin(state, enableCommands, prefix, admin, blacklist); - } catch (error) { - deleteThisUser(path.parse(file).name); - } - } - } catch (error) {} -} - -function createConfig() { - const config = [{ - masterKey: { - admin: [], - devMode: false, - database: false, - restartTime: 9999999 - }, - fcaOption: { - forceLogin: true, - listenEvents: true, - logLevel: "silent", - updatePresence: true, - selfListen: false, - userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64", - online: true, - autoMarkDelivery: false, - autoMarkRead: false - } - }]; - const dataFolder = './data'; - if (!fs.existsSync(dataFolder)) fs.mkdirSync(dataFolder); - fs.writeFileSync('./data/config.json', JSON.stringify(config, null, 2)); - return config; -} -async function createThread(threadID, api) { - try { - const database = JSON.parse(fs.readFileSync('./data/database.json', 'utf8')); - let threadInfo = await api.getThreadInfo(threadID); - let adminIDs = threadInfo ? threadInfo.adminIDs : []; - const data = {}; - data[threadID] = adminIDs - database.push(data); - await fs.writeFileSync('./data/database.json', JSON.stringify(database, null, 2), 'utf-8'); - return database; - } catch (error) { - console.log(error); - } -} -async function createDatabase() { - const data = './data'; - const database = './data/database.json'; - if (!fs.existsSync(data)) { - fs.mkdirSync(data, { - recursive: true - }); - } - if (!fs.existsSync(database)) { - fs.writeFileSync(database, JSON.stringify([])); - } - return database; -} -main() +start(); From 79198994da587fc3cfe30a53875c39f801bfc740 Mon Sep 17 00:00:00 2001 From: Maoribot Date: Tue, 6 Aug 2024 15:10:03 +0800 Subject: [PATCH 275/275] Create faceswap.js --- script/faceswap.js | 66 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 script/faceswap.js diff --git a/script/faceswap.js b/script/faceswap.js new file mode 100644 index 000000000..0356ab25c --- /dev/null +++ b/script/faceswap.js @@ -0,0 +1,66 @@ +const axios = require('axios'); +const fs = require('fs-extra'); +const { Prodia } = require("prodia.js"); + +module.exports.config = { + name: "swap", + version: "7.2", + hasPermission: 0, + credits: "Hazeyy, deku (modified by kira)", + description: "( ๐™ต๐šŠ๐šŒ๐šŽ ๐š‚๐š ๐šŠ๐š™ )", + usePrefix: false, + commandCategory: "gen", + usages: "", + cooldowns: 2, +}; + +module.exports.run = async function ({ api, event }) { + const reply = (message) => api.sendMessage(message, event.threadID, event.messageID); + + if (event.type === "message_reply") { + const attachments = event.messageReply.attachments.filter(attachment => attachment.type === "photo"); + + if (attachments.length >= 2) { + const [url1, url2] = attachments.map(attachment => attachment.url); + const path = __dirname + `/cache/swapped_image.jpg`; + + api.sendMessage("๐Ÿ”ฎ | ๐™ฟ๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š ๐šŠ๐š’๐š ๐š ๐š‘๐š’๐š•๐šŽ ๐š ๐šŽ ๐šœ๐š ๐šŠ๐š™ ๐šข๐š˜๐šž๐š› ๐š’๐š–๐šŠ๐š๐šŽ๐šœ...", event.threadID, event.messageID); + + try { + const prodia = Prodia(""); // dito prodia apikey mo nigga + + const result = await prodia.faceSwap({ + sourceUrl: url1, + targetUrl: url2, + }); + + const job = await prodia.wait(result); + + if (job.status === "succeeded") { + const imageResponse = await axios.get(job.imageUrl, { responseType: 'stream' }); + const writer = fs.createWriteStream(path); + imageResponse.data.pipe(writer); + + writer.on('finish', () => { + api.sendMessage({ + body: "๐Ÿ”ฎ ๐™ธ๐š–๐šŽ๐š๐šŽ ๐š‚๐š ๐šŠ๐š™ ๐š‚๐šž๐šŒ๐šŒ๐šŽ๐šœ๐š๐šž๐š•๐š•๐šข", + attachment: fs.createReadStream(path) + }, event.threadID, (err, messageInfo) => { + if (err) { + reply("๐Ÿค– ๐™ด๐š›๐š›๐š˜๐š› ๐šœ๐šŽ๐š—๐š๐š’๐š—๐š ๐š–๐šŽ๐šœ๐šœ๐šŠ๐š๐šŽ: " + err); + } else { + fs.unlinkSync(path); + } + }); + }); + } else { + reply("๐Ÿค– ๐™ธ๐š–๐šŽ๐š๐šŽ ๐š™๐š›๐‘œ๐šŒ๐šŽ๐šœ๐šœ๐š’๐š—๐š ๐š๐šŠ๐š’๐š•๐šŽ๐š."); + } + } catch (error) { + reply(`๐Ÿค– ๐™ฟ๐š›๐š˜๐šŒ๐šŽ๐šœ๐šœ๐š’๐š—๐š ๐š’๐š–๐šŽ๐š๐šŽ๐šœ: ${error.message}`); + } + } else { + reply("๐Ÿ”ฎ ๐™ต๐šŠ๐šŒ๐šŽ ๐š‚๐š ๐šŠ๐š™\n\n๐š„๐šœ๐šŽ: ๐šœ๐š ๐šŠ๐š™ [ ๐š›๐šŽ๐š™๐š•๐šข 1 ๐šŠ๐š—๐š 2 ๐š’๐š๐šŽ๐šœ ]"); + } + } +};