diff --git a/account.dev.txt b/account.dev.txt new file mode 100644 index 0000000000..cdb171ac2b --- /dev/null +++ b/account.dev.txt @@ -0,0 +1,128 @@ +[ + { + "key": "dbln", + "value": "%7B%2261558668417023%22%3A%22U6UZhRDe%22%7D", + "domain": "facebook.com", + "path": "/login/device-based/", + "hostOnly": false, + "creation": "2024-05-11T14:33:15.580Z", + "lastAccessed": "2024-05-11T14:33:15.585Z" + }, + { + "key": "datr", + "value": "VoE_Zqvkohm_icg8eRaS5D6Z", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-05-11T14:33:15.585Z", + "lastAccessed": "2024-05-11T14:33:15.585Z" + }, + { + "key": "sb", + "value": "VoE_ZruvsiFn13SjX6BbJ_fO", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-05-11T14:33:15.585Z", + "lastAccessed": "2024-05-11T14:33:15.585Z" + }, + { + "key": "m_pixel_ratio", + "value": "2", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-05-11T14:33:15.585Z", + "lastAccessed": "2024-05-11T14:33:15.585Z" + }, + { + "key": "fr", + "value": "0z6pyMjisN2QRaBlk.AWW6a3OxPyp2PdnrQerJWLv7zVI.BmP4FW..AAA.0.0.BmP4GO.AWUbfStZHY8", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-05-11T14:33:15.585Z", + "lastAccessed": "2024-05-11T14:33:15.585Z" + }, + { + "key": "c_user", + "value": "61558668417023", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-05-11T14:33:15.585Z", + "lastAccessed": "2024-05-11T14:33:15.585Z" + }, + { + "key": "xs", + "value": "27%3A4aX30Zjy3j1QUg%3A2%3A1715437967%3A-1%3A7821", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-05-11T14:33:15.585Z", + "lastAccessed": "2024-05-11T14:33:15.585Z" + }, + { + "key": "x-referer", + "value": "eyJyIjoiL2Vycm9yL2luZGV4LnBocD9lcnI9ZWMma2Vycj0xMzU3MDA0JmtlcnJfc3VtbWFyeT1Tb3JyeSUyQyUyMHNvbWV0aGluZyUyMHdlbnQlMjB3cm9uZyZrZXJyX2Rlc2NyaXB0aW9uPVBsZWFzZSUyMHRyeSUyMGNsb3NpbmclMjBhbmQlMjByZS1vcGVuaW5nJTIweW91ciUyMGJyb3dzZXIlMjB3aW5kb3cuIiwiaCI6Ii9lcnJvci9pbmRleC5waHA%2FZXJyPWVjJmtlcnI9MTM1NzAwNCZrZXJyX3N1bW1hcnk9U29ycnklMkMlMjBzb21ldGhpbmclMjB3ZW50JTIwd3Jvbmcma2Vycl9kZXNjcmlwdGlvbj1QbGVhc2UlMjB0cnklMjBjbG9zaW5nJTIwYW5kJTIwcmUtb3BlbmluZyUyMHlvdXIlMjBicm93c2VyJTIwd2luZG93LiIsInMiOiJtIn0%3D", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-05-11T14:33:15.585Z", + "lastAccessed": "2024-05-11T14:33:15.585Z" + }, + { + "key": "m_page_voice", + "value": "61558668417023", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-05-11T14:33:15.585Z", + "lastAccessed": "2024-05-11T14:33:15.585Z" + }, + { + "key": "wd", + "value": "360x680", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-05-11T14:33:15.585Z", + "lastAccessed": "2024-05-11T14:33:15.585Z" + }, + { + "key": "locale", + "value": "en_US", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-05-11T14:33:15.585Z", + "lastAccessed": "2024-05-11T14:33:15.585Z" + }, + { + "key": "fbl_st", + "value": "101425690%3BT%3A28590632", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-05-11T14:33:15.585Z", + "lastAccessed": "2024-05-11T14:33:15.585Z" + }, + { + "key": "wl_cbv", + "value": "v2%3Bclient_version%3A2496%3Btimestamp%3A1715437972", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-05-11T14:33:15.585Z", + "lastAccessed": "2024-05-11T14:33:15.585Z" + }, + { + "key": "vpd", + "value": "v1%3B680x360x2", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2024-05-11T14:33:15.585Z", + "lastAccessed": "2024-05-11T14:33:15.585Z" + } +] diff --git a/config.dev.json b/config.dev.json new file mode 100644 index 0000000000..f8420cf268 --- /dev/null +++ b/config.dev.json @@ -0,0 +1,141 @@ +{ + "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": 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": [ + "YOUR UID" + ], + "whiteListMode": { + "enable": false, + "whiteListIds": [], + "notes": "if you enable this feature, only the ids in the whiteListIds section can use the bot" + }, + "nickNameBot": "BOT NAME", + "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": "kramn1205@gmail.com", + "clientId": "407168939339-ni7uvp8054bpnht4280n6d3no4qrf3mv.apps.googleusercontent.com", + "clientSecret": "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", + "refreshToken": "1//041Aj0DBzlyxuCgYIARAAGAQSNwF-L9IrSJFfXahDmIC5CaNNthQwg0yT8ZrFaUUofZBR13qsh-nNBLi7_4LZMlZ00F8AiWo6Moo", + "apiKey": "" + }, + "gRecaptcha": { + "siteKey": "6LdtgYMoAAAAABS1V6_RlEsUXf7dNLIzbc4EPhbt", + "secretKey": "6LdtgYMoAAAAAKXtH5f06qZBq28VXXqOb6rOSGQ5" + } + }, + "dashBoard": { + "enable": true, + "expireVerifyCode": 300000, + "port": 3001 + }, + "serverUptime": { + "enable": false, + "port": 3001, + "socket": { + "enable": true, + "channelName": "uptime", + "verifyToken": "" + } + }, + "autoRestart": { + "time": false, + "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 diff --git a/config.dev.txt b/config.dev.txt new file mode 100644 index 0000000000..945c9b46d6 --- /dev/null +++ b/config.dev.txt @@ -0,0 +1 @@ +. \ No newline at end of file diff --git a/config.json b/config.json index b9aebbbeea..945c9b46d6 100644 --- a/config.json +++ b/config.json @@ -1,145 +1 @@ -{ - "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 +. \ No newline at end of file diff --git a/configCommand.dev.json b/configCommand.dev.json new file mode 100644 index 0000000000..945c9b46d6 --- /dev/null +++ b/configCommand.dev.json @@ -0,0 +1 @@ +. \ No newline at end of file diff --git a/configCommands.dev.json b/configCommands.dev.json new file mode 100644 index 0000000000..3a1657f9f7 --- /dev/null +++ b/configCommands.dev.json @@ -0,0 +1,32 @@ +{ + "commandBanned": {}, + "envGlobal": { + "weatherApiKey": "d7e795ae6a0d44aaa8abb1a0a7ac19e4", + "goatbotApikey": "" + }, + "envCommands": { + "daily": { + "rewardDay1": { + "coin": 100, + "exp": 10 + } + }, + "notification": { + "delayPerGroup": 250 + }, + "rank": { + "deltaNext": 5 + }, + "rankup": { + "deltaNext": 5 + }, + "appstore": { + "limitResult": 3 + } + }, + "envEvents": { + "logsbot": { + "allow": true + } + } +} \ No newline at end of file diff --git a/configCommands.dev.txt b/configCommands.dev.txt new file mode 100644 index 0000000000..945c9b46d6 --- /dev/null +++ b/configCommands.dev.txt @@ -0,0 +1 @@ +. \ No newline at end of file diff --git a/configCommands.json b/configCommands.json index a237fd95df..945c9b46d6 100644 --- a/configCommands.json +++ b/configCommands.json @@ -1,32 +1 @@ -{ - "commandBanned": {}, - "envGlobal": { - "weatherApiKey": "d7e795ae6a0d44aaa8abb1a0a7ac19e4", - "goatbotApikey": "" - }, - "envCommands": { - "daily": { - "rewardDay1": { - "coin": 100, - "exp": 10 - } - }, - "notification": { - "delayPerGroup": 250 - }, - "rank": { - "deltaNext": 5 - }, - "rankup": { - "deltaNext": 5 - }, - "appstore": { - "limitResult": 3 - } - }, - "envEvents": { - "logsbot": { - "allow": true - } - } -} \ No newline at end of file +. \ No newline at end of file diff --git a/scripts/cmds/-tia b/scripts/cmds/-tia new file mode 100644 index 0000000000..3de7929b1c --- /dev/null +++ b/scripts/cmds/-tia @@ -0,0 +1,46 @@ +const axios = require('axios'); + +const apiEndpoint = 'https://lianeapi.onrender.com/@coffee_mark/api/tia?key=j86bwkwo-8hako-12C'; + +module.exports = { + config: { + name: 'tia', + version: '1.0', + author: 'Coffee', + role: 0, + category: 'Ai-Chat', + shortDescription: { + en: 'an Ai girl you can talk to as a friend.' + }, + longDescription: { + en: 'a lonesome girl you can talk to when bored.' + }, + guide: { + en: '{pn} [query]' + }, + }, + + onStart: async function ({ api, event, args }) { + try { + const query = args.join(' ') || 'hello'; + + const apiUrl = `${apiEndpoint}&query=${encodeURIComponent(query)}`; + const response = await axios.get(apiUrl); + + const trimmedMessage = response?.data?.message?.trim(); + + if (!trimmedMessage) { + throw new Error('Invalid or missing response from the API'); + } + + const responseWithHeaderAndFooter = `JELAI♡ ~⊰⁠⊹ฺ\n━━━━━━━━━━━━━━━━\n${trimmedMessage}\n━━━━━━━━━━━━━━━━`; + await api.sendMessage({ body: responseWithHeaderAndFooter }, event.threadID, event.messageID); + + console.log('Responded to the user'); + } catch (error) { + console.error(`❌ | There was an error getting a response: ${error.message}`); + const errorMessage = `❌ | An error occurred: ${error.message}\nYou can try typing your query again or resending it. There might be an issue with the server that's causing the problem, and it might resolve on retrying.`; + api.sendMessage(errorMessage, event.threadID); + } + }, +}; \ No newline at end of file diff --git a/scripts/cmds/Alldl.js b/scripts/cmds/Alldl.js new file mode 100644 index 0000000000..cb35b980b6 --- /dev/null +++ b/scripts/cmds/Alldl.js @@ -0,0 +1,98 @@ +const axios = require('axios'); +const fs = require('fs'); + +module.exports = { + config: { + name: "alldl", + version: "1.8", + author: "Samir Œ", + countDown: 5, + role: 0, + shortDescription: "download content by link", + longDescription: "download content", + category: "download", + guide: "{pn} link" + }, + + onStart: async function ({ message, args }) { + const link = args.join(" "); + if (!link) + return message.reply(`Please provide the link.`); + else { + let BASE_URL; + + if (link.includes("facebook.com")) { + BASE_URL = `https://apis-samir.onrender.com/fbdl?vid_url=${encodeURIComponent(link)}`; + } else if (link.includes("twitter.com") || link.includes("x.com")) { + BASE_URL = `https://apis-samir.onrender.com/twitter?url=${encodeURIComponent(link)}`; + } else if (link.includes("tiktok.com")) { + BASE_URL = `https://apis-samir.onrender.com/tiktok?url=${encodeURIComponent(link)}`; + } else if (link.includes("open.spotify.com")) { + BASE_URL = `https://apis-samir.onrender.com/spotifydl?url=${encodeURIComponent(link)}`; + + + try { + const apiResponse = await axios.get(BASE_URL); + + if (apiResponse.data.success) { + const metadata = apiResponse.data.metadata; + const audioUrl = apiResponse.data.link; + + message.reply("⬇ | Downloading the content for you"); + + const audioResponse = await axios.get(audioUrl, { responseType: 'arraybuffer' }); + fs.writeFileSync(__dirname + '/cache/spotify.mp3', Buffer.from(audioResponse.data)); + + message.reply({ + body: `• Title: ${metadata.title}\n• Album: ${metadata.album}\n• Artist: ${metadata.artists}\n• Released: ${metadata.releaseDate}`, + attachment: fs.createReadStream(__dirname + '/cache/spotify.mp3') + }); + } else { + message.reply("Sorry, the Spotify content could not be downloaded."); + } + } catch (error) { + console.error(error); + message.reply("Sorry, an error occurred while processing your request."); + } + + return; + } else if (link.includes("youtu.be") || link.includes("youtube.com")) { + const providedURL = `https://apis-samir.onrender.com/ytdl?url=${link}`; + message.reply({ + attachment: await global.utils.getStreamFromURL(providedURL), + }); + return; + } else if (link.includes("instagram.com")) { + BASE_URL = `https://apis-samir.onrender.com/igdl?url=${encodeURIComponent(link)}`; + } else { + return message.reply(`Unsupported source.`); + } + + message.reply("Processing your request... Please wait."); + + try { + let res = await axios.get(BASE_URL); + + let contentUrl; + + if (link.includes("facebook.com")) { + contentUrl = res.data.links["Download High Quality"]; + } else if (link.includes("twitter.com") || link.includes("x.com")) { + contentUrl = res.data.HD; + } else if (link.includes("tiktok.com")) { + contentUrl = res.data.hdplay; + } else if (link.includes("instagram.com")) { + contentUrl = res.downloadHref; + } + + const response = { + attachment: await global.utils.getStreamFromURL(contentUrl) + }; + + await message.reply(response); + } catch (error) { + message.reply(`Sorry, an error occurred: ${error.message}`); + } + } + } +}; \ No newline at end of file diff --git a/scripts/cmds/Remini.js b/scripts/cmds/Remini.js new file mode 100644 index 0000000000..ab5fdd1dbb --- /dev/null +++ b/scripts/cmds/Remini.js @@ -0,0 +1,51 @@ +const a = require('axios'); +const tinyurl = require('tinyurl'); + +module.exports = { + config: { + name: "remini", + version: "1.0", + author: "JARiF", + countDown: 15, + role: 0, + longDescription: "enhance 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: "┐( ̄ヘ ̄)┌ | Must reply to an image." }, + event.threadID + ); + } + } else if (args[0]?.match(/(https?:\/\/.*\.(?:png|jpg|jpeg))/g)) { + imageUrl = args[0]; + } else { + return api.sendMessage({ body: "┐( ̄ヘ ̄)┌ | Must reply to an image or provide an image URL." }, 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 Enhanced.", attachment: await global.utils.getStreamFromURL(resultUrl) }); + } catch (error) { + message.reply("(┌・。・)┌ | Api Dead..."); + } + } +}; \ No newline at end of file diff --git a/scripts/cmds/Spotify.js b/scripts/cmds/Spotify.js new file mode 100644 index 0000000000..ff93487a73 --- /dev/null +++ b/scripts/cmds/Spotify.js @@ -0,0 +1,154 @@ +const axios = require("axios"); +const fs = require('fs'); + +module.exports = { + config: { + name: "spotify", + aliases: [`spotifydl`], + version: "1.0", + author: "Samir Œ", + countDown: 0, + role: 0, + shortDescription: "Get audio from Spotify", + longDescription: "Get audio from Spotify", + category: "music", + guide: "{pn} reply or add link of image" + }, + + onStart: async function ({ api, event, args, message }) { + const query = args.join(" "); + + if (!query) { + return message.reply(" Please provide a track name."); + } + + const url = 'https://api-samir.onrender.com/spotifysearch?q=' + encodeURIComponent(query); + + try { + const response = await axios.get(url); + const tracks = response.data.data; + + if (tracks.length === 0) { + return message.reply(" | No tracks found for the given query."); + } + + const shuffledTracks = tracks.sort(() => Math.random() - 0.5); + const top6Tracks = shuffledTracks.slice(0, 6); + + const trackInfo = top6Tracks.map((track, index) => + `${index + 1}. ${track.title}\nPopularity: ${track.popularity}\nArtist: ${track.artist}` + ).join("\n\n"); + + const thumbnails = top6Tracks.map((track) => track.imageUrl); + const attachments = await Promise.all( + thumbnails.map((thumbnail) => + global.utils.getStreamFromURL(thumbnail) + ) + ); + + const replyMessage = await message.reply({ + body: `${trackInfo}\n\nType 'next' to see more tracks or reply with a number to choose.`, + attachment: attachments, + }); + + const data = { + commandName: this.config.name, + messageID: replyMessage.messageID, + tracks: top6Tracks, + currentIndex: 6, + originalQuery: query, + }; + global.GoatBot.onReply.set(replyMessage.messageID, data); + } catch (error) { + console.error(error); + api.sendMessage("Error: " + error, event.threadID); + } + }, + + onReply: async function ({ api, event, Reply, args, message }) { + const userInput = args[0].toLowerCase(); + const { tracks, currentIndex, originalQuery, previousMessageID, isFirstReply } = Reply; + + message.unsend(Reply.messageID); + + if (!isFirstReply && previousMessageID && userInput === 'next') { + if (!event.messageReply || event.messageReply.senderID !== api.getCurrentUserID()) { + message.unsend(previousMessageID); + } + } + + if (userInput === 'next') { + const nextUrl = `https://api-samir.onrender.com/spotifysearch?q=${encodeURIComponent(originalQuery)}`; + + try { + const response = await axios.get(nextUrl); + const nextTracks = response.data.data.slice(currentIndex, currentIndex + 6); + + if (nextTracks.length === 0) { + return message.reply("\u26A0 | No more tracks found for the given query."); + } + + const trackInfo = nextTracks.map((track, index) => + `${currentIndex + index + 1}. ${track.title}\nPopularity: ${track.popularity}\nArtist: ${track.artist}` + ).join("\n\n"); + + const thumbnails = nextTracks.map((track) => track.imageUrl); + const attachments = await Promise.all( + thumbnails.map((thumbnail) => + global.utils.getStreamFromURL(thumbnail) + ) + ); + + message.reply({ + body: `${trackInfo}\n\nType 'next' to see more tracks or reply with a number to choose.`, + attachment: attachments, + }, async (replyError, replyMessage) => { + const data = { + commandName: this.config.name, + messageID: replyMessage.messageID, + tracks: response.data.data, + currentIndex: currentIndex + 6, + originalQuery: originalQuery, + previousMessageID: replyMessage.messageID, + isFirstReply: false, + }; + global.GoatBot.onReply.set(replyMessage.messageID, data); + }); + } catch (error) { + console.error(error); + api.sendMessage("Error: " + error, event.threadID); + } + } else if (!isNaN(userInput) && userInput >= 1 && userInput <= tracks.length) { + const selectedTrack = tracks[userInput - 1]; + message.unsend(Reply.messageID); + + const downloadingMessage = await message.reply(`| Downloading track "${selectedTrack.title}"`); + + const downloadUrl = 'https://api-samir.onrender.com/spotifydl?url=' + encodeURIComponent(selectedTrack.url); + + try { + const apiResponse = await axios.get(downloadUrl); + + if (apiResponse.data.success) { + const metadata = apiResponse.data.metadata; + const audioUrl = apiResponse.data.link; + + const audioResponse = await axios.get(audioUrl, { responseType: 'arraybuffer' }); + fs.writeFileSync(__dirname + '/cache/spotify.mp3', Buffer.from(audioResponse.data)); + + message.reply({ + body: `• Title: ${metadata.title}\n• Album: ${metadata.album}\n• Artist: ${metadata.artists}\n• Released: ${metadata.releaseDate}`, + attachment: fs.createReadStream(__dirname + '/cache/spotify.mp3') + }); + } else { + message.reply("Sorry, the Spotify content could not be downloaded."); + } + } catch (error) { + console.error(error); + message.reply("Sorry, an error occurred while processing your request."); + } + + message.unsend(downloadingMessage.messageID); + } + } +}; \ No newline at end of file diff --git a/scripts/cmds/adc.js b/scripts/cmds/adc.js new file mode 100644 index 0000000000..da40d0ec52 --- /dev/null +++ b/scripts/cmds/adc.js @@ -0,0 +1,113 @@ +module.exports = { + config: { + name: "adc", + aliases: ["adc"], + version: "1.2", + author: "Loid Butter",//Follow Loid Senpai FB https://www.facebook.com/loidofficiaI + countDown: 5, + role: 2, + shortDescription: { + vi: "", + en: "adc command" + }, + longDescription: { + vi: "", + en: "only bot owner" + }, + category: "owner", + guide: { + en: "{pn}" + } + }, + +onStart: async function({ api, event, args }) { + const permission = ["100074862084605"]; + if (!permission.includes(event.senderID)) + return api.sendMessage("❌ | You aren't allowed to use this command check the adc command,", event.threadID, event.messageID); + const axios = require('axios'); + const fs = require('fs'); + const request = require('request'); + const cheerio = require('cheerio'); + const { join, resolve } = require("path"); + const { senderID, threadID, messageID, messageReply, type } = event; + var name = args[0]; + if (type == "message_reply") { + var text = messageReply.body; + } + if(!text && !name) return api.sendMessage('Please reply to the link you want to apply the code to or write the file name to upload the code to pastebin!', threadID, messageID); + if(!text && name) { + var data = fs.readFile( + `${__dirname}/${args[0]}.js`, + "utf-8", + async (err, data) => { + if (err) return api.sendMessage(`Command ${args[0]} does not exist!.`, threadID, messageID); + const { PasteClient } = require('pastebin-api') + const client = new PasteClient("N5NL5MiwHU6EbQxsGtqy7iaodOcHithV"); + async function pastepin(name) { + const url = await client.createPaste({ + code: data, + expireDate: 'N', + format: "javascript", + name: name, + publicity: 1 + }); + var id = url.split('/')[3] + return 'https://pastebin.com/raw/' + id + } + var link = await pastepin(args[1] || 'noname') + return api.sendMessage(link, threadID, messageID); + } + ); + return + } + var urlR = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/ + var url = text.match(urlR); + if (url[0].indexOf('pastebin') !== -1) { + axios.get(url[0]).then(i => { + var data = i.data + fs.writeFile( + `${__dirname}/${args[0]}.js`, + data, + "utf-8", + function (err) { + if (err) return api.sendMessage(`An error occurred while applying the code ${args[0]}.js`, threadID, messageID); + api.sendMessage(`Applied the code to ${args[0]}.js, use command load to use!`, threadID, messageID); + } + ); + }) + } + + if (url[0].indexOf('buildtool') !== -1 || url[0].indexOf('tinyurl.com') !== -1) { + const options = { + method: 'GET', + url: messageReply.body + }; + request(options, function (error, response, body) { + if (error) return api.sendMessage('Please only reply to the link (doesnt contain anything other than the link)', threadID, messageID); + const load = cheerio.load(body); + load('.language-js').each((index, el) => { + if (index !== 0) return; + var code = el.children[0].data + fs.writeFile(`${__dirname}/${args[0]}.js`, code, "utf-8", + function (err) { + if (err) return api.sendMessage(`An error occurred while applying the new code to "${args[0]}.js".`, threadID, messageID); + return api.sendMessage(`Added this code "${args[0]}.js", use command load to use!`, threadID, messageID); + } + ); + }); + }); + return + } + if (url[0].indexOf('drive.google') !== -1) { + var id = url[0].match(/[-\w]{25,}/) + const path = resolve(__dirname, `${args[0]}.js`); + try { + await utils.downloadFile(`https://drive.google.com/u/0/uc?id=${id}&export=download`, path); + return api.sendMessage(`Added this code "${args[0]}.js" If there is an error, change the drive file to txt!`, threadID, messageID); + } + catch(e) { + return api.sendMessage(`An error occurred while applying the new code to "${args[0]}.js".`, threadID, messageID); + } + } + } +} \ No newline at end of file diff --git a/scripts/cmds/ai.js b/scripts/cmds/ai.js new file mode 100644 index 0000000000..19c73dccba --- /dev/null +++ b/scripts/cmds/ai.js @@ -0,0 +1,63 @@ +const axios = require('axios'); + +async function fetchFromAI(url, params) { + try { + const response = await axios.get(url, { params }); + return response.data; + } catch (error) { + console.error(error); + return null; + } +} + +async function getAIResponse(input, userId, messageID) { + const services = [ + { url: 'https://ai-tools.replit.app/gpt', params: { prompt: input, uid: userId } }, + { url: 'https://openaikey-x20f.onrender.com/api', params: { prompt: input } }, + { url: 'http://fi1.bot-hosting.net:6518/gpt', params: { query: input } }, + { url: 'https://ai-chat-gpt-4-lite.onrender.com/api/hercai', params: { question: input } } + ]; + + let response = "𝗔𝗦𝗦𝗜𝗦𝗧𝗔𝗡𝗧 𝗜𝗦 𝗔𝗟𝗜𝗩𝗘 🪄✅."; + let currentIndex = 0; + + for (let i = 0; i < services.length; i++) { + const service = services[currentIndex]; + const data = await fetchFromAI(service.url, service.params); + if (data && (data.gpt4 || data.reply || data.response)) { + response = data.gpt4 || data.reply || data.response; + break; + } + currentIndex = (currentIndex + 1) % services.length; // Move to the next service in the cycle + } + + return { response, messageID }; +} + +module.exports = { + config: { + name: 'ai', + author: 'Arn', + role: 0, + category: 'ai', + shortDescription: 'ai to ask anything', + }, + onStart: async function ({ api, event, args }) { + const input = args.join(' ').trim(); + if (!input) { + api.sendMessage(`𝗔𝗦𝗦𝗜𝗦𝗧𝗔𝗡𝗧 𝗔𝗡𝗦𝗪𝗘𝗥𝗘𝗗✅\n━━━━━━━━━━━━━━━━\nPlease provide a question or statement.\n━━━━━━━━━━━━━━━━`, event.threadID, event.messageID); + return; + } + + const { response, messageID } = await getAIResponse(input, event.senderID, event.messageID); + api.sendMessage(`𝗔𝗦𝗦𝗜𝗦𝗧𝗔𝗡𝗧 𝗔𝗡𝗦𝗪𝗘𝗥𝗘𝗗✅ \n━━━━━━━━━━━━━━━━\n${response}\n━━━━━━━━━━━━━━━━`, event.threadID, messageID); + }, + onChat: async function ({ event, message }) { + const messageContent = event.body.trim().toLowerCase(); + if (messageContent.startsWith("ai")) { + const input = messageContent.replace(/^ai\s*/, "").trim(); + const { response, messageID } = await getAIResponse(input, event.senderID, message.messageID); + message.reply(`𝗔𝗦𝗦𝗜𝗦𝗧𝗔𝗡𝗧 𝗔𝗡𝗦𝗪𝗘𝗥𝗘𝗗✅\n━━━━━━━━━━━━━━━━\n${response}\n━━━━━━━━━━━━━━━━`, messageID); + } + } +}; \ No newline at end of file diff --git a/scripts/cmds/album.js b/scripts/cmds/album.js new file mode 100644 index 0000000000..362d8acaa1 --- /dev/null +++ b/scripts/cmds/album.js @@ -0,0 +1,180 @@ +const fs = require("fs-extra"); +const axios = require("axios"); +const { createReadStream } = require("fs"); +const { join } = require("path"); + +module.exports = { + config: { + name: "album", + aliases: ["gallery"], + version: "2.0", + author: "Vex_kshitiz", + countDown: 5, + role: 0, + shortDescription: "album or gallery to save attachments of users", + longDescription: "save your videos audios or images with specific title for each attachments.", + category: "utility", + guide: { + en: "To store an attachment: {p}album add {title}\nTo view specific albums content: {p}album audio / {p}album video / {p}album image\nTo view saved attachments: {p}album show {title} ", + }, + }, + + onStart: async function ({ api, event, args }) { + const senderID = event.senderID; + const command = args[0]; + const title = args.slice(1).join(" "); + + try { + const albumPath = `./albums/${senderID}`; + const imagePath = `${albumPath}/images`; + const videoPath = `${albumPath}/videos`; + const audioPath = `${albumPath}/audios`; + + await fs.ensureDir(albumPath); + await fs.ensureDir(imagePath); + await fs.ensureDir(videoPath); + await fs.ensureDir(audioPath); + + if (command === "add" && title && event.messageReply && event.messageReply.attachments && event.messageReply.attachments.length > 0) { + const attachment = event.messageReply.attachments[0]; + const attachmentType = attachment.type.split("/")[0]; + const attachmentURL = attachment.url; + let filePath = ''; + + if (attachmentType === 'photo') { + filePath = join(imagePath, `${title}.png`); + } else if (attachmentType === 'video') { + filePath = join(videoPath, `${title}.mp4`); + } else if (attachmentType === 'audio') { + filePath = join(audioPath, `${title}.mp3`); + } else { + api.sendMessage(`Unsupported file type.`, event.threadID, event.messageID); + return; + } + + if (fs.existsSync(filePath)) { + api.sendMessage(`A file with the title "${title}"\nalready exists.\nPlease choose another title.`, event.threadID, event.messageID); + return; + } + + const response = await axios.get(attachmentURL, { responseType: "stream" }); + const fileStream = fs.createWriteStream(filePath); + response.data.pipe(fileStream); + + return new Promise((resolve, reject) => { + fileStream.on("finish", () => { + api.sendMessage(`Attachment saved successfully\nwith title "${title}".`, event.threadID, event.messageID); + resolve(); + }); + fileStream.on("error", (err) => { + reject(err); + }); + }); + } else if (command === "audio" || command === "video" || command === "image") { + const files = await fs.readdir(join(albumPath, command + "s")); + + if (files.length === 0) { + api.sendMessage(`This album is currently empty.`, event.threadID, event.messageID); + return; + } + + let message = ""; + files.forEach((file, index) => { + message += `${index + 1}. ${file.replace(/\.[^/.]+$/, "")}\n`; + }); + + api.sendMessage(message, event.threadID, (err, info) => { + if (err) { + console.error(err); + return; + } + global.GoatBot.onReply.set(info.messageID, { + commandName: "album", + senderID: senderID, + messageType: command, + files: files, + }); + }); + } else if (command === "show" || command === "view") { + let found = false; + for (let type of ["audio", "video", "image"]) { + const filePath = join(albumPath, type + "s", `${title}.${type === "image" ? "png" : type === "video" ? "mp4" : "mp3"}`); + if (await fs.pathExists(filePath)) { + api.sendMessage({ + attachment: createReadStream(filePath) + }, event.threadID, event.messageID); + found = true; + break; + } + } + if (!found) { + api.sendMessage(`No media found with the title "${title}".`, event.threadID, event.messageID); + return; + } + } else if (command === "del") { + let deleted = false; + for (let type of ["audio", "video", "image"]) { + const filePath = join(albumPath, type + "s", `${title}.${type === "image" ? "png" : type === "video" ? "mp4" : "mp3"}`); + if (await fs.pathExists(filePath)) { + await fs.unlink(filePath); + api.sendMessage(`"${title}" deleted successfully.`, event.threadID, event.messageID); + deleted = true; + break; + } + } + if (!deleted) { + api.sendMessage(`No media found with the title "${title}".`, event.threadID, event.messageID); + return; + } + } else if (command === "all") { + let message = ""; + for (let type of ["audio", "video", "image"]) { + const files = await fs.readdir(join(albumPath, type + "s")); + if (files.length > 0) { + message += `[${type}]\n`; + files.forEach((file, index) => { + message += `${index + 1}. ${file.replace(/\.[^/.]+$/, "")}\n`; + }); + } + } + if (message === "") { + message = "All albums are currently empty."; + } + api.sendMessage(message, event.threadID, event.messageID); + } else { + api.sendMessage("Invalid command. Please use the correct syntax.", event.threadID, event.messageID); + } + } catch (err) { + console.error(err); + api.sendMessage("An error occurred.", event.threadID, event.messageID); + } + }, + + onReply: async function ({ api, event, Reply, args }) { + const { commandName, senderID, messageType, files } = Reply; + + if (commandName !== "album" || senderID !== event.senderID || !messageType || !files) { + return; + } + + const fileIndex = parseInt(args[0], 10); + + if (isNaN(fileIndex) || fileIndex <= 0 || fileIndex > files.length) { + api.sendMessage({ body: "Invalid input.\nPlease provide a valid number." }, event.threadID, event.messageID); + return; + } + + const selectedFile = files[fileIndex - 1]; + const filePath = join("./albums", senderID, messageType + "s", selectedFile); + + try { + const fileStream = fs.createReadStream(filePath); + api.sendMessage({ body: `Here is your ${messageType}:`, attachment: fileStream }, event.threadID, event.messageID); + } catch (error) { + console.error(error); + api.sendMessage({ body: "An error occurred while processing the file.\nPlease try again later." }, event.threadID); + } finally { + global.GoatBot.onReply.delete(event.messageID); + } + }, +}; \ No newline at end of file diff --git a/scripts/cmds/font.js b/scripts/cmds/font.js new file mode 100644 index 0000000000..2674f32434 --- /dev/null +++ b/scripts/cmds/font.js @@ -0,0 +1,282 @@ +const axios = require("axios"); +const fs = require("fs"); + +const fontMaps = [ + { + name: 'cursive', + map: { + ' ': ' ', + 'a': '𝓪', 'b': '𝓫', 'c': '𝓬', 'd': '𝓭', 'e': '𝓮', 'f': '𝓯', 'g': '𝓰', 'h': '𝓱', + 'i': '𝓲', 'j': '𝓳', 'k': '𝓴', 'l': '𝓵', 'm': '𝓶', 'n': '𝓷', 'o': '𝓸', 'p': '𝓹', 'q': '𝓺', + 'r': '𝓻', 's': '𝓼', 't': '𝓽', 'u': '𝓾', 'v': '𝓿', 'w': '𝔀', 'x': '𝔁', 'y': '𝔂', 'z': '𝔃', + 'A': '𝓐', 'B': '𝓑', 'C': '𝓒', 'D': '𝓓', 'E': '𝓔', 'F': '𝓕', 'G': '𝓖', 'H': '𝓗', + 'I': '𝓘', 'J': '𝓙', 'K': '𝓚', 'L': '𝓛', 'M': '𝓜', 'N': '𝓝', 'O': '𝓞', 'P': '𝓟', 'Q': '𝓠', + 'R': '𝓡', 'S': '𝓢', 'T': '𝓣', 'U': '𝓤', 'V': '𝓥', 'W': '𝓦', 'X': '𝓧', 'Y': '𝓨', 'Z': '𝓩', + }, + }, + { + name: 'comic', + map: { + ' ': ' ', + 'a': '𝕒', 'b': '𝕓', 'c': '𝕔', 'd': '𝕕', 'e': '𝕖', 'f': '𝕗', 'g': '𝕘', 'h': '𝕙', + 'i': '𝕚', 'j': '𝕛', 'k': '𝕜', 'l': '𝕝', 'm': '𝕞', 'n': '𝕟', 'o': '𝕠', 'p': '𝕡', 'q': '𝕢', + 'r': '𝕣', 's': '𝕤', 't': '𝕥', 'u': '𝕦', 'v': '𝕧', 'w': '𝕨', 'x': '𝕩', 'y': '𝕪', 'z': '𝕫', + 'A': '𝔸', 'B': '𝔹', 'C': 'ℂ', 'D': '𝔻', 'E': '𝔼', 'F': '𝔽', 'G': '𝔾', 'H': 'ℍ', + 'I': '𝕀', 'J': '𝕁', 'K': '𝕂', 'L': '𝕃', 'M': '𝕄', 'N': 'ℕ', 'O': '𝕆', 'P': 'ℙ', 'Q': 'ℚ', + 'R': 'ℝ', 'S': '𝕊', 'T': '𝕋', 'U': '𝕌', 'V': '𝕍', 'W': '𝕎', 'X': '𝕏', 'Y': '𝕐', 'Z': 'ℤ', + }, + }, + { + name: 'bold', + map: { + ' ': ' ', + 'a': '𝗮', 'b': '𝗯', 'c': '𝗰', 'd': '𝗱', 'e': '𝗲', 'f': '𝗳', 'g': '𝗴', 'h': '𝗵', + 'i': '𝗶', 'j': '𝗷', 'k': '𝗸', 'l': '𝗹', 'm': '𝗺', 'n': '𝗻', 'o': '𝗼', 'p': '𝗽', 'q': '𝗾', + 'r': '𝗿', 's': '𝘀', 't': '𝘁', 'u': '𝘂', 'v': '𝘃', 'w': '𝘄', 'x': '𝘅', 'y': '𝘆', 'z': '𝘇', + 'A': '𝗔', 'B': '𝗕', 'C': '𝗖', 'D': '𝗗', 'E': '𝗘', 'F': '𝗙', 'G': '𝗚', 'H': '𝗛', + 'I': '𝗜', 'J': '𝗝', 'K': '𝗞', 'L': '𝗟', 'M': '𝗠', 'N': '𝗡', 'O': '𝗢', 'P': '𝗣', 'Q': '𝗤', + 'R': '𝗥', 'S': '𝗦', 'T': '𝗧', 'U': '𝗨', 'V': '𝗩', 'W': '𝗪', 'X': '𝗫', 'Y': '𝗬', 'Z': '𝗭', + }, + }, +{ + name: 'italic', + map: { + ' ': ' ', + 'a': '𝑎', 'b': '𝑏', 'c': '𝑐', 'd': '𝑑', 'e': '𝑒', 'f': '𝑓', 'g': '𝑔', 'h': 'ℎ', + 'i': '𝑖', 'j': '𝑗', 'k': '𝑘', 'l': '𝑙', 'm': '𝑚', 'n': '𝑛', 'o': '𝑜', 'p': '𝑝', 'q': '𝑞', + 'r': '𝑟', 's': '𝑠', 't': '𝑡', 'u': '𝑢', 'v': '𝑣', 'w': '𝑤', 'x': '𝑥', 'y': '𝑦', 'z': '𝑧', + 'A': '𝐴', 'B': '𝐵', 'C': '𝐶', 'D': '𝐷', 'E': '𝐸', 'F': '𝐹', 'G': '𝐺', 'H': '𝐻', 'I': '𝐼', + 'J': '𝐽', 'K': '𝐾', 'L': '𝐿', 'M': '𝑀', 'N': '𝑁', 'O': '𝑂', 'P': '𝑃', 'Q': '𝑄', 'R': '𝑅', + 'S': '𝑆', 'T': '𝑇', 'U': '𝑈', 'V': '𝑉', 'W': '𝑊', 'X': '𝑋', 'Y': '𝑌', 'Z': '𝑍', + }, +}, + + { + name: 'fraktur', + map: { + ' ': ' ', + 'a': '𝔄', 'b': '𝔅', 'c': '𝔇', 'd': '𝔈', 'e': '𝔉', 'f': '𝔉', 'g': '𝔊', 'h': '𝔍', + 'i': '𝔎', 'j': '𝔏', 'k': '𝔐', 'l': '𝔏', 'm': '𝔑', 'n': '𝔒', 'o': '𝔒', 'p': '𝔓', 'q': '𝔔', + 'r': '𝔕', 's': '𝔖', 't': '𝔗', 'u': '𝔘', 'v': '𝔙', 'w': '𝔚', 'x': '𝔛', 'y': '𝔜', 'z': '𝔷', + 'A': '𝔄', 'B': '𝔅', 'C': 'ℭ', 'D': '𝔇', 'E': '𝔈', 'F': '𝔉', 'G': '𝔊', 'H': 'ℌ', + 'I': 'ℑ', 'J': '𝔍', 'K': '𝔎', 'L': '𝔏', 'M': '𝔐', 'N': '𝔑', 'O': '𝔒', 'P': '𝔓', 'Q': '𝔔', + 'R': 'ℜ', 'S': '𝔖', 'T': '𝔗', 'U': '𝔘', 'V': '𝔙', 'W': '𝔚', 'X': '𝔛', 'Y': '𝔜', 'Z': 'ℨ', + }, + }, + { + name: 'sbd', + map: { + ' ': ' ', + 'a': '𝐚', 'b': '𝐛', 'c': '𝐜', 'd': '𝐝', 'e': '𝐞', 'f': '𝐟', 'g': '𝐠', 'h': '𝐡', + 'i': '𝐢', 'j': '𝐣', 'k': '𝐤', 'l': '𝐥', 'm': '𝐦', 'n': '𝐧', 'o': '𝐨', 'p': '𝐩', 'q': '𝐪', + 'r': '𝐫', 's': '𝐬', 't': '𝐭', 'u': '𝐮', 'v': '𝐯', 'w': '𝐰', 'x': '𝐱', 'y': '𝐲', 'z': '𝐳', + 'A': '𝐀', 'B': '𝐁', 'C': '𝐂', 'D': '𝐃', 'E': '𝐄', 'F': '𝐅', 'G': '𝐆', 'H': '𝐇', + 'I': '𝐈', 'J': '𝐉', 'K': '𝐊', 'L': '𝐋', 'M': '𝐌', 'N': '𝐍', 'O': '𝐎', 'P': '𝐏', 'Q': '𝐐', + 'R': '𝐑', 'S': '𝐒', 'T': '𝐓', 'U': '𝐔', 'V': '𝐕', 'W': '𝐖', 'X': '𝐗', 'Y': '𝐘', 'Z': '𝐙', + }, + }, + { + name: 'monospace', + map: { + ' ': ' ', + 'a': '𝚊', 'b': '𝚋', 'c': '𝚌', 'd': '𝚍', 'e': '𝚎', 'f': '𝚏', 'g': '𝚐', 'h': '𝚑', + 'i': '𝚒', 'j': '𝚓', 'k': '𝚔', 'l': '𝚕', 'm': '𝚖', 'n': '𝚗', 'o': '𝚘', 'p': '𝚙', 'q': '𝚚', + 'r': '𝚛', 's': '𝚜', 't': '𝚝', 'u': '𝚞', 'v': '𝚟', 'w': '𝚠', 'x': '𝚡', 'y': '𝚢', 'z': '𝚣', + 'A': '𝙰', 'B': '𝙱', 'C': '𝙲', 'D': '𝙳', 'E': '𝙴', 'F': '𝙵', 'G': '𝙶', 'H': '𝙷', + 'I': '𝙸', 'J': '𝙹', 'K': '𝙺', 'L': '𝙻', 'M': '𝙼', 'N': '𝙽', 'O': '𝙾', 'P': '𝙿', 'Q': '𝚀', + 'R': '𝚁', 'S': '𝚂', 'T': '𝚃', 'U': '𝚄', 'V': '𝚅', 'W': '𝚆', 'X': '𝚇', 'Y': '𝚈', 'Z': '𝚉', + }, + }, +{ + name: 'bubbles', + map: { + ' ': ' ', + 'a': 'ⓐ', 'b': 'ⓑ', 'c': 'ⓒ', 'd': 'ⓓ', 'e': 'ⓔ', 'f': 'ⓕ', 'g': 'ⓖ', 'h': 'ⓗ', + 'i': 'ⓘ', 'j': 'ⓙ', 'k': 'ⓚ', 'l': 'ⓛ', 'm': 'ⓜ', 'n': 'ⓝ', 'o': 'ⓞ', 'p': 'ⓟ', 'q': 'ⓠ', + 'r': 'ⓡ', 's': 'ⓢ', 't': 'ⓣ', 'u': 'ⓤ', 'v': 'ⓥ', 'w': 'ⓦ', 'x': 'ⓧ', 'y': 'ⓨ', 'z': 'ⓩ', + 'A': 'Ⓐ', 'B': 'Ⓑ', 'C': 'Ⓒ', 'D': 'Ⓓ', 'E': 'Ⓔ', 'F': 'Ⓕ', 'G': 'Ⓖ', 'H': 'Ⓗ', + 'I': 'Ⓘ', 'J': 'Ⓙ', 'K': 'Ⓚ', 'L': 'Ⓛ', 'M': 'Ⓜ', 'N': 'Ⓝ', 'O': 'Ⓞ', 'P': 'Ⓟ', 'Q': 'Ⓠ', + 'R': 'Ⓡ', 'S': 'Ⓢ', 'T': 'Ⓣ', 'U': 'Ⓤ', 'V': 'Ⓥ', 'W': 'Ⓦ', 'X': 'Ⓧ', 'Y': 'Ⓨ', 'Z': 'Ⓩ', + }, +}, +{ + name: 'morse', + map: { + ' ': ' ', + 'a': '.-', 'b': '-...', 'c': '-.-.', 'd': '-..', 'e': '.', 'f': '..-.', 'g': '--.', 'h': '....', + 'i': '..', 'j': '.---', 'k': '-.-', 'l': '.-..', 'm': '--', 'n': '-.', 'o': '---', 'p': '.--.', + 'q': '--.-', 'r': '.-.', 's': '...', 't': '-', 'u': '..-', 'v': '...-', 'w': '.--', 'x': '-..-', + 'y': '-.--', 'z': '--..', + 'A': '.-', 'B': '-...', 'C': '-.-.', 'D': '-..', 'E': '.', 'F': '..-.', 'G': '--.', 'H': '....', + 'I': '..', 'J': '.---', 'K': '-.-', 'L': '.-..', 'M': '--', 'N': '-.', 'O': '---', 'P': '.--.', + 'Q': '--.-', 'R': '.-.', 'S': '...', 'T': '-', 'U': '..-', 'V': '...-', 'W': '.--', 'X': '-..-', + 'Y': '-.--', 'Z': '--..', + }, +}, +{ + name: 'creepy', + map: { + ' ': ' ', + 'a': 'ค', 'b': '๒', 'c': 'ς', 'd': '๔', 'e': 'є', 'f': 'Ŧ', 'g': 'ﻮ', 'h': 'ђ', + 'i': 'เ', 'j': 'ן', 'k': 'қ', 'l': 'l', 'm': '๓', 'n': 'ภ', 'o': '๏', 'p': 'թ', 'q': 'ợ', + 'r': 'г', 's': 'ร', 't': 'Շ', 'u': 'ย', 'v': 'ש', 'w': 'ฬ', 'x': 'א', 'y': 'ץ', 'z': 'z', + 'A': 'ค', 'B': '๒', 'C': 'ς', 'D': '๔', 'E': 'є', 'F': 'Ŧ', 'G': 'ﻮ', 'H': 'ђ', + 'I': 'เ', 'J': 'ן', 'K': 'қ', 'L': 'l', 'M': '๓', 'N': 'ภ', 'O': '๏', 'P': 'թ', 'Q': 'ợ', + 'R': 'г', 'S': 'ร', 'T': 'Շ', 'U': 'ย', 'V': 'ש', 'W': 'ฬ', 'X': 'א', 'Y': 'ץ', 'Z': 'z', + }, + }, +{ + name: 'baybayin', + map: { + ' ': ' ', + 'a': 'ᜀ', 'b': 'ᜊ', 'c': 'ᜅ', 'd': 'ᜇ', 'e': 'ᜌ', 'f': 'ᜐ', 'g': 'ᜎ', 'h': 'ᜑ', + 'i': 'ᜊ', 'j': 'ᜌ', 'k': 'ᜃ', 'l': 'ᜋ', 'm': 'ᜋᜒ', 'n': 'ᜈ', 'o': 'ᜉ', 'p': 'ᜒ', 'q': 'ᜆ', + 'r': 'ᜐ', 's': 'ᜐ', 't': 'ᜆ', 'u': 'ᜑ', 'v': 'ᜈ', 'w': 'ᜏ', 'x': 'ᜐ', 'y': 'ᜌ', 'z': 'ᜃ', + 'A': 'ᜀ', 'B': 'ᜊ', 'C': 'ᜅ', 'D': 'ᜇ', 'E': 'ᜌ', 'F': 'ᜐ', 'G': 'ᜎ', 'H': 'ᜑ', + 'I': 'ᜊ', 'J': 'ᜌ', 'K': 'ᜃ', 'L': 'ᜋ', 'M': 'ᜋ', 'N': 'ᜈ', 'O': 'ᜉ', 'P': 'ᜒ', 'Q': 'ᜆ', + 'R': 'ᜐ', 'S': 'ᜐ', 'T': 'ᜆ', 'U': 'ᜑ', 'V': 'ᜈ', 'W': 'ᜏ', 'X': 'ᜐ', 'Y': 'ᜌ', 'Z': 'ᜃ', + }, + }, +{ + name: 'glitchy', + map: { + ' ': ' ', + 'a': 'ᗩ', 'b': 'β', 'c': 'ς', 'd': 'ᕧ', 'e': 'Ξ', 'f': 'ғ', 'g': 'モ', 'h': '卄', 'i': '!!', + 'j': 'J', 'k': 'Ҡ', 'l': 'Ↄ', 'm': 'ᗰ', 'n': '几', 'o': 'Ө', 'p': 'Ԁ', 'q': 'Ҩ', 'r': '尺', + 's': '丂', 't': '千', 'u': 'ㄩ', 'v': 'ν', 'w': 'ω', 'x': '×', 'y': 'ү', 'z': '乙', + 'A': 'ᗩ', 'B': 'β', 'C': 'ς', 'D': 'ᕧ', 'E': 'Ξ', 'F': 'ғ', 'G': 'モ', 'H': '卄', 'I': '!!', + 'J': 'J', 'K': 'Ҡ', 'L': 'Ↄ', 'M': 'ᗰ', 'N': '几', 'O': 'Ө', 'P': 'Ԁ', 'Q': 'Ҩ', 'R': '尺', + 'S': '丂', 'T': '千', 'U': 'ㄩ', 'V': 'ν', 'W': 'ω', 'X': '×', 'Y': 'ү', 'Z': '乙', + }, +}, +{ + name: 'crossed', + map: { + 'a': 'a̶', 'b': 'b̶', 'c': 'c̶', 'd': 'd̶', 'e': 'e̶', 'f': 'f̶', 'g': 'g̶', 'h': 'h̶', + 'i': 'i̶', 'j': 'j̶', 'k': 'k̶', 'l': 'l̶', 'm': 'm̶', 'n': 'n̶', 'o': 'o̶', 'p': 'p̶', 'q': 'q̶', + 'r': 'r̶', 's': 's̶', 't': 't̶', 'u': 'u̶', 'v': 'v̶', 'w': 'w̶', 'x': 'x̶', 'y': 'y̶', 'z': 'z̶', + 'A': 'A̶', 'B': 'B̶', 'C': 'C̶', 'D': 'D̶', 'E': 'E̶', 'F': 'F̶', 'G': 'G̶', 'H': 'H̶', + 'I': 'I̶', 'J': 'J̶', 'K': 'K̶', 'L': 'L̶', 'M': 'M̶', 'N': 'N̶', 'O': 'O̶', 'P': 'P̶', 'Q': 'Q̶', + 'R': 'R̶', 'S': 'S̶', 'T': 'T̶', 'U': 'U̶', 'V': 'V̶', 'W': 'W̶', 'X': 'X̶', 'Y': 'Y̶', 'Z': 'Z̶', + }, +}, +{ + name: 'covered', + map: { + ' ': ' ', + 'a': 'a̺͆', 'b': 'b̺͆', 'c': 'c̺͆', 'd': 'd̺͆', 'e': 'e̺͆', 'f': 'f̺͆', 'g': 'g̺͆', 'h': 'h̺͆', 'i': 'i̺͆', 'j': 'j̺͆', + 'k': 'k̺͆', 'l': 'l̺͆', 'm': 'm̺͆', 'n': 'n̺͆', 'o': 'o̺͆', 'p': 'p̺͆', 'q': 'q̺͆', 'r': 'r̺͆', 's': 's̺͆', 't': 't̺͆', + 'u': 'u̺͆', 'v': 'v̺͆', 'w': 'w̺͆', 'x': 'x̺͆', 'y': 'y̺͆', 'z': 'z̺͆', + + 'A': 'A̺͆', 'B': 'B̺͆', 'C': 'C̺͆', 'D': 'D̺͆', 'E': 'E̺͆', 'F': 'F̺͆', 'G': 'G̺͆', 'H': 'H̺͆', 'I': 'I̺͆', 'J': 'J̺͆', + 'K': 'K̺͆', 'L': 'L̺͆', 'M': 'M̺͆', 'N': 'N̺͆', 'O': 'O̺͆', 'P': 'P̺͆', 'Q': 'Q̺͆', 'R': 'R̺͆', 'S': 'S̺͆', 'T': 'T̺͆', + 'U': 'U̺͆', 'V': 'V̺͆', 'W': 'W̺͆', 'X': 'X̺͆', 'Y': 'Y̺͆', 'Z': 'Z̺͆', + }, +}, +{ + name: 'smiley', + map: { + ' ': ' ', + 'A': 'Ă̈', 'B': 'B̆̈', 'C': 'C̆̈', 'D': 'D̆̈', 'E': 'Ĕ̈', 'F': 'F̆̈', 'G': 'Ğ̈', 'H': 'H̆̈', 'I': 'Ĭ̈', 'J': 'J̆̈', + 'K': 'K̆̈', 'L': 'L̆̈', 'M': 'M̆̈', 'N': 'N̆̈', 'O': 'Ŏ̈', 'P': 'P̆̈', 'Q': 'Q̆̈', 'R': 'R̆̈', 'S': 'S̆̈', 'T': 'T̆̈', + 'U': 'Ŭ̈', 'V': 'V̆̈', 'W': 'W̆̈', 'X': 'X̆̈', 'Y': 'Y̆̈', 'Z': 'Z̆̈', + + 'a': 'ă̈', 'b': 'b̆̈', 'c': 'c̆̈', 'd': 'd̆̈', 'e': 'ĕ̈', 'f': 'f̆̈', 'g': 'ğ̈', 'h': 'h̆̈', 'i': 'ĭ̈', 'j': 'j̆̈', + 'k': 'k̆̈', 'l': 'l̆̈', 'm': 'm̆̈', 'n': 'n̆̈', 'o': 'ŏ̈', 'p': 'p̆̈', 'q': 'q̆̈', 'r': 'r̆̈', 's': 's̆̈', 't': 't̆̈', + 'u': 'ŭ̈', 'v': 'v̆̈', 'w': 'w̆̈', 'x': 'x̆̈', 'y': 'y̆̈', 'z': 'z̆̈', + }, +}, +{ + name: 'boxed', + map: { + 'a': '🄰', 'b': '🄱', 'c': '🄲', 'd': '🄳', 'e': '🄴', 'f': '🄵', 'g': '🄶', 'h': '🄷', 'i': '🄸', 'j': '🄹', + 'k': '🄺', 'l': '🄻', 'm': '🄼', 'n': '🄽', 'o': '🄾', 'p': '🄿', 'q': '🅀', 'r': '🅁', 's': '🅂', 't': '🅃', + 'u': '🅄', 'v': '🅅', 'w': '🅆', 'x': '🅇', 'y': '🅈', 'z': '🅉', + 'A': '🄰', 'B': '🄱', 'C': '🄲', 'D': '🄳', 'E': '🄴', 'F': '🄵', 'G': '🄶', 'H': '🄷', 'I': '🄸', 'J': '🄹', + 'K': '🄺', 'L': '🄻', 'M': '🄼', 'N': '🄽', 'O': '🄾', 'P': '🄿', 'Q': '🅀', 'R': '🅁', 'S': '🅂', 'T': '🅃', + 'U': '🅄', 'V': '🅅', 'W': '🅆', 'X': '🅇', 'Y': '🅈', 'Z': '🅉', + }, +}, +]; + +module.exports = { + config: { + name: 'font', + version: '1.0', + author: 'Coffee', + countDown: 0, + role: 0, // Set role to 0 for public access + shortDescription: 'Convert text to different fonts', + longDescription: + 'Choose from various font styles like bold, italic, cursive, etc. and transform your text into a unique visual format.', + category: 'font', + guide: '-font ', + }, + onStart: async ({ event, api, args }) => { + if (args.length === 1 && args[0].toLowerCase() === 'list') { + const exampleText = 'Hello'; + const header = '═════════════════ 𝙰𝚟𝚊𝚒𝚕𝚊𝚋𝚕𝚎 𝙵𝚘𝚗𝚝𝚜 ƪ⁠(⁠‾⁠.⁠‾⁠“⁠)⁠┐\n═════════════════\n𝙵𝚘𝚗𝚝 𝙽𝚊𝚖𝚎 𝚂𝚊𝚖𝚙𝚕𝚎'; + + // Calculate the maximum length of the font names + const maxFontNameLength = Math.max(...fontMaps.map(fontMap => fontMap.name.length)); + + // Create the font list with perfect vertical alignment + const availableFontsList = fontMaps.map((fontMap) => { + const exampleChar = exampleText.split('') + .map((char) => fontMap.map[char] || char) + .join(''); + + // Adjust the padding for font names + const formattedFontName = `★ ${fontMap.name.padEnd(maxFontNameLength)}`; + + // Calculate the padding for perfect vertical alignment + const padding = ' '.repeat(maxFontNameLength - fontMap.name.length); + + return `${formattedFontName}${padding} ${exampleChar}`; + }).join('\n'); + + return api.sendMessage( + `${header}\n${availableFontsList}`, + event.threadID, + event.messageID + ); + } + + if (args.length < 2) { + return api.sendMessage( + "|。_。| Invalid Usage: Please use the command with a font type and text.\n\nExample: -font bold i love you \n\nChat -𝘧𝘰𝘯𝘵 𝘭𝘪𝘴𝘵 to see more! •ᴗ•", + event.threadID, + event.messageID + ); + } + + const command = args[0].toLowerCase(); + if (command === 'list') { + const availableFonts = fontMaps.map((fontMap) => `★ ${fontMap.name}`).join('\n'); + return api.sendMessage(`Available fonts:\n${availableFonts}`, event.threadID, event.messageID); + } + + const fontType = args.shift(); + const inputText = args.join(' '); + + const chosenFontMap = fontMaps.find( + (fontMap) => fontMap.name === fontType.toLowerCase() + ); + + if (!chosenFontMap) { + const availableFonts = fontMaps.map((fontMap) => `★ ${fontMap.name}`).join('\n'); + return api.sendMessage( + `|。_。| Invalid Font Type: Available fonts:\n${availableFonts}\n\nExample: -font bold Hello! •ᴗ•`, + event.threadID, + event.messageID + ); + } + + const outputText = inputText + .split('') + .map((char) => chosenFontMap.map[char] || char) + .join(''); + + return api.sendMessage(outputText, event.threadID, event.messageID); + }, +}; \ No newline at end of file diff --git a/scripts/cmds/guessword.js b/scripts/cmds/guessword.js new file mode 100644 index 0000000000..b25eb4f977 --- /dev/null +++ b/scripts/cmds/guessword.js @@ -0,0 +1,114 @@ +const words = [ + "apple", "banana", "orange", "strawberry", "mango", "pineapple", "watermelon", + // Add more words here... +]; + +module.exports = { + config: { + name: "guessword", + version: "1.0", + author: "Asmit", + shortDescription: "Play the Guess the Word game.", + longDescription: "A game where you guess a word letter by letter.", + category: "game", + guide: { + en: "Try to guess the word by entering one letter at a time. You have limited attempts. Type 'hint' to get a hint." + } + }, + + onStart: async function ({ event, message, api, usersData }) { + try { + const word = words[Math.floor(Math.random() * words.length)]; + const maxAttempts = 5; + const attemptsLeft = maxAttempts; + const guessedWord = "_".repeat(word.length); + + const startMessage = `🎮 Welcome to the Guess the Word Game! 🎮\n\nYou have ${maxAttempts} attempts to guess the word.\n\nGuessed word: ${guessedWord}`; + const sentMessage = await message.reply(startMessage); + + global.GuessWordGame = { + currentMessageID: sentMessage.messageID, + word, + maxAttempts, + attemptsLeft, + guessedWord + }; + } catch (error) { + console.error("Error", error); + } + }, + + onChat: async function ({ event, message, usersData }) { + try { + if (!global.GuessWordGame) return; + + const guess = event.body.trim().toLowerCase(); + const { word, maxAttempts, attemptsLeft, guessedWord } = global.GuessWordGame; + + if (guess === "hint") { + const hintIndex = guessedWord.indexOf("_"); + const hintLetter = word[hintIndex]; + global.GuessWordGame.guessedWord = guessedWord.substr(0, hintIndex) + hintLetter + guessedWord.substr(hintIndex + 1); + const hintMessage = `🔍 Here's a hint: The word contains the letter '${hintLetter.toUpperCase()}'.\n\nGuessed word: ${global.GuessWordGame.guessedWord}`; + const sentMessage = await message.reply(hintMessage); + if (global.GuessWordGame.currentMessageID) { + await message.unsend(global.GuessWordGame.currentMessageID); + } + global.GuessWordGame.currentMessageID = sentMessage.messageID; + return; + } + + if (!guess.match(/^[a-z]$/) || guessedWord.includes(guess)) { + return; + } + + const newGuessedWord = guessedWord.split("").map((char, index) => { + if (word[index] === guess) { + return guess; + } else { + return char; + } + }).join(""); + + let responseMessage = ""; + + if (newGuessedWord === guessedWord) { + responseMessage = "❌ Incorrect guess!"; + global.GuessWordGame.attemptsLeft -= 1; + } else { + responseMessage = "✅ Correct guess!"; + global.GuessWordGame.guessedWord = newGuessedWord; + } + + responseMessage += `\n\nGuessed word: ${newGuessedWord}`; + + if (newGuessedWord === word) { + const senderID = event.senderID; + const userData = await usersData.get(senderID); + const updatedMoney = userData.money + 10000; + await usersData.set(senderID, { money: updatedMoney }); + responseMessage += `\n\n🎉 Congratulations! You guessed the word "${word}" correctly and earned 10,000 coins! 🎉`; + delete global.GuessWordGame; + } else if (global.GuessWordGame.attemptsLeft === 0) { + const senderID = event.senderID; + const userData = await usersData.get(senderID); + if (userData.money >= 5000) { + const updatedMoney = userData.money - 5000; + await usersData.set(senderID, { money: updatedMoney }); + responseMessage += `\n\n😔 Sorry, you've run out of attempts! You lost 5,000 coins. 😔`; + } else { + responseMessage += `\n\n😔 Sorry, you've run out of attempts! However, you don't have enough coins to deduct. 😔`; + } + delete global.GuessWordGame; + } + + const sentMessage = await message.reply(responseMessage); + if (global.GuessWordGame.currentMessageID) { + await message.unsend(global.GuessWordGame.currentMessageID); + } + global.GuessWordGame.currentMessageID = sentMessage.messageID; + } catch (error) { + console.error("Error in guessword command:", error); + } + } +}; \ No newline at end of file diff --git a/scripts/cmds/help.js b/scripts/cmds/help.js index 6758faf2c8..e34a45315f 100644 --- a/scripts/cmds/help.js +++ b/scripts/cmds/help.js @@ -1,409 +1,318 @@ -const fs = require("fs-extra"); -const axios = require("axios"); -const path = require("path"); -const { getPrefix } = global.utils; -const { commands, aliases } = global.GoatBot; -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 -*/ +const commandInfoMap = { + ai: { + name: "ai", + description: "Ai Based on GPT-4", + guide: "-ai what is life?" + }, + knight: { + name: "knight", + description: "a medieval knight that has been called upon as an ai you can talk to", + guide: "-knight tell me about yourself." + }, +axis: { + name: "axis", + description: "an ai you can ask for anything", + guide: "-axis what is life?" + }, + join: { + name: "join", + description: "Join existing group chats where the bot is in.", + guide: "-join" + }, + opm: { + name: "opm", + description: "sends random opm (original pilipino music)", + guide: "-opm" + }, + video: { + name: "video", + description: "searches and sends youtube video (mostly use between 1-7mins)", + guide: "-video