├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── commands ├── Converter │ ├── convertAudio.js │ ├── exchance.js │ ├── extractWatermark.js │ ├── sticker.js │ ├── takeWatermark.js │ └── toImages.js ├── Downloader │ ├── Instagram-media.js │ ├── Instagram-story.js │ ├── YouTube-audio.js │ ├── YouTube-play.js │ ├── YouTube-short.js │ ├── YouTube-video.js │ ├── apkdl.js │ ├── capcut.js │ ├── cocofun.js │ ├── facebook-reels.js │ ├── facebook.js │ ├── googleDrive.js │ ├── ifunny.js │ ├── imdb.js │ ├── likee.js │ ├── mediafire.js │ ├── pinterest.js │ ├── sfile.js │ ├── soundCloud.js │ ├── stickerTelegram.js │ ├── tiktok.js │ ├── twitter.js │ ├── xnxx.js │ └── xvideos.js ├── Maker │ ├── affect.js │ ├── attp.js │ ├── biden.js │ ├── caution.js │ ├── chatBubble.js │ ├── communism.js │ ├── drake.js │ ├── emojimix.js │ ├── facts.js │ ├── gura.js │ ├── kannagen.js │ ├── meme.js │ ├── nulis.js │ ├── quotes.js │ ├── removebg.js │ ├── rip.js │ ├── ssmaps.js │ ├── ssweb.js │ ├── tahta.js │ ├── tolol.js │ ├── ttp.js │ ├── tts.js │ ├── twibbon.js │ └── twitter.js ├── Manga-Anime │ └── kusonime.js ├── Misc │ ├── audio.js │ ├── deleteMessage.js │ ├── quoted.js │ └── video.js ├── Owners │ ├── backup.js │ ├── broadcast.js │ ├── get.js │ ├── restart.js │ └── set-mode.js ├── Religion │ ├── alquran.js │ ├── asmaulHusna.js │ ├── bible.js │ ├── hadist.js │ ├── kisahNabi.js │ ├── surah.js │ └── tafsir.js ├── Searching │ └── pinterest.js ├── Stalker │ ├── github.js │ ├── instagram.js │ ├── tiktok.js │ └── twitter.js ├── Utility │ ├── contact.js │ ├── count.js │ ├── menu.js │ ├── most-command.js │ ├── source.js │ └── statistic.js └── index.commands.js ├── configs ├── global.js └── regex.js ├── database ├── allCommands.json ├── commands.json ├── hit.json └── pdfSizes.json ├── docker-compose.yml ├── images ├── icon.png ├── sertifikat.pdf └── thumbnail.png ├── index.js ├── library ├── canvas.js ├── emojiRegex.js ├── functions.js ├── hitCommand.js ├── parseResult.js ├── similarity.js └── store.js ├── loadedCommands.js ├── main.js ├── middleware ├── console.js ├── download.js ├── html.js ├── serialize.js ├── service.js └── streamReadable.js ├── package-lock.json ├── package.json ├── pnpm-lock.yaml ├── replit.nix ├── server.js ├── storage ├── fonts │ ├── Breaking.ttf │ └── xcode.ttf └── images │ ├── angel.png │ ├── aqua.png │ ├── background.png │ ├── coldsky.png │ ├── darkness.png │ ├── empty.png │ ├── peakblue.png │ ├── pinkman.png │ ├── profile_void.png │ ├── standard.png │ ├── standart.png │ └── transparent.png └── temp ├── data.exif └── trash.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts-buster 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y \ 5 | ffmpeg libwebp-dev && \ 6 | apt-get upgrade -y && \ 7 | rm -rf /var/lib/apt/lists/* 8 | 9 | COPY package.json . 10 | 11 | RUN npm install 12 | 13 | COPY . . 14 | 15 | CMD ["npm", "start"] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 xcoders team 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # *xcoders api* 2 | ## _Example case for rest api (api-xcoders.site)_ 3 | 4 | 5 | xcoders bot is a bot built using nodejs and uses the baileys library please star if you like and please fork if you want to develop. and to install please follow the steps below: 6 | 7 | ## Installation 8 | 9 | Install the dependencies and devDependencies and start the server. 10 | 11 | ```sh 12 | git clone https://github.com/xcoders-teams/xcoders-bot.git 13 | cd xcoders-bot 14 | npm i 15 | npm start 16 | ``` 17 | 18 | ## Information 19 | - Full api ( api-xcoders.site ) 20 | - plugin 21 | - easy for use 22 | 23 | ## Features 24 | 25 | - Downloader: to download media images or videos or audio from the platform url available in the bot feature. 26 | - Stalker: to stalk users from the platform provided in the bot feature. 27 | - Converter: to convert media to the type available on our bot platform. 28 | - Maker: to create very creative images, stickers, videos which are available on our bot platform. 29 | - Anime: to search for an anime you want to search through our bot platform. 30 | - Misc: we are confused as to what category this belongs to, so we put it here xD. 31 | 32 | ## Development 33 | 34 | Want to contribute? Great! 35 | 36 | Make a change in your file and instantaneously see your updates! 37 | 38 | ## License 39 | 40 | MIT 41 | -------------------------------------------------------------------------------- /commands/Converter/convertAudio.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import { getDevice } from '@whiskeysockets/baileys'; 4 | 5 | export default { 6 | views: ['tomp3'], // view for message in menu 7 | command: /^to(mp3|audio)$/i, //another command. 8 | description: 'Convert Video To MP3', 9 | usage: '%cmd% and Reply video Message', 10 | media: true, 11 | execute: async ({ xcoders, m, x, quoted, mimetype, convertToMp3, waitingMessage, errorMessage, addHitCommand }) => { 12 | try { 13 | const buffer = await quoted.download(); 14 | if (!/video/i.test(mimetype)) return errorMessage(m.chat, 'Reply Video and try again'); 15 | const result = await convertToMp3(buffer); 16 | await waitingMessage(m.chat); 17 | addHitCommand('Audio Convert', true); 18 | const device = getDevice(x.id); 19 | const mime = device === 'web' ? 'audio/mp4' : 'audio/mpeg'; 20 | return xcoders.sendMessage(m.chat, { audio: result, mimetype: mime, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 21 | } catch (error) { 22 | return errorMessage(m.chat, error, 'Audio Convert'); 23 | } 24 | } 25 | }; -------------------------------------------------------------------------------- /commands/Converter/exchance.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import fs from 'fs'; 4 | import path from 'path'; 5 | import { getDevice } from '@whiskeysockets/baileys'; 6 | import { promisify } from 'util'; 7 | import { exec as childExec } from 'child_process'; 8 | import { fileTypeFromBuffer } from 'file-type'; 9 | 10 | const exec = promisify(childExec); 11 | 12 | export default { 13 | views: ['bass', 'blown', 'deep', 'earrape', 'fast', 'fat', 'nightcore', 'reverse', 'robot', 'slow', 'smooth', 'tupai'], // view for message in menu 14 | command: /^(bass|blown|deep|earrape|fast|fat|nightcore|reverse|robot|slow|smooth|tupai)$/i, //another command. 15 | description: 'Exchance Effect Audio Player', 16 | usage: '%cmd% and Reply Audio Message', 17 | media: true, 18 | execute: async ({ xcoders, m, x, command, quoted, mimetype, getRandom, waitingMessage, errorMessage, addHitCommand }) => { 19 | try { 20 | if (!/audio\//i.test(mimetype)) return errorMessage(m.chat, 'Reply audio and try again'); 21 | let type = null; 22 | if (/bass/.test(command)) type = '-af equalizer=f=54:width_type=o:width=2:g=20'; 23 | if (/blown/.test(command)) type = '-af acrusher=.1:1:64:0:log'; 24 | if (/deep/.test(command)) type = '-af atempo=4/4,asetrate=44500*2/3'; 25 | if (/earrape/.test(command)) type = '-af volume=12'; 26 | if (/fast/.test(command)) type = '-filter:a "atempo=1.63,asetrate=44100"'; 27 | if (/fat/.test(command)) type = '-filter:a "atempo=1.6,asetrate=22100"'; 28 | if (/nightcore/.test(command)) type = '-filter:a atempo=1.06,asetrate=44100*1.25'; 29 | if (/reverse/.test(command)) type = '-filter_complex "areverse"'; 30 | if (/robot/.test(command)) type = '-filter_complex "afftfilt=real=\'hypot(re,im)*sin(0)\':imag=\'hypot(re,im)*cos(0)\':win_size=512:overlap=0.75"'; 31 | if (/slow/.test(command)) type = '-filter:a "atempo=0.7,asetrate=44100"'; 32 | if (/smooth/.test(command)) type = '-filter:v "minterpolate=\'mi_mode=mci:mc_mode=aobmc:vsbmc=1:fps=120\'"'; 33 | if (/tupai/.test(command)) type = '-filter:a "atempo=0.5,asetrate=65100"'; 34 | const buffer = await quoted.download(); 35 | const { ext } = await fileTypeFromBuffer(buffer); 36 | const inputFile = path.join(process.cwd(), 'temp', getRandom(ext)); 37 | const outputFile = path.join(process.cwd(), 'temp', getRandom('.mp3')); 38 | await fs.promises.writeFile(inputFile, buffer); 39 | const result = await new Promise((resolve, reject) => exec(`ffmpeg -i ${inputFile} ${type} ${outputFile}`, async (error) => { 40 | await fs.promises.unlink(inputFile); 41 | if (error) return reject(error); 42 | const result = fs.existsSync(outputFile) ? await fs.promises.readFile(outputFile) : null; 43 | if (!result) return reject('Failed Convert Audio Output'); 44 | await fs.promises.unlink(outputFile); 45 | resolve(result); 46 | })); 47 | const device = getDevice(x.id); 48 | const mime = device === 'web' ? 'audio/mp4' : 'audio/mpeg'; 49 | await waitingMessage(m.chat); 50 | addHitCommand('Audio Exchance', true); 51 | return xcoders.sendMessage(m.chat, { audio: result, mimetype: mime, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 52 | } catch (error) { 53 | return errorMessage(m.chat, error, 'Audio Exchance'); 54 | } 55 | } 56 | }; -------------------------------------------------------------------------------- /commands/Converter/extractWatermark.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import webpmux from 'node-webpmux'; 4 | 5 | export default { 6 | views: ['extract'], // view for message in menu 7 | command: /^(extract|getwm|)$/i, //another command. 8 | description: 'Extract Watermark From sticker pack', 9 | usage: '%cmd%', 10 | media: true, 11 | execute: async ({ replyMessage, m, mimetype, downloadContentMediaMessage, parseResult, errorMessage, addHitCommand }) => { 12 | try { 13 | if (!/webp/i.test(mimetype)) return errorMessage(m.chat, 'Reply Sticker and try again'); 14 | const image = new webpmux.Image(); 15 | const download = await downloadContentMediaMessage(m.quoted); 16 | await image.load(download); 17 | const exifSticker = image.exif?.toString('utf-8') || '{}'; 18 | const result = exifSticker.substring(exifSticker.indexOf('{'), exifSticker.lastIndexOf('}') + 1) || '{}'; 19 | const parse = JSON.parse(result); 20 | const response = parseResult(parse); 21 | addHitCommand('Extract Sticker', true); 22 | return replyMessage(response); 23 | } catch (error) { 24 | return errorMessage(m.chat, error, 'Extract Sticker'); 25 | } 26 | } 27 | }; -------------------------------------------------------------------------------- /commands/Converter/sticker.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['sticker'], // view for message in menu 5 | command: /^(s|sti(c|)ker)$/i, //another command. 6 | description: 'Create Sticker from quoted messsge', 7 | usage: '%cmd% quoted or url', 8 | media: true, 9 | execute: async ({ xcoders, m, x, query, quoted, mimetype, errorMessage, createSticker, addHitCommand }) => { 10 | try { 11 | const [pack, author] = query.split('|'); 12 | const buffer = await quoted.download(); 13 | if (/webp/i.test(mimetype)) return errorMessage(m.chat, 'Type not supported'); 14 | const result = await createSticker(buffer, { authorname: author, packname: pack }); 15 | addHitCommand('Sticker', true); 16 | return xcoders.sendMessage(m.chat, { sticker: result, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 17 | } catch (error) { 18 | return errorMessage(m.chat, error, 'Sticker'); 19 | } 20 | } 21 | }; -------------------------------------------------------------------------------- /commands/Converter/takeWatermark.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['take < author|pack >'], // view for message in menu 5 | command: /^(take|wm)$/i, //another command. 6 | description: 'Create Watermark in sticker message', 7 | usage: '%cmd% watermark', 8 | media: true, 9 | execute: async ({ xcoders, m, x, query, quoted, mimetype, errorMessage, createWatermark, addHitCommand }) => { 10 | try { 11 | const [pack, author] = query.split('|'); 12 | const buffer = await quoted.download(); 13 | if (!/webp/i.test(mimetype)) return errorMessage(m.chat, 'Type not supported'); 14 | const result = await createWatermark(buffer, { packname: pack, authorname: author }); 15 | addHitCommand('Sticker', true); 16 | return xcoders.sendMessage(m.chat, { sticker: result, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 17 | } catch (error) { 18 | return errorMessage(m.chat, error, 'Sticker'); 19 | } 20 | } 21 | }; -------------------------------------------------------------------------------- /commands/Converter/toImages.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['toimage'], // view for message in menu 5 | command: /^to(images?|img)$/i, //another command. 6 | description: 'Convert Sticker To Images', 7 | usage: '%cmd% and Reply Sticker Message', 8 | media: true, 9 | execute: async ({ xcoders, m, x, quoted, mimetype, response, downloadContentMediaMessage, waitingMessage, errorMessage, addHitCommand }) => { 10 | try { 11 | if (!/webp/i.test(mimetype)) return errorMessage(m.chat, 'Reply Sticker and try again'); 12 | const result = await downloadContentMediaMessage(quoted, { optional: true }); 13 | await waitingMessage(m.chat); 14 | addHitCommand('Image Convert', true); 15 | return xcoders.sendMessage(m.chat, { image: result, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 16 | } catch (error) { 17 | return errorMessage(m.chat, error, 'Image Convert'); 18 | } 19 | } 20 | }; -------------------------------------------------------------------------------- /commands/Downloader/Instagram-media.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['igdl '], 5 | command: /^(instadl|igdl|ig)$/i, 6 | description: 'Download media from Instagram Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url Instagram', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/ig?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Instagram Media'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const caption = styleMessage('Instagram Media Downloader', result); 18 | addHitCommand('Instagram Media', true); 19 | if (data.result.result_length === 1) { 20 | return xcoders.sendFileFromUrl(m.chat, data.result.data[0].url, caption, x); 21 | } else { 22 | for (var i = 0; i < data.result.result_length; i++) { 23 | await xcoders.sendFileFromUrl(m.chat, data.result.data[i].url, caption, x); 24 | } 25 | return; 26 | } 27 | } catch (error) { 28 | return errorMessage(m.chat, error, 'Instagram Media'); 29 | } 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /commands/Downloader/Instagram-story.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['instastory < url : username >'], // view for message in menu 5 | command: /^(instastory|storydl|igstory|igs)$/i, //another command. 6 | description: 'Download media story from Instagram Url', 7 | query: true, 8 | usage: '%cmd% url/username story Instagram', 9 | execute: async ({ xcoders, x, m, query, styleMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, getJson, addHitCommand }) => { 10 | try { 11 | const serialize = regex.url(query) ? { query: 'url', path: 'ig-stories' } : { query: 'username', path: 'ig-story' }; 12 | const data = await getJson(`${host}/api/download/${serialize.path}?${serialize.query}=${query}&apikey=${apikeys}`); 13 | if (!data.status || data.result.data.length < 1) return errorMessage(m.chat, getMessage(data), 'Instagram Story'); 14 | await waitingMessage(m.chat); 15 | const caption = styleMessage('Instagram Story Downloader', `• ID: ${data.result.id}\n• Username: ${data.result.username}\n• Fullname: ${data.result.fullname}`); 16 | addHitCommand('Instagram Story', true); 17 | if (data.result.result_length === 1) { 18 | return xcoders.sendFileFromUrl(m.chat, data.result.data[0].url, caption, x); 19 | } else { 20 | for (var i = 0; i < data.result.data.length; i++) { 21 | await xcoders.sendFileFromUrl(m.chat, data.result.data[i].url, caption, x); 22 | } 23 | return; 24 | } 25 | } catch (error) { 26 | return errorMessage(m.chat, error, 'Instagram Story'); 27 | } 28 | } 29 | }; -------------------------------------------------------------------------------- /commands/Downloader/YouTube-audio.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['ytmp3 < url >'], // view for message in menu 5 | command: /^yt(mp3|music|musik|audio)$/i, //another command. 6 | description: 'Download music from YouTube Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url youtube', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, canvas, apikeys, regex, host, getMessage, parseResult, getJson, getBuffer, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/y2mate-audio?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'YouTube Music'); 15 | await waitingMessage(m.chat); 16 | const parseCaption = parseResult(data.result); 17 | const caption = styleMessage('YouTube Music Downloader', parseCaption); 18 | const canvasThumbnail = await canvas.create('YouTube Audio Downloder'); 19 | const thumbnail = await getBuffer(data.result.thumbnail); 20 | await xcoders.sendMessage(m.chat, { image: canvasThumbnail, caption, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 21 | addHitCommand('YouTube Music', true); 22 | return xcoders.sendAudioFromUrl(m.chat, data.result.url, x, { fileName: data.result.title + '.mp3', title: data.result.title, thumbnail, source: query, ffmpeg: false }); 23 | } catch (error) { 24 | return errorMessage(m.chat, error, 'YouTube Music'); 25 | } 26 | } 27 | }; -------------------------------------------------------------------------------- /commands/Downloader/YouTube-play.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['ytplay < query >'], // view for message in menu 5 | command: /^(yt)?play$/i, //another command. 6 | description: 'Download music from YouTube Play', 7 | query: true, 8 | text: true, 9 | usage: '%cmd% monolog pamungkas', 10 | execute: async ({ xcoders, x, m, query, styleMessage, errorMessage, waitingMessage, canvas, getMessage, parseResult, getBuffer, addHitCommand, getJson, host, apikeys }) => { 11 | try { 12 | const data = await getJson(`${host}/api/download/play-mp3?query=${query}&apikey=${apikeys}`); 13 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'YouTube Play'); 14 | await waitingMessage(m.chat); 15 | const parseCaption = parseResult(data); 16 | const caption = styleMessage('YouTube Play Downloader', parseCaption); 17 | const canvasThumbnail = await canvas.create('YouTube Play Downloder'); 18 | const thumbnail = await getBuffer(data.result.thumbnail); 19 | await xcoders.sendMessage(m.chat, { image: canvasThumbnail, caption, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 20 | addHitCommand('YouTube Play', true); 21 | return xcoders.sendAudioFromUrl(m.chat, data.result.url, x, { fileName: data.result.title + '.mp3', title: data.result.title, thumbnail, source: query, stream: true }); 22 | } catch (error) { 23 | return errorMessage(m.chat, error, 'YouTube Play'); 24 | } 25 | } 26 | }; -------------------------------------------------------------------------------- /commands/Downloader/YouTube-short.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | export default { 4 | views: ['ytshort < url >'], // view for message in menu 5 | command: /^ytshort$/i, //another command. 6 | description: 'Download video from YouTube Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url youtube short', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/yt-short?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'YouTube Short'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const caption = styleMessage('YouTube Short Video Downloader', result); 18 | addHitCommand('YouTube Short', true); 19 | return xcoders.sendFileFromUrl(m.chat, data.result.url, caption, x, { mimetype: 'video/mp4' }); 20 | } catch (error) { 21 | return errorMessage(m.chat, error, 'YouTube Short'); 22 | } 23 | } 24 | }; -------------------------------------------------------------------------------- /commands/Downloader/YouTube-video.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['ytmp4 < url >'], // view for message in menu 5 | command: /^yt(mp4|video|vidio)$/i, //another command. 6 | description: 'Download video from YouTube Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url youtube', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/y2mate-video?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'YouTube Video'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const caption = styleMessage('YouTube Video Downloader', result); 18 | addHitCommand('YouTube Video', true); 19 | return xcoders.sendFileFromUrl(m.chat, data.result.url, caption, x, { mimetype: 'video/mp4' }); 20 | } catch (error) { 21 | return errorMessage(m.chat, error, 'YouTube Video'); 22 | } 23 | } 24 | }; -------------------------------------------------------------------------------- /commands/Downloader/apkdl.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['apkdl < url >'], // view for message in menu 5 | command: /^apk(|dl|down)$/i, //another command. 6 | description: 'Download Files from apkdl Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url apk-dl.com', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/apkdl?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Apkdl Downloader'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const caption = styleMessage('Apkdl Files Downloader', result); 18 | addHitCommand('Apkdl Downloader', true); 19 | return xcoders.sendFileFromUrl(m.chat, data.result.url, caption, x, { name: data.result.title }); 20 | } catch (error) { 21 | return errorMessage(m.chat, error, 'Apkdl Downloader'); 22 | } 23 | } 24 | }; -------------------------------------------------------------------------------- /commands/Downloader/capcut.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['capcut < url >'], // view for message in menu 5 | command: /^(cc(|dl|down)|capcut)$/i, //another command. 6 | description: 'Download video from Capcut Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url Capcut', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/capcut?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Capcut'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const caption = styleMessage('Capcut Video Downloader', result); 18 | addHitCommand('Capcut', true); 19 | return xcoders.sendFileFromUrl(m.chat, data.result.url, caption, x); 20 | } catch (error) { 21 | return errorMessage(m.chat, error, 'Capcut'); 22 | } 23 | } 24 | }; -------------------------------------------------------------------------------- /commands/Downloader/cocofun.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import _ from 'lodash'; 4 | 5 | export default { 6 | views: ['fbdl < url >'], // view for message in menu 7 | command: /^(cocofun(|dl|down))$/i, //another command. 8 | description: 'Download video from Cocofun Url', 9 | query: true, 10 | url: true, 11 | usage: '%cmd% url cocofun', 12 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 13 | try { 14 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 15 | const data = await getJson(`${host}/api/download/cocofun?url=${query}&apikey=${apikeys}`); 16 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Cocofun'); 17 | await waitingMessage(m.chat); 18 | const result = parseResult(data.result); 19 | const caption = styleMessage('Cocofun Video Downloader', result); 20 | addHitCommand('Cocofun', true); 21 | return xcoders.sendFileFromUrl(m.chat, data.result.url, caption, x); 22 | } catch (error) { 23 | return errorMessage(m.chat, error, 'Cocofun'); 24 | } 25 | } 26 | }; -------------------------------------------------------------------------------- /commands/Downloader/facebook-reels.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['fbreels < url >'], // view for message in menu 5 | command: /^fbree?ls?$/i, //another command. 6 | description: 'Download video reels from Facebook Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url reels facebook', 10 | execute: async ({ xcoders, x, m, query, styleMessage, errorMessage, waitingMessage, apikeys, host, getMessage, parseResult, getJson, addHitCommand }) => { 11 | try { 12 | const data = await getJson(`${host}/api/download/fb-reels?url=${query}&apikey=${apikeys}`); 13 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Facebook Reels Downloader'); 14 | await waitingMessage(m.chat); 15 | const result = parseResult(data.result); 16 | const caption = styleMessage('Facebook Reels Downloader', result); 17 | addHitCommand('Facebook Reels Downloader', true); 18 | return xcoders.sendFileFromUrl(m.chat, data.result.data[0].url, caption, x); 19 | } catch (error) { 20 | return errorMessage(m.chat, error, 'Facebook Reels Downloader'); 21 | } 22 | } 23 | }; -------------------------------------------------------------------------------- /commands/Downloader/facebook.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['fbdl < url >'], // view for message in menu 5 | command: /^(fb(|dl|down)|facebook)$/i, //another command. 6 | description: 'Download video from Facebook Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url facebook', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/fb2?url=${query}&server=server2&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Facebook Downloader'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const caption = styleMessage('Facebook Video Downloader', result); 18 | addHitCommand('Facebook Downloader', true); 19 | return xcoders.sendFileFromUrl(m.chat, data.result.data[0].url, caption, x); 20 | } catch (error) { 21 | return errorMessage(m.chat, error, 'Facebook Downloader'); 22 | } 23 | } 24 | }; -------------------------------------------------------------------------------- /commands/Downloader/googleDrive.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['gdrive < url >'], 5 | command: /^gdrive$/i, 6 | description: 'Google Drive Download From url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url google drive', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/google-drive?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Google Drive'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const response = styleMessage('Google Drive Downloader', result); 18 | addHitCommand('Google Drive', true); 19 | return xcoders.sendFileFromUrl(m.chat, data.result.url, response, x, { mimetype: data.result.mimetype }); 20 | } catch (error) { 21 | return errorMessage(m.chat, error, 'Google Drive'); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /commands/Downloader/ifunny.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import _ from 'lodash'; 4 | 5 | export default { 6 | views: ['ifunny < url >'], // view for message in menu 7 | command: /^(ifunny(|dl|down))$/i, //another command. 8 | description: 'Download video from Ifunny Url', 9 | query: true, 10 | url: true, 11 | usage: '%cmd% url ifunny', 12 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 13 | try { 14 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 15 | const data = await getJson(`${host}/api/download/ifunny?url=${query}&apikey=${apikeys}`); 16 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Ifunny'); 17 | await waitingMessage(m.chat); 18 | const metadata = _.sample(data.result.data); 19 | const result = parseResult({ ...data.result.title, metadata }); 20 | const caption = styleMessage('Ifunny Video Downloader', result); 21 | addHitCommand('Ifunny', true); 22 | return xcoders.sendFileFromUrl(m.chat, metadata.url, caption, x); 23 | } catch (error) { 24 | return errorMessage(m.chat, error, 'Ifunny'); 25 | } 26 | } 27 | }; -------------------------------------------------------------------------------- /commands/Downloader/imdb.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['imdb < url >'], // view for message in menu 5 | command: /^imdb(|dl|down)$/i, //another command. 6 | description: 'Download video from IMDB Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url IMDB', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/imdb?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'IMDB Downloader'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const caption = styleMessage('IMDB Video Downloader', result); 18 | addHitCommand('IMDB Downloader', true); 19 | return xcoders.sendFileFromUrl(m.chat, data.result.data[0].url, caption, x); 20 | } catch (error) { 21 | return errorMessage(m.chat, error, 'IMDB Downloader'); 22 | } 23 | } 24 | }; -------------------------------------------------------------------------------- /commands/Downloader/likee.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['likee < url >'], // view for message in menu 5 | command: /^(likee(|dl|down))$/i, //another command. 6 | description: 'Download video from Likee Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url likee', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/likee?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Likee'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const caption = styleMessage('Likee Video Downloader', result); 18 | addHitCommand('Likee', true); 19 | return xcoders.sendFileFromUrl(m.chat, data.result.nowatermark, caption, x); 20 | } catch (error) { 21 | return errorMessage(m.chat, error, 'Likee'); 22 | } 23 | } 24 | }; -------------------------------------------------------------------------------- /commands/Downloader/mediafire.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['mediafire < url >'], // view for message in menu 5 | command: /^(mfdl|mediafire)$/i, //another command. 6 | description: 'Download Files from Mediafire Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url Mediafire', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/mediafire?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Mediafire Downloader'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const caption = styleMessage('Mediafire Downloader', result); 18 | addHitCommand('Mediafire Downloader', true); 19 | return xcoders.sendFileFromUrl(m.chat, data.result.url, caption, x); 20 | } catch (error) { 21 | return errorMessage(m.chat, error, 'Mediafire Downloader'); 22 | } 23 | } 24 | }; -------------------------------------------------------------------------------- /commands/Downloader/pinterest.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['pindl < url >'], // view for message in menu 5 | command: /^(pin(|dl|down))$/i, //another command. 6 | description: 'Download video from Pinterest Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url Pinterest', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/pinterest?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Pinterest Downloader'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const caption = styleMessage('Pinterest Video Downloader', result); 18 | addHitCommand('Pinterest Downloader', true); 19 | return xcoders.sendFileFromUrl(m.chat, data.result.url, caption, x); 20 | } catch (error) { 21 | return errorMessage(m.chat, error, 'Pinterest Downloader'); 22 | } 23 | } 24 | }; -------------------------------------------------------------------------------- /commands/Downloader/sfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['sfile < url >'], // view for message in menu 5 | command: /^(sfiledl|sfile)$/i, //another command. 6 | description: 'Download Files from Sfile Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url Sfile', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/sfile?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Sfile Downloader'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const caption = styleMessage('Sfile Downloader', result); 18 | addHitCommand('Sfile Downloader', true); 19 | return xcoders.sendFileFromUrl(m.chat, data.result.url, caption, x); 20 | } catch (error) { 21 | return errorMessage(m.chat, error, 'Sfile Downloader'); 22 | } 23 | } 24 | }; -------------------------------------------------------------------------------- /commands/Downloader/soundCloud.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['soundcloud < url >'], // view for message in menu 5 | command: /^(sc(dl|down)|soundcloud)$/i, //another command. 6 | description: 'Download music from SoundCloud Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url soundcloud', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, canvas, apikeys, regex, host, getMessage, parseResult, getJson, getBuffer, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/soundcloud?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Sound Cloud'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const caption = styleMessage('SoundCloud Music Downloader', result); 18 | const thumbnail = await canvas.create('Sound Cloud Downloader'); 19 | const buffer = await getBuffer(data.result.thumbnail); 20 | await xcoders.sendMessage(m.chat, { image: thumbnail, caption, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 21 | addHitCommand('Sound Cloud', true); 22 | return xcoders.sendAudioFromUrl(m.chat, data.result.url, x, { title: data.result.title, fileName: `${data.result.title}.mp3`, thumbnail: buffer, source: query }); 23 | } catch (error) { 24 | return errorMessage(m.chat, error, 'Sound Cloud'); 25 | } 26 | } 27 | }; -------------------------------------------------------------------------------- /commands/Downloader/stickerTelegram.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['stele < url >'], // view for message in menu 5 | command: /^(st(dl|down)|stele)$/i, //another command. 6 | description: 'Download Sticker from telegram Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url sticker telegram', 10 | execute: async ({ xcoders, x, m, query, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, getJson, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/telesticker?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Sticker Telegram'); 15 | await waitingMessage(m.chat); 16 | addHitCommand('Sticker Telegram', true); 17 | for (let i = 0; i < 10; i++) { 18 | await xcoders.sendMessage(m.chat, { sticker: { url: data.result.url[i] }, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 19 | } 20 | return true; 21 | } catch (error) { 22 | return errorMessage(m.chat, error, 'Sticker Telegram'); 23 | } 24 | } 25 | }; -------------------------------------------------------------------------------- /commands/Downloader/tiktok.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import fs from "fs"; 4 | import path from "path"; 5 | import { execSync } from "child_process"; 6 | import { fileTypeFromBuffer } from "file-type"; 7 | 8 | export default { 9 | views: ['tiktok < url > --flag'], // view for message in menu 10 | command: /^(ttdl|tiktok|tt)$/i, //another command. 11 | description: 'Download media from Tiktok Url', 12 | query: true, 13 | url: true, 14 | usage: '%cmd% url tiktok --wm or --nowm\nFlag --wm untuk video dengan watermark.\nFlag --nowm untuk video tanpa watermark.', 15 | execute: async ({ xcoders, x, m, query, styleMessage, errorMessage, waitingMessage, replyMessage, apikeys, host, getMessage, parseResult, getJson, addHitCommand, convertToBuffer, getRandom, zipFolder, invalidUrlMessage, regex }) => { 16 | try { 17 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 18 | let flag = null; 19 | if (query.endsWith('--nowm')) { 20 | flag = 'video_nowatermark'; 21 | } else if (query.endsWith('--wm')) { 22 | flag = 'video_watermark'; 23 | } else { 24 | flag = 'video_watermark'; 25 | } 26 | const data = await getJson(`${host}/api/download/tiktok?url=${query}&apikey=${apikeys}`); 27 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Tiktok Downloader'); 28 | await waitingMessage(m.chat); 29 | const result = parseResult(data.result); 30 | const caption = styleMessage('Tiktok Media Downloader', result); 31 | addHitCommand('Tiktok Downloader', true); 32 | if (data.result?.result_url) { 33 | await replyMessage('*_Success convert to file zip..._*', 'success'); 34 | const pathFolder = path.join(process.cwd(), `tiktok_result_${Date.now()}`); 35 | const pathZip = path.join(process.cwd(), 'temp', 'tiktok_result_images.zip'); 36 | 37 | if (!fs.existsSync(pathFolder)) fs.mkdirSync(pathFolder); 38 | if (!fs.existsSync(path.join(pathFolder, 'photos'))) fs.mkdirSync(path.join(pathFolder, 'photos')); 39 | if (!fs.existsSync(path.join(pathFolder, 'music'))) fs.mkdirSync(path.join(pathFolder, 'music')); 40 | 41 | const musicBuffer = await fetch(data.result.music_url).then(async (response) => convertToBuffer(await response.arrayBuffer())); 42 | await fs.promises.writeFile(path.join(pathFolder, 'music', `${data.result.music_info.title}.mp3`), musicBuffer); 43 | for await (let { display_image } of data.result.result_url) { 44 | const buffer = await fetch(display_image.url_list[1]).then(response => response.arrayBuffer()); 45 | const result = convertToBuffer(buffer); 46 | await fs.promises.writeFile(path.join(pathFolder, 'photos', getRandom('.jpeg')), result); 47 | } 48 | zipFolder(pathFolder, pathZip, async function (error, message) { 49 | if (error) { 50 | console.error(error); 51 | return errorMessage(m.chat, null, 'Tiktok Downloader'); 52 | } 53 | const responseResult = await fs.promises.readFile(pathZip); 54 | const type = await fileTypeFromBuffer(responseResult); 55 | execSync(`rm -r "${pathFolder}"`); 56 | if (fs.existsSync(pathZip)) await fs.promises.unlink(pathZip); 57 | return xcoders.sendMessage(m.chat, { document: responseResult, caption: message, jpegThumbnail: global.icon, mimetype: type.mime, fileName: getRandom(type.ext), contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 58 | }); 59 | } else { 60 | return xcoders.sendFileFromUrl(m.chat, data.result[flag], caption, x); 61 | } 62 | } catch (error) { 63 | return errorMessage(m.chat, error, 'Tiktok Downloader'); 64 | } 65 | } 66 | }; -------------------------------------------------------------------------------- /commands/Downloader/twitter.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['twitter < url >'], // view for message in menu 5 | command: /^(twit(|dl|down)|twitter)$/i, //another command. 6 | description: 'Download media from Twitter Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url Twitter', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/twitter?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Twitter Downloader'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const caption = styleMessage('Twitter Media Downloader', result); 18 | addHitCommand('Twitter Downloader', true); 19 | for (let { url } of data.result.data) { 20 | await xcoders.sendFileFromUrl(m.chat, url, caption, x); 21 | } 22 | return true; 23 | } catch (error) { 24 | return errorMessage(m.chat, error, 'Twitter Downloader'); 25 | } 26 | } 27 | }; -------------------------------------------------------------------------------- /commands/Downloader/xnxx.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['xnxx < url >'], // view for message in menu 5 | command: /^(xnxxdl|xnxx)$/i, //another command. 6 | description: 'Download Files from Xnxx Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url Xnxx', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/xnxx?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Xnxx Downloader'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const caption = styleMessage('Xnxx Downloader', result); 18 | addHitCommand('Xnxx Downloader', true); 19 | return xcoders.sendFileFromUrl(m.chat, data.result.url, caption, x); 20 | } catch (error) { 21 | return errorMessage(m.chat, error, 'Xnxx Downloader'); 22 | } 23 | } 24 | }; -------------------------------------------------------------------------------- /commands/Downloader/xvideos.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['xvideosdl < url >'], // view for message in menu 5 | command: /^xvideos(|dl)$/i, //another command. 6 | description: 'Download video from Xvideos Url', 7 | query: true, 8 | url: true, 9 | usage: '%cmd% url xvideos', 10 | execute: async ({ xcoders, x, m, query, styleMessage, invalidUrlMessage, errorMessage, waitingMessage, apikeys, regex, host, getMessage, parseResult, getJson, addHitCommand }) => { 11 | try { 12 | if (!regex.media(query)) return invalidUrlMessage(m.chat); 13 | const data = await getJson(`${host}/api/download/xvideos?url=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Xvideos Downloader'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const caption = styleMessage('Xvideos Video Downloader', result); 18 | addHitCommand('Xvideos Downloader', true); 19 | return xcoders.sendFileFromUrl(m.chat, data.result.url, caption, x); 20 | } catch (error) { 21 | return errorMessage(m.chat, error, 'Xvideos Downloader'); 22 | } 23 | } 24 | }; -------------------------------------------------------------------------------- /commands/Maker/affect.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import formData from 'form-data'; 4 | 5 | export default { 6 | views: ['affect'], // view for message in menu 7 | command: /^affect$/i, //another command. 8 | description: 'Create Affect Images', 9 | usage: '%cmd% Reply Images and try again', 10 | media: true, 11 | execute: async ({ xcoders, m, x, apikeys, quoted, mimetype, getRandom, response, waitingMessage, errorMessage, host, addHitCommand }) => { 12 | try { 13 | if (!/image\//.test(mimetype)) return errorMessage(m.chat, 'Invalid mimetype, only images are allowed'); 14 | const buffer = await quoted.download(); 15 | const name = getRandom(mimetype.split('/')[1]); 16 | const FormData = new formData(); 17 | FormData.append('image', buffer, { 18 | contentType: mimetype, 19 | filename: name 20 | }); 21 | const { data } = await axios.post(`${host}/api/maker/affect?apikey=${apikeys}`, FormData.getBuffer(), { headers: FormData.getHeaders() }); 22 | const result = Buffer.from(data); 23 | await waitingMessage(m.chat); 24 | addHitCommand('Affect Maker', true); 25 | return xcoders.sendMessage(m.chat, { image: result, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 26 | } catch (error) { 27 | return errorMessage(m.chat, error, 'Affect Maker'); 28 | } 29 | } 30 | }; -------------------------------------------------------------------------------- /commands/Maker/attp.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['attp < text >'], // view for message in menu 5 | command: /^attp$/i, //another command. 6 | description: 'Create Animation Text To Pictures', 7 | usage: '%cmd% xcoders', 8 | query: true, 9 | text: true, 10 | execute: async ({ xcoders, m, x, apikeys, query, waitingMessage, errorMessage, host, getBuffer, createSticker, addHitCommand }) => { 11 | try { 12 | const data = await getBuffer(`${host}/api/maker/attp?text=${query}&apikey=${apikeys}`); 13 | const result = await createSticker(data, {}); 14 | await waitingMessage(m.chat); 15 | addHitCommand('Text To Picture', true); 16 | return xcoders.sendMessage(m.chat, { sticker: result, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 17 | } catch (error) { 18 | return errorMessage(m.chat, error, 'Text To Picture'); 19 | } 20 | } 21 | }; -------------------------------------------------------------------------------- /commands/Maker/biden.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['biden < text >'], // view for message in menu 5 | command: /^biden$/i, //another command. 6 | description: 'Create Biden Tweet images', 7 | usage: '%cmd% xcoders', 8 | query: true, 9 | execute: async ({ xcoders, m, x, apikeys, query, waitingMessage, errorMessage, host, getBuffer, addHitCommand }) => { 10 | try { 11 | const data = await getBuffer(`${host}/api/maker/biden?text=${query}&apikey=${apikeys}`); 12 | if (data.status) return errorMessage(m.chat, null, 'Biden Maker'); 13 | await waitingMessage(m.chat); 14 | addHitCommand('Biden Maker', true); 15 | return xcoders.sendMessage(m.chat, { image: data, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 16 | } catch (error) { 17 | return errorMessage(m.chat, error, 'Biden Maker'); 18 | } 19 | } 20 | }; -------------------------------------------------------------------------------- /commands/Maker/caution.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['caution < text >'], // view for message in menu 5 | command: /^caution$/i, //another command. 6 | description: 'Create Caution Warning images', 7 | usage: '%cmd% xcoders', 8 | query: true, 9 | execute: async ({ xcoders, m, x, apikeys, query, waitingMessage, errorMessage, host, getBuffer, addHitCommand }) => { 10 | try { 11 | const data = await getBuffer(`${host}/api/maker/caution?text=${query}&apikey=${apikeys}`); 12 | await waitingMessage(m.chat); 13 | addHitCommand('Caution Maker', true); 14 | return xcoders.sendMessage(m.chat, { image: data, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 15 | } catch (error) { 16 | return errorMessage(m.chat, error, 'Caution Maker'); 17 | } 18 | } 19 | }; -------------------------------------------------------------------------------- /commands/Maker/chatBubble.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['chat < text >'], // view for message in menu 5 | command: /^s?chat$/i, //another command. 6 | description: 'Create chat Bubble images', 7 | usage: '%cmd% xcoders', 8 | query: true, 9 | execute: async ({ xcoders, m, x, apikeys, query, waitingMessage, errorMessage, host, getBuffer, createSticker, quoted, addHitCommand }) => { 10 | try { 11 | const number = quoted.sender.split('@')[0]; 12 | const data = await getBuffer(`${host}/api/maker/chat-bubble?text=${query}&nickname=${quoted.pushName || 'unknown'}&number=${number}&apikey=${apikeys}`); 13 | const result = await createSticker(data, {}); 14 | await waitingMessage(m.chat); 15 | addHitCommand('Chat Bubble Maker', true); 16 | return xcoders.sendMessage(m.chat, { sticker: result, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 17 | } catch (error) { 18 | return errorMessage(m.chat, error, 'Chat Bubble Maker'); 19 | } 20 | } 21 | }; -------------------------------------------------------------------------------- /commands/Maker/communism.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import formData from 'form-data'; 4 | 5 | export default { 6 | views: ['communism'], // view for message in menu 7 | command: /^comm?unism?$/i, //another command. 8 | description: 'Create Communism Images', 9 | usage: '%cmd% Reply Images and try again', 10 | media: true, 11 | execute: async ({ xcoders, m, x, apikeys, quoted, mimetype, getRandom, response, waitingMessage, errorMessage, host, addHitCommand }) => { 12 | try { 13 | if (!/image\//.test(mimetype)) return errorMessage(m.chat, 'Invalid mimetype, only images are allowed'); 14 | const buffer = await quoted.download(); 15 | const name = getRandom(mimetype.split('/')[1]); 16 | const FormData = new formData(); 17 | FormData.append('image', buffer, { 18 | contentType: mimetype, 19 | filename: name 20 | }); 21 | const { data } = await axios.post(`${host}/api/maker/communism?apikey=${apikeys}`, FormData.getBuffer(), { headers: FormData.getHeaders() }); 22 | await waitingMessage(m.chat); 23 | const result = Buffer.from(data); 24 | addHitCommand('Communism Maker', true); 25 | return xcoders.sendMessage(m.chat, { image: result, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 26 | } catch (error) { 27 | return errorMessage(m.chat, error, 'Communism Maker'); 28 | } 29 | } 30 | }; -------------------------------------------------------------------------------- /commands/Maker/drake.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['drake < text|text >'], // view for message in menu 5 | command: /^drake$/i, //another command. 6 | description: 'Create Drake meme images', 7 | usage: '%cmd% adiwajshing|lord mano', 8 | query: true, 9 | text: true, 10 | execute: async ({ xcoders, m, x, apikeys, query, waitingMessage, errorMessage, host, getJson, addHitCommand }) => { 11 | try { 12 | const [text1, text2] = query.split('|'); 13 | const data = await getJson(`${host}/api/maker/drake?text=${text1}&text2=${text2}&result_type=json&apikey=${apikeys}`); 14 | if (data.status) return errorMessage(m.chat, null, 'Drake Maker'); 15 | const result = Buffer.from(data); 16 | await waitingMessage(m.chat); 17 | addHitCommand('Drake Maker', true); 18 | return xcoders.sendMessage(m.chat, { image: result, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 19 | } catch (error) { 20 | return errorMessage(m.chat, error, 'Drake Maker'); 21 | } 22 | } 23 | }; -------------------------------------------------------------------------------- /commands/Maker/emojimix.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['emojimix < 🥱😢 >', 'smojimix < 🥱😢 >'], // view for message in menu 5 | command: /^s?(emojimix|mix)$/i, //another command. 6 | description: 'Create Emoji Mix', 7 | usage: '%cmd% 🥱😢', 8 | query: true, 9 | execute: async ({ command, xcoders, m, x, apikeys, emojiRegex, createSticker, query, waitingMessage, errorMessage, host, getJson, addHitCommand }) => { 10 | try { 11 | const regex = emojiRegex(); 12 | const matchedEmoji = [...query.matchAll(regex)]; 13 | if (matchedEmoji.length > 2 || matchedEmoji.length < 2) return errorMessage(m.chat, `Emoji tidak boleh lebih dari ${matchedEmoji.length}`); 14 | const emoji = matchedEmoji.map(match => match[0]); 15 | const data = await getJson(`${host}/api/maker/emoji-mix?emoji=${emoji[0]}&emoji2=${emoji[1]}&result_type=json&apikey=${apikeys}`); 16 | const buffer = Buffer.from(data); 17 | const result = command.startsWith('s') ? await createSticker(buffer) : buffer; 18 | const type = command.startsWith('s') ? 'sticker' : 'image'; 19 | await waitingMessage(m.chat); 20 | addHitCommand('Emoji Mix', true); 21 | return xcoders.sendMessage(m.chat, { [type]: result, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 22 | } catch (error) { 23 | return errorMessage(m.chat, error, 'Emoji Mix'); 24 | } 25 | } 26 | }; -------------------------------------------------------------------------------- /commands/Maker/facts.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['facts < text >'], // view for message in menu 5 | command: /^fat?cts$/i, //another command. 6 | description: 'Create Fun Facts images', 7 | usage: '%cmd% xcoders', 8 | query: true, 9 | text: true, 10 | execute: async ({ xcoders, m, x, apikeys, query, waitingMessage, errorMessage, host, getJson, addHitCommand }) => { 11 | try { 12 | const data = await getJson(`${host}/api/maker/facts?text=${query}&result_type=json&apikey=${apikeys}`); 13 | if (data.status) return errorMessage(m.chat, null, 'Facts Maker'); 14 | const result = Buffer.from(data); 15 | await waitingMessage(m.chat); 16 | addHitCommand('Facts Maker', true); 17 | return xcoders.sendMessage(m.chat, { image: result, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 18 | } catch (error) { 19 | return errorMessage(m.chat, error, 'Facts Maker'); 20 | } 21 | } 22 | }; -------------------------------------------------------------------------------- /commands/Maker/gura.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['gura < text >'], // view for message in menu 5 | command: /^gura$/i, //another command. 6 | description: 'Create Gura images', 7 | usage: '%cmd% xcoders', 8 | query: true, 9 | execute: async ({ xcoders, m, x, apikeys, query, waitingMessage, errorMessage, host, getBuffer, response, addHitCommand }) => { 10 | try { 11 | const data = await getBuffer(`${host}/api/maker/gura?text=${query}&apikey=${apikeys}`); 12 | await waitingMessage(m.chat); 13 | addHitCommand('Gura Maker', true); 14 | return xcoders.sendMessage(m.chat, { image: data, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 15 | } catch (error) { 16 | return errorMessage(m.chat, error, 'Gura Maker'); 17 | } 18 | } 19 | }; -------------------------------------------------------------------------------- /commands/Maker/kannagen.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['kannagen < text >', 'skannagen < text >'], // view for message in menu 5 | command: /^s?kann?agen$/i, //another command. 6 | description: 'Create Kannagen quotes images', 7 | usage: '%cmd% xcoders', 8 | query: true, 9 | text: true, 10 | execute: async ({ xcoders, command, m, x, apikeys, query, waitingMessage, errorMessage, host, getBuffer, createSticker, addHitCommand }) => { 11 | try { 12 | const data = await getBuffer(`${host}/api/maker/kannagen?text=${query}&apikey=${apikeys}`); 13 | const response = command.startsWith('s') ? await createSticker(data, {}) : data; 14 | const content = command.startsWith('s') ? 'sticker' : 'image'; 15 | await waitingMessage(m.chat); 16 | addHitCommand('Kannagen Maker', true); 17 | return xcoders.sendMessage(m.chat, { [content]: response, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 18 | } catch (error) { 19 | return errorMessage(m.chat, error, 'Kannagen Maker'); 20 | } 21 | } 22 | }; -------------------------------------------------------------------------------- /commands/Maker/meme.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import formData from 'form-data'; 4 | 5 | export default { 6 | views: ['smeme < text|text >'], // view for message in menu 7 | command: /^smeme$/i, //another command. 8 | description: 'Create Sticker Meme Generate', 9 | usage: '%cmd% Reply Images and try again', 10 | media: true, 11 | query: true, 12 | text: true, 13 | execute: async ({ xcoders, m, x, apikeys, query, quoted, mimetype, getRandom, waitingMessage, errorMessage, host, addHitCommand, createSticker }) => { 14 | try { 15 | if (!/image\//.test(mimetype)) return errorMessage(m.chat, 'Invalid mimetype, only images are allowed'); 16 | const [text2, text] = query.split('|'); 17 | const buffer = await quoted.download(); 18 | const name = getRandom(mimetype.split('/')[1]); 19 | const FormData = new formData(); 20 | FormData.append('image', buffer, { 21 | contentType: mimetype, 22 | filename: name 23 | }); 24 | const { data } = await axios.post(`${host}/api/maker/meme?text=${text || ''}&text2=${text2 || ''}&apikey=${apikeys}`, FormData.getBuffer(), { headers: FormData.getHeaders() }); 25 | const result = Buffer.from(data); 26 | const resultSticker = await createSticker(result, {}); 27 | await waitingMessage(m.chat); 28 | addHitCommand('MEME Maker', true); 29 | return xcoders.sendMessage(m.chat, { sticker: resultSticker, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 30 | } catch (error) { 31 | return errorMessage(m.chat, error, 'MEME Maker'); 32 | } 33 | } 34 | }; -------------------------------------------------------------------------------- /commands/Maker/nulis.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['nulis < text >'], // view for message in menu 5 | command: /^nulis$/i, //another command. 6 | description: 'Create write text to paper', 7 | usage: '%cmd% xcoders', 8 | query: true, 9 | text: true, 10 | execute: async ({ xcoders, m, x, host, query, getBuffer, waitingMessage, errorMessage, addHitCommand, apikeys }) => { 11 | try { 12 | const result = await getBuffer(`${host}/api/maker/nulis?text=${query}&apikey=${apikeys}`); 13 | await waitingMessage(m.chat); 14 | addHitCommand('Writes Maker', true); 15 | return xcoders.sendMessage(m.chat, { image: result, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 16 | } catch (error) { 17 | return errorMessage(m.chat, error, 'Writes Maker'); 18 | } 19 | } 20 | }; -------------------------------------------------------------------------------- /commands/Maker/quotes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import formData from 'form-data'; 4 | 5 | export default { 6 | views: ['quotes < text|wm >'], // view for message in menu 7 | command: /^q(ou|uo)tes$/i, //another command. 8 | description: 'Create Quotes Images', 9 | usage: '%cmd% Reply Images and try again', 10 | media: true, 11 | query: true, 12 | text: true, 13 | execute: async ({ xcoders, m, x, apikeys, query, quoted, response, mimetype, getRandom, waitingMessage, errorMessage, host, addHitCommand }) => { 14 | try { 15 | if (!/image\//.test(mimetype)) return errorMessage(m.chat, 'Invalid mimetype, only images are allowed'); 16 | const [text, text2] = query.split('|'); 17 | const buffer = await quoted.download(); 18 | const name = getRandom('png'); 19 | const FormData = new formData(); 20 | FormData.append('image', buffer, { 21 | contentType: mimetype, 22 | filename: name 23 | }); 24 | const { data } = await axios.post(`${host}/api/maker/quotes?text=${text}&wm=${text2 || 'Reserved - xcoders teams'}&apikey=${apikeys}`, FormData.getBuffer(), { headers: FormData.getHeaders() }); 25 | const result = Buffer.from(data); 26 | await waitingMessage(m.chat); 27 | addHitCommand('Quotes Maker', true); 28 | return xcoders.sendMessage(m.chat, { image: result, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 29 | } catch (error) { 30 | return errorMessage(m.chat, error, 'Quotes Maker'); 31 | } 32 | } 33 | }; -------------------------------------------------------------------------------- /commands/Maker/removebg.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import formData from 'form-data'; 4 | 5 | export default { 6 | views: ['removebg'], // view for message in menu 7 | command: /^(removebg|rmbg)$/i, //another command. 8 | description: 'Remove Background Images', 9 | usage: '%cmd% Reply Images and try again', 10 | media: true, 11 | execute: async ({ xcoders, m, x, apikeys, quoted, mimetype, getRandom, getMessage, waitingMessage, errorMessage, getBuffer, host, styleMessage, parseResult, addHitCommand }) => { 12 | try { 13 | if (!/image\//.test(mimetype)) return errorMessage(m.chat, 'Invalid mimetype, only images are allowed'); 14 | const buffer = await quoted.download(); 15 | const name = getRandom(mimetype.split('/')[1]); 16 | const FormData = new formData(); 17 | FormData.append('image', buffer, { 18 | contentType: mimetype, 19 | filename: name 20 | }); 21 | const { data } = await axios.post(`${host}/api/maker/remove-bg?apikey=${apikeys}`, FormData.getBuffer(), { headers: FormData.getHeaders() }); 22 | if (!data.status || data.message) return errorMessage(m.chat, getMessage(data), ' Remove Background'); 23 | await waitingMessage(m.chat); 24 | const images = await getBuffer(data.url); 25 | const result = parseResult(data); 26 | const caption = styleMessage('Image Background Removed', result); 27 | addHitCommand('Remove Background', true); 28 | return xcoders.sendMessage(m.chat, { image: images, caption: caption, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 29 | } catch (error) { 30 | return errorMessage(m.chat, error, 'Remove Background'); 31 | } 32 | } 33 | }; -------------------------------------------------------------------------------- /commands/Maker/rip.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import formData from 'form-data'; 4 | 5 | export default { 6 | views: ['rip'], // view for message in menu 7 | command: /^rip$/i, //another command. 8 | description: 'Create Fun RIP Images', 9 | usage: '%cmd% Reply Images and try again', 10 | media: true, 11 | execute: async ({ xcoders, m, x, apikeys, quoted, mimetype, getRandom, response, waitingMessage, errorMessage, host, addHitCommand }) => { 12 | try { 13 | if (!/image\//.test(mimetype)) return errorMessage(m.chat, 'Invalid mimetype, only images are allowed'); 14 | const buffer = await quoted.download(); 15 | const name = getRandom(mimetype.split('/')[1]); 16 | const FormData = new formData(); 17 | FormData.append('image', buffer, { 18 | contentType: mimetype, 19 | filename: name 20 | }); 21 | const { data } = await axios.post(`${host}/api/maker/rip?apikey=${apikeys}`, FormData.getBuffer(), { headers: FormData.getHeaders() }); 22 | await waitingMessage(m.chat); 23 | const images = Buffer.from(data); 24 | addHitCommand('RIP Maker', true); 25 | return xcoders.sendMessage(m.chat, { image: images, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 26 | } catch (error) { 27 | return errorMessage(m.chat, error, 'RIP Maker'); 28 | } 29 | } 30 | }; -------------------------------------------------------------------------------- /commands/Maker/ssmaps.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['ssmaps < text >'], // view for message in menu 5 | command: /^ssmaps?$/i, //another command. 6 | description: 'Screenshots Maps Wilayah', 7 | usage: '%cmd% banyuwangi', 8 | query: true, 9 | execute: async ({ xcoders, m, x, apikeys, query, waitingMessage, errorMessage, host, getBuffer, addHitCommand }) => { 10 | try { 11 | const data = await getBuffer(`${host}/api/maker/ssmaps?query=${query}&apikey=${apikeys}`); 12 | if (data.status) return errorMessage(m.chat, null, 'Screenshot Maps'); 13 | await waitingMessage(m.chat); 14 | addHitCommand('Screenshot Maps', true); 15 | return xcoders.sendMessage(m.chat, { image: data, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 16 | } catch (error) { 17 | return errorMessage(m.chat, error, 'Screenshot Maps'); 18 | } 19 | } 20 | }; -------------------------------------------------------------------------------- /commands/Maker/ssweb.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['ssweb < text >'], // view for message in menu 5 | command: /^ssweb$/i, //another command. 6 | description: 'Screenshot Website Convert To images', 7 | usage: '%cmd% https://api-xcoders.site', 8 | query: true, 9 | url: true, 10 | execute: async ({ xcoders, m, x, apikeys, query, regex, waitingMessage, errorMessage, host, getJson, addHitCommand }) => { 11 | try { 12 | const data = await getJson(`${host}/api/maker/ssweb?url=${query}&result_type=json&apikey=${apikeys}`); 13 | if (data.status) return errorMessage(m.chat, null, 'Screenshot Website'); 14 | const result = Buffer.from(data); 15 | await waitingMessage(m.chat); 16 | addHitCommand('Screenshot Website', true); 17 | return xcoders.sendMessage(m.chat, { image: result, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 18 | } catch (error) { 19 | return errorMessage(m.chat, error, 'Screenshot Website'); 20 | } 21 | } 22 | }; -------------------------------------------------------------------------------- /commands/Maker/tahta.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['tahta < text >'], // view for message in menu 5 | command: /^tahta$/i, //another command. 6 | description: 'Create Tahta quotes images', 7 | usage: '%cmd% xcoders', 8 | query: true, 9 | text: true, 10 | execute: async ({ xcoders, m, x, apikeys, query, waitingMessage, errorMessage, host, getJson, addHitCommand }) => { 11 | try { 12 | const data = await getJson(`${host}/api/maker/tahta?text=${query}&result_type=json&apikey=${apikeys}`); 13 | const result = Buffer.from(data); 14 | await waitingMessage(m.chat); 15 | addHitCommand('Tahta Maker', true); 16 | return xcoders.sendMessage(m.chat, { image: result, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 17 | } catch (error) { 18 | return errorMessage(m.chat, error, 'Tahta Maker'); 19 | } 20 | } 21 | }; -------------------------------------------------------------------------------- /commands/Maker/tolol.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['tolol < text >'], // view for message in menu 5 | command: /^tolol$/i, //another command. 6 | description: 'Create Tolol Certificate images', 7 | usage: '%cmd% xcoders', 8 | query: true, 9 | text: true, 10 | execute: async ({ xcoders, m, x, apikeys, query, waitingMessage, errorMessage, host, getBuffer, addHitCommand }) => { 11 | try { 12 | const data = await getBuffer(`${host}/api/maker/serti-tolol?text=${query}&apikey=${apikeys}`); 13 | await waitingMessage(m.chat); 14 | addHitCommand('Tolol Maker', true); 15 | return xcoders.sendMessage(m.chat, { image: data, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 16 | } catch (error) { 17 | return errorMessage(m.chat, error, 'Tolol Maker'); 18 | } 19 | } 20 | }; -------------------------------------------------------------------------------- /commands/Maker/ttp.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['ttp < text >'], // view for message in menu 5 | command: /^ttp$/i, //another command. 6 | description: 'Create Text To Pictures', 7 | usage: '%cmd% xcoders', 8 | query: true, 9 | text: true, 10 | execute: async ({ xcoders, m, x, apikeys, query, waitingMessage, errorMessage, host, getBuffer, createSticker, addHitCommand }) => { 11 | try { 12 | const data = await getBuffer(`${host}/api/maker/ttp?text=${query}&apikey=${apikeys}`); 13 | const result = await createSticker(data, {}); 14 | await waitingMessage(m.chat); 15 | addHitCommand('Text To Picture', true); 16 | return xcoders.sendMessage(m.chat, { sticker: result, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 17 | } catch (error) { 18 | return errorMessage(m.chat, error, 'Text To Picture'); 19 | } 20 | } 21 | }; -------------------------------------------------------------------------------- /commands/Maker/tts.js: -------------------------------------------------------------------------------- 1 | import streamReadable from '../../middleware/streamReadable.js'; 2 | 3 | export default { 4 | views: ['tts '], // views for menu message 5 | command: /^tts$/i, // another command 6 | description: 'Create Text To Speech', 7 | usage: '%cmd% id|xcoders', 8 | query: true, 9 | execute: async ({ xcoders, m, x, apikeys, query, waitingMessage, errorMessage, host, getBuffer, getRandom, addHitCommand }) => { 10 | try { 11 | const mime = Baileys.getDevice(x.id) === 'ios' ? 'audio/mpeg' : 'audio/mp4'; 12 | const [language, text] = query.split('|'); 13 | const data = await getBuffer(`${host}/api/maker/tts?text=${encodeURIComponent(text)}&language=${encodeURIComponent(language)}&apikey=${apikeys}`); 14 | await waitingMessage(m.chat); 15 | addHitCommand('Text To Speech', true); 16 | const files = new streamReadable({ 17 | frequency: 10, 18 | chunkSize: 2048 19 | }); 20 | files.path = getRandom('mp3'); 21 | files.put(data); 22 | files.stop(); 23 | const chunks = []; 24 | for await (const cache of files) { 25 | chunks.push(cache); 26 | } 27 | const buffer = Buffer.concat(chunks); 28 | return xcoders.sendMessage(m.chat, { audio: buffer, mimetype: mime, ptt: true, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 29 | } catch (error) { 30 | return errorMessage(m.chat, error, 'Text To Speech'); 31 | } 32 | } 33 | }; -------------------------------------------------------------------------------- /commands/Maker/twibbon.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import formData from 'form-data'; 4 | 5 | export default { 6 | views: ['badut', 'badut2', 'badut3'], // view for message in menu 7 | command: /^badut(2|3)?$/i, //another command. 8 | description: 'Create Twibbon Badut Images', 9 | usage: '%cmd% Reply Images and try again', 10 | media: true, 11 | execute: async ({ command, xcoders, m, x, apikeys, quoted, mimetype, getRandom, response, waitingMessage, errorMessage, host, addHitCommand }) => { 12 | try { 13 | if (!/image\//.test(mimetype)) return errorMessage(m.chat, 'Invalid mimetype, only images are allowed'); 14 | const buffer = await quoted.download(); 15 | const name = getRandom(mimetype.split('/')[1]); 16 | const FormData = new formData(); 17 | FormData.append('image', buffer, { 18 | contentType: mimetype, 19 | filename: name 20 | }); 21 | const { data } = await axios.post(`${host}/api/maker/${command}?apikey=${apikeys}`, FormData.getBuffer(), { headers: FormData.getHeaders() }); 22 | await waitingMessage(m.chat); 23 | const result = Buffer.from(data); 24 | addHitCommand('Twibbon Maker', true); 25 | return xcoders.sendMessage(m.chat, { image: result, caption: response.success, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 26 | } catch (error) { 27 | return errorMessage(m.chat, error, 'Twibbon Maker'); 28 | } 29 | } 30 | }; -------------------------------------------------------------------------------- /commands/Maker/twitter.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/commands/Maker/twitter.js -------------------------------------------------------------------------------- /commands/Manga-Anime/kusonime.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['kusonime < query >'], // view for message in menu 5 | command: /^kusonime/i, //another command. 6 | description: 'Get Result Search From kusonime Website', 7 | query: true, 8 | text: true, 9 | usage: '%cmd% naruto', 10 | execute: async ({ xcoders, x, m, query, canvas, styleMessage, errorMessage, waitingMessage, apikeys, host, getMessage, getJson, addHitCommand }) => { 11 | try { 12 | const data = await getJson(`${host}/api/anime/kusonime?query=${query}&apikey=${apikeys}`); 13 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Kusonime Search'); 14 | if (data.result.length === 0) return errorMessage(m.chat, 'result not found...', 'Kusonime Search'); 15 | await waitingMessage(m.chat); 16 | const result = data.result.map(object => { 17 | let results = ''; 18 | const keys = Object.keys(object); 19 | for (let key of keys) { 20 | results += `• ${key}: ${object[key]}\n`; 21 | } 22 | return results; 23 | }).join('\n\n'); 24 | const caption = styleMessage(null, result); 25 | const images = await canvas.create(`Kusonime Search ${query}`); 26 | addHitCommand('Kusonime Search', true); 27 | return xcoders.sendMessage(m.chat, { image: images, caption: caption.trim(), contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 28 | } catch (error) { 29 | return errorMessage(m.chat, error, 'Kusonime Search'); 30 | } 31 | } 32 | }; -------------------------------------------------------------------------------- /commands/Misc/audio.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['sendaudio < url >'], // view for message in menu 5 | command: /^send(audio|music|musik)$/i, //another command. 6 | description: 'Send Video from Url valid', 7 | query: true, 8 | url: true, 9 | audio: true, 10 | usage: '%cmd% url valid audio', 11 | execute: async ({ xcoders, waitingMessage, errorMessage, m, x, response, query, isAudioUrl }) => { 12 | try { 13 | await waitingMessage(m.chat); 14 | return xcoders.sendAudioFromUrl(m.chat, query, x, { stream: false }); 15 | } catch (error) { 16 | return errorMessage(m.chat, error); 17 | } 18 | } 19 | }; -------------------------------------------------------------------------------- /commands/Misc/deleteMessage.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['delete'], // view for message in menu 5 | command: /^del(|ete)$/i, //another command. 6 | description: 'Delete a message', 7 | usage: '%cmd% reply Messages', 8 | execute: async ({ replyMessage, m, errorMessage, response }) => { 9 | if (!m.quoted) return replyMessage('Reply message for delete message', 'info'); 10 | if (!m.quoted.fromMe) return replyMessage('Reply pesan yang dikirimkan bot ini...', 'info'); 11 | return m.quoted.delete().then(() => replyMessage(response.success)).catch((error) => errorMessage(m.chat, error)); 12 | } 13 | } -------------------------------------------------------------------------------- /commands/Misc/quoted.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['quoted'], // view for message in menu 5 | command: /^q(|uoted)$/i, //another command. 6 | description: 'Forward a message from your reply to', 7 | usage: '%cmd% reply to a message that contains a quote', 8 | execute: async ({ xcoders, m, errorMessage }) => { 9 | try { 10 | const quotedMessage = await xcoders.serializeMessages(m.getQuotedObj()); 11 | if (!quotedMessage.quoted) { 12 | return errorMessage(m.chat, 'Reply to a message that contains a quote'); 13 | } 14 | return quotedMessage.quoted.copyAndForward(m.chat, true); 15 | } catch (error) { 16 | return errorMessage(m.chat, 'Reply to a message that contains a quote'); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /commands/Misc/video.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['sendvideo < url >'], // view for message in menu 5 | command: /^send(video|vidio)$/i, //another command. 6 | description: 'Send Video from Url valid', 7 | query: true, 8 | url: true, 9 | video: true, 10 | usage: '%cmd% url valid video', 11 | execute: async ({ xcoders, waitingMessage, errorMessage, m, x, response, query, isVideoUrl }) => { 12 | try { 13 | await waitingMessage(m.chat); 14 | return xcoders.sendFileFromUrl(m.chat, query, response.success, x); 15 | } catch (error) { 16 | return errorMessage(m.chat, error); 17 | } 18 | } 19 | }; -------------------------------------------------------------------------------- /commands/Owners/backup.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import fs from "fs"; 4 | import path from "path"; 5 | import { fileTypeFromBuffer } from "file-type"; 6 | import { execSync } from "child_process"; 7 | 8 | export default { 9 | views: ['backup'], // views for menu message 10 | command: /^backup/i, // another command 11 | description: 'Only Owner can execute command', 12 | owner: true, 13 | usage: '%cmd%', 14 | execute: async ({ xcoders, m, x, replyMessage, waitingMessage, errorMessage, zipFolder }) => { 15 | try { 16 | await waitingMessage(m.chat); 17 | const pathBackup = path.join(process.cwd(), 'backup'); 18 | const pathZip = path.join(process.cwd(), 'temp', 'backup_file.zip'); 19 | const pathStore = path.join(process.cwd(), 'database', 'baileys_store.json'); 20 | if (!fs.existsSync(pathBackup)) { 21 | fs.mkdirSync(pathBackup); 22 | } 23 | if (fs.existsSync(pathStore)) await fs.promises.unlink(pathStore); 24 | const script = fs.readdirSync('.'); 25 | for await (let files of script) { 26 | if (files === 'node_modules') continue; 27 | if (files === 'backup') continue; 28 | execSync(`cp -r "${path.join(process.cwd(), files)}" "${pathBackup}"`); 29 | } 30 | zipFolder(pathBackup, pathZip, async function (error, message) { 31 | if (error) { 32 | console.error(error); 33 | return errorMessage(m.chat, error); 34 | } 35 | const result = await fs.promises.readFile(pathZip); 36 | const type = await fileTypeFromBuffer(result); 37 | await fs.promises.unlink(pathZip); 38 | execSync(`rm -r "${pathBackup}"`); 39 | await replyMessage('*Successfully backed up files...*', 'success'); 40 | return xcoders.sendMessage(m.chat, { document: result, caption: message, fileName: `backup.${type.ext}`, mimetype: type.mime, jpegThumbnail: global.icon, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 41 | }); 42 | } catch (error) { 43 | return errorMessage(m.chat, error); 44 | } 45 | } 46 | }; -------------------------------------------------------------------------------- /commands/Owners/broadcast.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['bcmember'], // views for menu message 5 | command: /^(bcmember|bcgc)/i, // another command 6 | description: 'Only Owner cant execute command', 7 | owner: true, 8 | query: true, 9 | onlyGroup: true, 10 | usage: '%cmd% pesan', 11 | execute: async ({ getParticipants, metadataGroups, mimetype, quoted, xcoders, m, replyMessage, styleMessage, errorMessage, query, delay }) => { 12 | try { 13 | if (/image|video/.test(mimetype)) { 14 | for (let i = 0; i < getParticipants.length; i++) { 15 | await delay(4000); 16 | await xcoders.sendMessage(getParticipants[i].id, { [quoted.mtype.slice(0, -7)]: await quoted.download(), caption: styleMessage(`Broadcast All Member ${metadataGroups.subject}`, query), contextInfo: { forwardingScore: 9999999, isForwarded: true } }); 17 | } 18 | return replyMessage(`Broadcasted to *${getParticipants.length} Users*`); 19 | } else { 20 | for (let i = 0; i < getParticipants.length; i++) { 21 | await delay(4000); 22 | await xcoders.sendMessage(getParticipants[i].id, { text: styleMessage(`Broadcast All Member ${metadataGroups.subject}`, query), contextInfo: { forwardingScore: 9999999, isForwarded: true } }); 23 | } 24 | return replyMessage(`Broadcasted to *${getParticipants.length} Users*`); 25 | } 26 | } catch (error) { 27 | return errorMessage(m.chat, error); 28 | } 29 | } 30 | }; -------------------------------------------------------------------------------- /commands/Owners/get.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import util from 'util'; 4 | import axios from 'axios'; 5 | 6 | export default { 7 | views: ['get'], // views for menu message 8 | command: /^(get)/i, // another command 9 | description: 'Only Owner cant execute command', 10 | owner: true, 11 | query: true, 12 | url: true, 13 | usage: '%cmd% url api', 14 | execute: async ({ m, replyMessage, invalidUrlMessage, errorMessage, query, regex }) => { 15 | try { 16 | if (!regex.url(query)) return invalidUrlMessage(m.chat); 17 | const { data } = await axios.get(query); 18 | if (typeof data === 'object') { 19 | const parse = JSON.stringify(data, null, 2); 20 | const utils = util.format(parse); 21 | return replyMessage(utils); 22 | } else { 23 | const utils = util.format(data); 24 | return replyMessage(utils); 25 | } 26 | } catch (error) { 27 | return errorMessage(m.chat, error); 28 | } 29 | } 30 | }; -------------------------------------------------------------------------------- /commands/Owners/restart.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['restart'], // views for menu message 5 | command: /^restart/i, // another command 6 | description: 'Only Owner cant execute command', 7 | owner: true, 8 | usage: '%cmd%', 9 | execute: async ({ m, replyMessage, errorMessage, response }) => { 10 | try { 11 | await replyMessage(response.success); 12 | setTimeout(() => { 13 | return process.send('reset'); 14 | }, 2000); 15 | } catch (error) { 16 | return errorMessage(m.chat, error); 17 | } 18 | } 19 | }; -------------------------------------------------------------------------------- /commands/Owners/set-mode.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['change'], // views for menu message 5 | command: /^change/i, // another command 6 | description: 'Only Owner cant execute command', 7 | owner: true, 8 | query: true, 9 | usage: '%cmd% --help', 10 | execute: async ({ m, prefix, replyMessage, errorMessage, styleMessage, response, query }) => { 11 | try { 12 | if (/--help/.test(query)) { 13 | const result = styleMessage('Usage Change Options', `Jika ingin mengubah host api bisa dengan menggunakan *command: ${prefix}change api\nuntuk mengubah apikey: ${prefix}change apikey apikeymu\nuntuk mode self/public: ${prefix}change public/self\nuntuk prefix: ${prefix}change prefix optional\n\n`); 14 | return replyMessage(result); 15 | } else if (/api|host/.test(query)) { 16 | global.original = !global.original; 17 | return replyMessage(response.success); 18 | } else if (/apikey/.test(query)) { 19 | global.apikeys = query.slice(7); 20 | return replyMessage(response.success); 21 | } else if (/public|self/.test(query)) { 22 | global.public = query == 'self' ? false : true; 23 | return replyMessage(response.success); 24 | } else if(/prefix/.test(query)) { 25 | const input = query.slice(7); 26 | global.multiprefix = input == 'multi' ? true : false; 27 | global.nonprefix = input == 'nopref' ? true : false; 28 | global.prefix = !/multi|nopref/.test(input) ? input : '!'; 29 | return replyMessage(response.success); 30 | } else { 31 | return replyMessage('harap periksa query anda'); 32 | } 33 | } catch (error) { 34 | return errorMessage(m.chat, error); 35 | } 36 | } 37 | }; -------------------------------------------------------------------------------- /commands/Religion/alquran.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['alquran < surah|ayat >'], 5 | command: /^(al)?quran$/i, 6 | description: 'Get Surah Al`Qur-an and audio', 7 | query: true, 8 | usage: '%cmd% 1|5', 9 | execute: async ({ xcoders, m, x, errorMessage, waitingMessage, canvas, query, host, getJson, apikeys, parseResult, styleMessage, addHitCommand }) => { 10 | try { 11 | const [surah, ayat] = query.split('|'); 12 | const data = await getJson(`${host}/api/religion/quran?surah=${surah}&ayat=${ayat}&apikey=${apikeys}`); 13 | if (!data.status) return errorMessage(m.chat, getMessage(data), "Al'Qur-an"); 14 | await waitingMessage(m.chat); 15 | const result = parseResult(data.result); 16 | const caption = styleMessage(null, result); 17 | const images = await canvas.create(`Al'Qur-an Surah ${surah} Ayat ${ayat}`); 18 | addHitCommand("Al'Qur-an", true); 19 | await xcoders.sendAudioFromUrl(m.chat, data.result.audio, x, { stream: true, type: 'audio' }); 20 | return xcoders.sendMessage(m.chat, { image: images, caption: caption.trim(), contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 21 | } catch (error) { 22 | return errorMessage(m.chat, error, "Al'Qur-an"); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /commands/Religion/asmaulHusna.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['asmaulhusna'], 5 | command: /^asmaul(|husna)$/i, 6 | description: 'Get a list of Asmaul Husna', 7 | usage: '', 8 | execute: async ({ xcoders, m, x, errorMessage, waitingMessage, host, getJson, apikeys, styleMessage, canvas, addHitCommand }) => { 9 | try { 10 | const data = await getJson(`${host}/api/religion/asmaul-husna?apikey=${apikeys}`); 11 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Asmal Husna'); 12 | await waitingMessage(m.chat); 13 | let string = ''; 14 | for (var i = 0; i < data.result.result.length; i++) { 15 | string += `• Number ID: ${data.result.result[i].number}\n`; 16 | string += `• Latin: ${data.result.result[i].latin}\n`; 17 | string += `• Arab: ${data.result.result[i].arab}\n`; 18 | string += `• Translate ID: ${data.result.result[i].translate_id}\n`; 19 | string += `• Translate EN: ${data.result.result[i].translate_en}\n`; 20 | string += '\n\n'; 21 | } 22 | const caption = styleMessage(null, string.trim()); 23 | const images = await canvas.create('Asmaul Husna'); 24 | addHitCommand('Asmaul Husna', true); 25 | return xcoders.sendMessage(m.chat, { image: images, caption: caption.trim(), contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 26 | } catch (error) { 27 | return errorMessage(m.chat, error, 'Asmaul Husna'); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /commands/Religion/bible.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['bible'], 5 | command: /^bible$/i, 6 | description: 'Qoute Bible days', 7 | usage: '', 8 | execute: async ({ xcoders, m, x, errorMessage, waitingMessage, host, getJson, apikeys, parseResult, styleMessage, addHitCommand }) => { 9 | try { 10 | const data = await getJson(`${host}/api/religion/bible-days?apikey=${apikeys}`); 11 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Bible Day'); 12 | await waitingMessage(m.chat); 13 | const result = parseResult(data.result); 14 | const caption = styleMessage('Bible days', result); 15 | addHitCommand('Bible Day', true); 16 | return xcoders.sendMessage(m.chat, { image: { url: data.result.thumbnail }, caption: caption, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 17 | } catch (error) { 18 | return errorMessage(m.chat, error, 'Bible Day'); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /commands/Religion/hadist.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['hadist < name|number >'], 5 | command: /^hadi(st|ts)$/i, 6 | description: 'Get Hadist Shahih', 7 | query: true, 8 | usage: '%cmd% bukhari|5', 9 | execute: async ({ xcoders, m, x, errorMessage, waitingMessage, query, host, getJson, apikeys, parseResult, styleMessage, addHitCommand }) => { 10 | try { 11 | const [kitab, number] = query.split('|'); 12 | const data = await getJson(`${host}/api/religion/hadits?kitab=${kitab}&number=${number}&apikey=${apikeys}`); 13 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Hadits'); 14 | await waitingMessage(m.chat); 15 | const result = parseResult(data.result); 16 | const caption = styleMessage('Hadist Shahih', result); 17 | addHitCommand('Hadits', true); 18 | return xcoders.sendMessage(m.chat, { image: { url: data.result.thumbnail }, caption: caption, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 19 | } catch (error) { 20 | return errorMessage(m.chat, error, 'Hadits'); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /commands/Religion/kisahNabi.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['kisahnabi < query >'], // view for message in menu 5 | command: /^kisahnabi/i, //another command. 6 | description: 'Get Information Story nabi', 7 | query: true, 8 | text: true, 9 | usage: '%cmd% muhammad', 10 | execute: async ({ xcoders, x, m, query, capitalize, canvas, styleMessage, errorMessage, waitingMessage, apikeys, host, getMessage, getJson, addHitCommand }) => { 11 | try { 12 | const data = await getJson(`${host}/api/religion/kisah-nabi?nabi=${query}&apikey=${apikeys}`); 13 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Kisah Nabi'); 14 | await waitingMessage(m.chat); 15 | const keys = Object.keys(data.result); 16 | const result = keys.map((key) => { 17 | return `• ${capitalize(key)}: ${data.result[key]}\n`; 18 | }).join(''); 19 | const caption = styleMessage(null, result); 20 | const images = await canvas.create(`Kisah Nabi ${query}`); 21 | addHitCommand('Kisah Nabi', true); 22 | return xcoders.sendMessage(m.chat, { image: images, caption: caption.trim(), contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 23 | } catch (error) { 24 | return errorMessage(m.chat, error, 'Kisah Nabi'); 25 | } 26 | } 27 | }; -------------------------------------------------------------------------------- /commands/Religion/surah.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['surah < number >'], 5 | command: /^surah$/i, 6 | description: 'Get Surah Al`Qur-an from number surah', 7 | query: true, 8 | usage: '%cmd% 1', 9 | execute: async ({ xcoders, m, x, errorMessage, waitingMessage, canvas, query, host, getJson, apikeys, styleMessage, addHitCommand }) => { 10 | try { 11 | const data = await getJson(`${host}/api/religion/surah?number=${query}&apikey=${apikeys}`); 12 | if (!data.status) return errorMessage(m.chat, getMessage(data), "Al'Qur-an Surah"); 13 | await waitingMessage(m.chat); 14 | const headers = `• Surah Name: ${data.result.name}\n• All Ayat: ${data.result.all_ayat}\n• Surah Number: ${data.result.surah_number}\n• Type Surah: ${data.result.type}\n\n`; 15 | let string = ''; 16 | for (var i = 0; i < data.result.verses.length; i++) { 17 | string += `• Number ID: ${data.result.verses[i].number}\n`; 18 | string += `• Arab: ${data.result.verses[i].text}\n`; 19 | string += `• Translate ID: ${data.result.verses[i].translation_id}\n`; 20 | string += `• Translate EN: ${data.result.verses[i].translation_en}`; 21 | string += '\n\n'; 22 | } 23 | const caption = styleMessage(null, headers + string.trim()); 24 | const images = await canvas.create(`Al'Qur-an Surah Number ${query}`); 25 | addHitCommand("Al'Qur-an Surah", true); 26 | await xcoders.sendAudioFromUrl(m.chat, data.result.audio, x, { stream: false, type: 'audio' }); 27 | return xcoders.sendMessage(m.chat, { image: images, caption: caption.trim(), contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 28 | } catch (error) { 29 | return errorMessage(m.chat, error, "Al'Qur-an Surah"); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /commands/Religion/tafsir.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['tafsir < query >'], // view for message in menu 5 | command: /^tafsir/i, //another command. 6 | description: 'Get Tafsir information', 7 | query: true, 8 | text: true, 9 | usage: '%cmd% dunia', 10 | execute: async ({ xcoders, x, m, query, capitalize, canvas, styleMessage, errorMessage, waitingMessage, apikeys, host, getMessage, getJson, addHitCommand }) => { 11 | try { 12 | const data = await getJson(`${host}/api/religion/tafsir-quran?query=${query}&apikey=${apikeys}`); 13 | if (!data.status) return errorMessage(m.chat, getMessage(data), "Tafsir Al'Qur-an"); 14 | if (data.result.length === 0) return errorMessage(m.chat, 'result not found...', "Tafsir Al'Qur-an"); 15 | await waitingMessage(m.chat); 16 | const result = data.result.map(object => { 17 | let results = ''; 18 | const keys = Object.keys(object); 19 | for (let key of keys) { 20 | results += `• ${capitalize(key)}: ${object[key]}\n`; 21 | } 22 | return results; 23 | }).join('\n\n'); 24 | const caption = styleMessage(null, result); 25 | const images = await canvas.create(`Tafsir Al'Qur-an ${query}`); 26 | addHitCommand("Tafsir Al'Qur-an", true); 27 | return xcoders.sendMessage(m.chat, { image: images, caption: caption.trim(), contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 28 | } catch (error) { 29 | return errorMessage(m.chat, error, "Tafsir Al'Qur-an"); 30 | } 31 | } 32 | }; -------------------------------------------------------------------------------- /commands/Searching/pinterest.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import _ from 'lodash'; 4 | 5 | export default { 6 | views: ['pinterest < query >'], // view for message in menu 7 | command: /^s?pin(|search|terest)$/i, //another command. 8 | description: 'Searching Image From Pinterest', 9 | query: true, 10 | text: true, 11 | usage: '%cmd% abstarct', 12 | execute: async ({ xcoders, x, m, query, styleMessage, errorMessage, waitingMessage, getMessage, parseResult, addHitCommand, getJson, host, apikeys }) => { 13 | try { 14 | const data = await getJson(`${host}/api/search/pinterest?query=${query}&apikey=${apikeys}`); 15 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Pinterest Searching'); 16 | await waitingMessage(m.chat); 17 | const randomResult = _.sample(data.result); 18 | const parseCaption = parseResult(randomResult); 19 | const caption = styleMessage('Pinterest Searching', parseCaption); 20 | addHitCommand('Pinterest Searching', true); 21 | return xcoders.sendMessage(m.chat, { image: { url: randomResult.url }, caption, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 22 | } catch (error) { 23 | return errorMessage(m.chat, error, 'Pinterest Searching'); 24 | } 25 | } 26 | }; -------------------------------------------------------------------------------- /commands/Stalker/github.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['ghstalk < username >'], // view for message in menu 5 | command: /^stalkgh|ghstalk$/i, //another command. 6 | description: 'Stalking User Github', 7 | query: true, 8 | usage: '%cmd% Fxc7', 9 | execute: async ({ xcoders, x, m, query, styleMessage, errorMessage, waitingMessage, apikeys, host, getMessage, parseResult, getJson, addHitCommand }) => { 10 | try { 11 | const data = await getJson(`${host}/api/stalk/github?username=${query}&apikey=${apikeys}`); 12 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Github Stalk'); 13 | await waitingMessage(m.chat); 14 | const result = parseResult(data.result); 15 | const caption = styleMessage('Github User Stalking', result); 16 | addHitCommand('Github Stalk', true); 17 | return xcoders.sendFileFromUrl(m.chat, data.result.profile_url, caption, x); 18 | } catch (error) { 19 | return errorMessage(m.chat, error, 'Github Stalk'); 20 | } 21 | } 22 | }; -------------------------------------------------------------------------------- /commands/Stalker/instagram.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['igstalk < username >'], // view for message in menu 5 | command: /^stalkig|igstalk$/i, //another command. 6 | description: 'Stalking User Instagram', 7 | query: true, 8 | usage: '%cmd% farhanxcode7', 9 | execute: async ({ xcoders, x, m, query, styleMessage, errorMessage, waitingMessage, apikeys, host, getMessage, parseResult, getJson, addHitCommand }) => { 10 | try { 11 | const data = await getJson(`${host}/api/stalk/ig?username=${query}&apikey=${apikeys}`); 12 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Instagram Stalk'); 13 | await waitingMessage(m.chat); 14 | const result = parseResult(data.result); 15 | const caption = styleMessage('Instagram User Stalking', result); 16 | addHitCommand('Instagram Stalk', true); 17 | return xcoders.sendFileFromUrl(m.chat, data.result.profile_url, caption, x); 18 | } catch (error) { 19 | return errorMessage(m.chat, error, 'Instagram Stalk'); 20 | } 21 | } 22 | }; -------------------------------------------------------------------------------- /commands/Stalker/tiktok.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import _ from 'lodash'; 4 | 5 | export default { 6 | views: ['ttstalk < username >'], // view for message in menu 7 | command: /^stalktt|ttstalk$/i, //anothm.chater command. 8 | description: 'Stalking User TikTok', 9 | query: true, 10 | usage: '%cmd% fxc7_', 11 | execute: async ({ xcoders, x, m, query, styleMessage, errorMessage, waitingMessage, apikeys, host, getMessage, parseResult, getJson, addHitCommand }) => { 12 | try { 13 | const data = await getJson(`${host}/api/stalk/tiktok?username=${query}&apikey=${apikeys}`); 14 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Tiktok Stalk'); 15 | await waitingMessage(m.chat); 16 | const result = parseResult(data.result); 17 | const caption = styleMessage('Tiktok User Stalking', result); 18 | addHitCommand('Tiktok Stalk', true); 19 | return xcoders.sendFileFromUrl(m.chat, data.result.url, caption, x); 20 | } catch (error) { 21 | return errorMessage(m.chat, error, 'Tiktok Stalk'); 22 | } 23 | } 24 | }; -------------------------------------------------------------------------------- /commands/Stalker/twitter.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['twitstalk < username >'], // view for message in menu 5 | command: /^stalktwit|twitstalk$/i, //another command. 6 | description: 'Stalking User Twitter', 7 | query: true, 8 | usage: '%cmd% evrlastinx', 9 | execute: async ({ xcoders, x, m, query, styleMessage, errorMessage, waitingMessage, apikeys, host, getMessage, parseResult, getJson, addHitCommand }) => { 10 | try { 11 | const data = await getJson(`${host}/api/stalk/twitter?username=${query}&apikey=${apikeys}`); 12 | if (!data.status) return errorMessage(m.chat, getMessage(data), 'Twitter Stalk'); 13 | await waitingMessage(m.chat); 14 | const result = parseResult(data.result); 15 | const caption = styleMessage('Twitter User Stalking', result); 16 | addHitCommand('Twitter Stalk', true); 17 | return xcoders.sendFileFromUrl(m.chat, data.result.profile_url, caption, x); 18 | } catch (error) { 19 | return errorMessage(m.chat, error, 'Twitter Stalk'); 20 | } 21 | } 22 | }; -------------------------------------------------------------------------------- /commands/Utility/contact.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import _ from 'lodash'; 4 | import phone from 'awesome-phonenumber'; 5 | import util from 'util'; 6 | 7 | export default { 8 | views: ['owners'], // views for menu message 9 | command: /^(pemilik|owner(s|))$/i, // command another. 10 | description: 'Utility for display owner', 11 | query: false, 12 | usage: '', 13 | execute: async ({ xcoders, x, m, owners }) => { 14 | try { 15 | const res = _.find(phone('+' + owners[0].replace(/[^0-9]+/, ''))); 16 | let contacts = []; 17 | for (let i = 0; i < 51; i++) { 18 | contacts.push({ 19 | displayName: 'Fxc7', 20 | vcard: 'BEGIN:VCARD\n' + 21 | 'VERSION:3.0\n' + 22 | 'FN:FarhanXCode7\n' + 23 | 'ORG:xcoders team\'s\n' + 24 | 'TEL;type=CELL;type=VOICE;waid=' + res.number.input.split('+')[1] + ':' + res.number.international + '\n' + 25 | 'X-ABLabel:XCODERS TEAM\'S\n' + 26 | 'URL;TYPE=Website:https://api-xcoders.site\n' + 27 | 'URL;TYPE=Github:https://github.com/Fxc7\n' + 28 | 'URL;TYPE=Github:https://github.com/FarhannnnX\n' + 29 | 'EMAIL;TYPE=Email:farhanxcode7@gmail.com\n' + 30 | 'ADR;TYPE=Location:;;yo ndatau kok tanya saya;;;;\n' + 31 | 'END:VCARD' 32 | }); 33 | } 34 | return xcoders.sendMessage(m.chat, { contacts: { displayName: 'WhatsApp Owners', contacts: [...contacts] }, contextInfo: { isForwarded: true, forwardingScore: 9999999 } }, { quoted: x }); 35 | } catch (error) { 36 | return errorMessage(m.chat, error); 37 | } 38 | } 39 | }; -------------------------------------------------------------------------------- /commands/Utility/count.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import helpers from '../../middleware/service.js'; 4 | 5 | export default { 6 | views: ['allfitur'], // views for menu message 7 | command: /^(count|)allfitur$/i, // another command 8 | description: 'Utility for display count all features', 9 | query: false, 10 | usage: '', 11 | execute: ({ replyMessage, requireJson }) => { 12 | return replyMessage(helpers.countFeatures(requireJson)); 13 | } 14 | }; -------------------------------------------------------------------------------- /commands/Utility/menu.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import helpers from '../../middleware/service.js'; 4 | 5 | export default { 6 | views: ['menu'], // views for menu message 7 | command: /^menu|help/i, // command another. 8 | description: 'Utility for display all features', 9 | query: false, 10 | usage: '', 11 | execute: ({ xcoders, x, m, prefix, host, senderName }) => { 12 | return xcoders.requestPaymentMenu(m.chat, helpers.allmenu(m, prefix, senderName, host), { quoted: x, sender: m.sender }); 13 | } 14 | }; -------------------------------------------------------------------------------- /commands/Utility/most-command.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import helpers from '../../middleware/service.js'; 4 | 5 | export default { 6 | views: ['mostcmd'], // views for menu message 7 | command: /^most(cmd|command)$/i, // command another. 8 | description: 'Utility for display Most Popular Features', 9 | query: false, 10 | usage: '', 11 | execute: ({ replyMessage }) => { 12 | return replyMessage(helpers.mostPopular(global.hitCommand)); 13 | } 14 | }; -------------------------------------------------------------------------------- /commands/Utility/source.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | export default { 4 | views: ['source'], 5 | command: /^source$/i, //another command. 6 | description: 'Sorce code this bot', 7 | usage: '', 8 | execute: ({ xcoders, m, x }) => { 9 | return xcoders.requestPaymentMenu(m.chat, '```https://github.com/xcoders-teams/xcoders-bot```', { quoted: x }); 10 | } 11 | } -------------------------------------------------------------------------------- /commands/Utility/statistic.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import os from 'os'; 4 | import speed from 'performance-now'; 5 | 6 | import helpers from '../../middleware/service.js'; 7 | 8 | export default { 9 | views: ['statistic'], // views for menu message 10 | command: /^stat(s|(ic|is(tic|))|)$/i, // command another. 11 | description: 'Utility for display statistic', 12 | query: false, 13 | usage: '', 14 | execute: ({ replyMessage,formatDuration, formatSize }) => { 15 | return replyMessage(helpers.stats(os, speed, speed, formatDuration, formatSize)); 16 | } 17 | }; -------------------------------------------------------------------------------- /commands/index.commands.js: -------------------------------------------------------------------------------- 1 | import '../configs/global.js'; 2 | import _ from 'lodash'; 3 | import fs from 'fs'; 4 | import chalk from 'chalk'; 5 | import util from 'util'; 6 | import moment from 'moment-timezone'; 7 | import child from 'child_process'; 8 | import cron from 'node-cron'; 9 | 10 | import regex from '../configs/regex.js'; 11 | import Canvas from '../library/canvas.js'; 12 | import emojiRegex from '../library/emojiRegex.js'; 13 | import hitCommands from '../library/hitCommand.js'; 14 | import Similarity from '../library/similarity.js'; 15 | import functions from '../library/functions.js'; 16 | 17 | const delay = Baileys.delay; 18 | const jidNormalizedUser = Baileys.jidNormalizedUser; 19 | const plugins = global.plugins; 20 | const owners = global.ownerNumber; 21 | const apikeys = global.apikeys; 22 | const watermark = global.watermark; 23 | const thumbnail = global.thumbnail; 24 | const response = global.response; 25 | 26 | export default async (xcoders, x, m) => { 27 | try { 28 | const prefix = global.multiprefix ? (/^[+!#|÷?%^&./\\©^]/.test(m.body) ? m.body?.substring(0, 1) : '.') : global.nonprefix ? '' : global.prefix; 29 | const isCommand = m.body?.startsWith(prefix); 30 | const command = isCommand ? (global.nonprefix ? m.body.trimStart() : m.body?.slice(1).trim()).replace('\n', ' ').split(/ +/).shift().toLowerCase() : null; 31 | const query = isCommand ? m.body?.slice(`${prefix}${command}`.length + 1).trim() : ''; 32 | const body = typeof m.text == 'string' ? m.text : ''; 33 | const quoted = m.quoted ? m.quoted : m; 34 | const mimetype = quoted.coders ? quoted.coders.mimetype : quoted.mimetype; 35 | const isCreators = m.fromMe || owners && owners.includes(m.sender); 36 | const senderName = x.pushName || 'unknown'; 37 | const groupId = m.isGroups ? m.chat : ''; 38 | const metadataGroups = m.isGroups ? await xcoders.groupMetadata(groupId).catch((_) => null) : {}; 39 | const getParticipants = m.isGroups ? metadataGroups?.participants : []; 40 | const getAdminsGroups = m.isGroups ? getParticipants?.filter(index => index.admin !== null) : []; 41 | const isAdminsGroups = m.isGroups ? getAdminsGroups?.some(({ id }) => id === m.sender) : false; 42 | const isBotAdminsGroups = m.isGroups ? getAdminsGroups?.includes(jidNormalizedUser(xcoders.user.id)) : false; 43 | const getCurrentTime = moment.tz('Asia/Jakarta').locale('id').format('HH:mm'); 44 | const host = original ? restApi[0] : restApi[1]; 45 | 46 | const waitingMessage = async (jid) => { 47 | await xcoders.sendMessage(jid, { react: { text: '🕛', key: m.key } }); 48 | }; 49 | const errorMessage = async (jid, msg, title) => { 50 | if (title) hitCommands.addHitCommand(title, false); 51 | const serializeMessage = msg.message ? _.sample(response.error.request) : typeof msg === 'string' ? msg : _.sample(response.error.request); 52 | await xcoders.sendMessage(jid, { react: { text: '❌', key: m.key } }); 53 | await xcoders.sendMessage(jid, { text: /\*/.test(serializeMessage) ? serializeMessage : `*${serializeMessage}*`, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 54 | console.error(msg); 55 | }; 56 | const invalidUrlMessage = async (jid) => { 57 | await xcoders.sendMessage(m.chat, { react: { text: '❗', key: m.key } }); 58 | await xcoders.sendMessage(jid, { text: _.sample(response.error.url), contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 59 | }; 60 | const replyMessage = async (text, type) => { 61 | if (type == 'info') await xcoders.sendMessage(m.chat, { react: { text: '❗', key: m.key } }); 62 | if (type == 'error') await xcoders.sendMessage(m.chat, { react: { text: '❌', key: m.key } }); 63 | if (type == 'success') await xcoders.sendMessage(m.chat, { react: { text: '✅', key: m.key } }); 64 | await xcoders.sendMessage(m.chat, { text, contextInfo: { forwardingScore: 9999999, isForwarded: true } }, { quoted: x }); 65 | }; 66 | const styleMessage = (title, string) => { 67 | const content = string.replaceAll(': •', '').replace(/•/g, '*᛭').replace(/: /g, ':* '); 68 | return (title ? `\r \r \r \r \r ⋞ ${'```' + title + '```'} ⋟\n\n${content}\n\n${watermark}` : `\n\n${content}\n\n${watermark}`).trimEnd(); 69 | }; 70 | 71 | if (isCommand) { 72 | if (m.isBaileys) return; 73 | if (!global.public && !isCreators) return m.isGroups ? false : replyMessage('*_Maintenance bot, please wait..._*', 'info'); 74 | console.log(chalk.bgBlack.red.italic.bold(getCurrentTime), chalk.bold.italic.green(`[ EXEC ${command.toUpperCase()} ]`), chalk.italic.greenBright.bold('From'), chalk.bold.italic.yellow(senderName), m.isGroups ? chalk.italic.bold.greenBright('in ') + chalk.italic.bold.yellow(metadataGroups.subject) : ''); 75 | } 76 | if (!isCommand) { 77 | console.log(chalk.bgBlack.italic.red.bold(getCurrentTime), chalk.italic.red('[ MSG ]'), chalk.bold.italic.greenBright('From'), chalk.italic.bold.yellow(senderName), m.isGroups ? chalk.italic.bold.greenBright('in ') + chalk.italic.bold.yellow(metadataGroups.subject) : ''); 78 | } 79 | 80 | if (!m.isBaileys && body && isCreators) { 81 | if (body.startsWith('>')) { 82 | try { 83 | const evaling = await eval(`;(async () => { 84 | ${body.slice(2)} 85 | })();`); 86 | const utilites = util.format(evaling); 87 | return replyMessage(utilites); 88 | } catch (error) { 89 | return replyMessage(util.format(error)); 90 | } 91 | } 92 | if (body.startsWith('=>')) { 93 | try { 94 | const evaling = await eval(`;(async () => { 95 | return ${body.slice(3)} 96 | })();`); 97 | const utilites = util.format(evaling); 98 | return replyMessage(utilites); 99 | } catch (error) { 100 | return replyMessage(util.format(error)); 101 | } 102 | } 103 | if (body.startsWith('$')) { 104 | if (!isCreators) return; 105 | try { 106 | const commandExec = body.slice(2); 107 | if (!commandExec) return replyMessage('✖️ Command Execution not detected.', 'info'); 108 | child.exec(commandExec, (error, stdout) => { 109 | if (error) return replyMessage(util.format(error)); 110 | if (stdout) return replyMessage(util.format(stdout)); 111 | }); 112 | } catch (error) { 113 | return replyMessage(util.format(error)); 114 | } 115 | } 116 | if (body.startsWith('tes')) { 117 | return replyMessage('```Online ' + functions.formatDuration(process.uptime()) + '```'); 118 | } 119 | } 120 | 121 | if (isCommand) { 122 | for (let keys of Object.keys(plugins)) { 123 | const Functions = plugins[keys]; 124 | const getCommand = Functions.command; 125 | const regexp = new RegExp(getCommand); 126 | if (regexp.test(command)) { 127 | if (Functions.private && !isCreators) return replyMessage('*_Private Fitur, Tunggu owner memperbaiki fitur ini..._*', 'info'); 128 | if (Functions.query && (query.includes('--usage') || !query)) { 129 | const caption = styleMessage(Functions.description, `• Usage: ${Functions.usage.replace('%cmd%', prefix + command)}`); 130 | return replyMessage(caption, 'info'); 131 | } else { 132 | if (Functions.text && regex.url(query)) return replyMessage(`Query yang dibutuhkan command *${prefix + command}* adalah sebuah teks...`, 'info'); 133 | if (Functions.url) { 134 | if (!regex.url(query)) { 135 | return replyMessage(`Query yang dibutuhkan command *${prefix + command}* adalah sebuah url...`, 'info'); 136 | } else if (Functions.image) { 137 | if (!(await functions.checkContentType(query, 'image'))) return replyMessage('Invalid type url', 'info'); 138 | } else if (Functions.video) { 139 | if (!(await functions.checkContentType(query, 'video'))) return replyMessage('Query yang dibutuhkan adalah URL video yang valid.', 'info'); 140 | } else if (Functions.audio) { 141 | if (!(await functions.checkContentType(query, 'audio'))) return replyMessage('Query yang dibutuhkan adalah URL audio yang valid.', 'info'); 142 | } 143 | } 144 | } 145 | if (Functions.owner && !isCreators) return replyMessage(response.isCreator); 146 | if (Functions.onlyGroup && !m.isGroups) return replyMessage(`Fitur *${command}* hanya bisa digunakan didalam group`, 'info'); 147 | if (Functions.media && !mimetype) return replyMessage(`Reply atau kirim media image atau video dan caption ${prefix + command}`, 'info'); 148 | if (!allCommands.includes(command)) allCommands.push(command); 149 | await xcoders.readMessages([m.key]); 150 | const tools = { command, xcoders, m, x, prefix, owners, senderName, thumbnail, waitingMessage, query, replyMessage, styleMessage, invalidUrlMessage, errorMessage, response, isCreators, isBotAdminsGroups, isAdminsGroups, getParticipants, metadataGroups, apikeys, mimetype, quoted, regex, delay, host }; 151 | return Functions.execute(Object.assign(tools, { ...functions, emojiRegex, canvas: Canvas, addHitCommand: hitCommands.addHitCommand })); 152 | } 153 | } 154 | 155 | if (!m.isGroups) { 156 | const checkCommand = Similarity.exec(allCommands, command, 0.4); 157 | if (!checkCommand || checkCommand.length === 0) { 158 | return replyMessage('*_perintah tidak ada yang cocok, coba periksa kembali command anda!_*', 'error'); 159 | } else { 160 | const resultCommand = checkCommand.map((obj) => { 161 | return `➽ *${prefix + obj.index} ⋞ ${obj.score.toFixed(2)}% ⋟*\n`; 162 | }).join(''); 163 | return replyMessage('```Mungkin command yang anda maksud adalah:\n\n```' + resultCommand.trim(), 'info'); 164 | } 165 | } 166 | } 167 | } catch (error) { 168 | console.error(chalk.redBright(`[ ERROR ] ${moment().format('HH:mm:ss')}`), error); 169 | } 170 | }; 171 | 172 | cron.schedule('1 * * * * *', () => { 173 | fs.writeFileSync('./database/allCommands.json', JSON.stringify(global.allCommands, null, 2)); 174 | fs.writeFileSync('./database/hit.json', JSON.stringify(global.hitCommand, null, 2)); 175 | }, { 176 | scheduled: true, 177 | timezone: 'Asia/Jakarta' 178 | }); 179 | 180 | const files = global.absoluteUrl(import.meta.url); 181 | fs.watchFile(files, () => { 182 | fs.unwatchFile(files); 183 | logger.info('Update index.commands.js'); 184 | import(`${files}?update=${Date.now()}`); 185 | }); -------------------------------------------------------------------------------- /configs/global.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs'; 2 | import path from 'path'; 3 | import chalk from 'chalk'; 4 | import { platform } from 'process'; 5 | import { fileURLToPath } from 'url'; 6 | 7 | global.restApi = ['https://api-xcoders.site', 'https://api-fxc7.cloud.okteto.net']; 8 | global.ownerNumber = ['6285956396417@s.whatsapp.net', '6285855030554@s.whatsapp.net']; 9 | global.absoluteUrl = (pathFiles) => { 10 | if (platform !== 'android') { 11 | const updateFile = fileURLToPath(import.meta.url).toString(); 12 | return updateFile; 13 | } else { 14 | return fileURLToPath(pathFiles); 15 | } 16 | }; 17 | global.Baileys = (await import('@whiskeysockets/baileys')).default; 18 | global.axios = (await import('axios')).default; 19 | global.cheerio = (await import('cheerio')).default; 20 | global.PORT = process.env.PORT || 8000; 21 | global.prefix = '!'; 22 | global.apikeys = 'YOUR APIKEYS'; 23 | global.multiprefix = true; 24 | global.nonprefix = false; 25 | global.public = true; 26 | global.original = false; 27 | global.qrcode = null; 28 | global.watermark = "\n\t_*乂 bot WhatsApp - xcoders team's*_"; 29 | global.packname = 'Created By'; 30 | global.authorname = 'xcoders bot'; 31 | global.sizeSession = null; 32 | global.commander = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'database', 'commands.json'))); 33 | global.Commands = {}; 34 | global.headersCommands = []; 35 | global.allCommands = []; 36 | global.plugins = {}; 37 | global.hitCommand = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'database', 'hit.json'))); 38 | global.thumbnail = fs.readFileSync(path.join(process.cwd(), 'images', 'thumbnail.png')); 39 | global.icon = fs.readFileSync(path.join(process.cwd(), 'images', 'icon.png')); 40 | global.userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36'; 41 | global.response = Object.freeze({ 42 | isCreator: '*perintah ini hanya untuk owner...*', 43 | isGroup: '*Perintah ini hanya untuk di Group...*', 44 | isBotAdmin: '*perintah ini dapat digunakan jika bot menjadi admin group....*', 45 | isAdmin: '*Perintah ini hanya dapat digunakan oleh admin grup...*', 46 | success: '*Success...*', 47 | error: { 48 | request: ['*Oops, Your request error \'_\'*', '*Maaf Terjadi Kesalahan*', '*Terjadi Kesalahan Pada Server*', '*Error kak*', '*Maaf kak Error*'], 49 | url: ['*Invalid Input url*', '*invalid url*', '*link tidak valid*', '*link yang kamu masukkan tidak valid*'] 50 | }, 51 | process: ['*Sek proses...*', '*Sedang Diproses...*', '*Tunggu Sebentar...*', '*Sabar Kak...*', '*Prosess...*'] 52 | }); 53 | 54 | const files = global.absoluteUrl(import.meta.url); 55 | fs.watchFile(files, () => { 56 | fs.unwatchFile(files); 57 | console.log(chalk.redBright('Update global.js')); 58 | import(`${files}?update=${Date.now()}`); 59 | }); -------------------------------------------------------------------------------- /configs/regex.js: -------------------------------------------------------------------------------- 1 | const extractInstagramStories = (url) => { 2 | const regex = /https:\/\/(.+)?instagram\.com\/stories\/.+/ 3 | const matchedUrl = url.match(regex)[0]; 4 | const cleanUrl = matchedUrl.split('?')[0].replace(/\/$/, ''); 5 | const [_, username, storyID] = cleanUrl.split('/'); 6 | return { username, storyID }; 7 | }; 8 | 9 | const media = (url) => [/^https?:\/\/t\.me\/addstickers\/[a-zA-Z0-9_]+$/i, /https?:\/\/drive\.google\.com\/file\/d\/[a-zA-Z0-9_-]+\//i, /https?:\/\/(www\.|m\.|)imdb\.com\/video\/vi\d+/i, /https?:\/\/store\.line\.me\/stickershop\/product\/\d+/i, /https?:\/\/([^\s:/?#]+\.?)+(\/[^\s]*)?/i, /https?:\/\/sfile\.mobi\/[A-Za-z0-9]+/i, /https?:\/\/www\.capcut\.com\/(watch|template-detail)\/\d+\?/i, /https?:\/\/(|www\.)cocofun\.com\/share\/post\//i, /https?:\/\/(|www\.)likee\.video\/@/i, /https?:\/\/(www\.|m\.|)mediafire\.com\/file\/[a-zA-Z0-9]{15}(|\/[a-zA-Z0-9-_/%.]+)/i, /https?:\/\/drive\.+google\.+com\/file\/[a-zA-Z0-9-_./]+/i, /https?:\/\/(?:www\.|)xnxx\.com\/[a-zA-Z0-9-/_]+/i, /https?:\/\/(?:www\.|)xvideos\.com\/[a-z0-9/._-]+/i, /https?:\/\/store\.+line\.+me\/stickershop\/product\/[0-9]{1,8}/i, /https?:\/\/(?:m\.|www\.|)imdb\.com\/[a-zA-Z0-9-_\/?=&]+/i, /https?:\/\/ifunny\.co\/video\/[a-zA-Z0-9-_]+/i, /https?:\/\/(www\.|m\.|)soundcloud\.com\/[a-zA-Z0-9-_./]+/i, /https?:\/\/(www\.|)instagram\.com\/tv\/[A-z0-9-_]{1,11}/i, /https?:\/\/(?:(web\.|www\.|m\.|mobile\.|)youtube\.com\/\S*(?:(?:\/e(?:mbed))?\/|watch\?(?:\S*?&?v\=))|youtu\.be\/)([a-zA-Z0-9_-]{6,11})/i, /https?:\/\/www\.icocofun\.com\/[a-zA-Z0-9-_\/=?&]+/i, /https?:\/\/(www\.|mobile\.|id\.|)twitter\.com\/([a-zA-Z0-9_]{1,40}|i)\/(status|video)\/[0-9]*/i, /https?:\/\/(www\.|m\.|)instagram\.com\/(p|reel|([a-zA-Z0-9-_.]+\/(p|reel)))\/[a-zA-Z0-9]{1,11}/i, /https?:\/\/(www|pin|id)\.(it|pinterest\.co(m|\.[a-z]{1,2}))\S+/i, /https?:\/\/(web\.|www\.|m\.|)?(facebook|fb)\.(com|watch|gg)\S+/i, /https?:\/\/.+\.tiktok\.com\/.+/i].some(regex => regex.test(url)); 10 | 11 | const url = (url) => /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i.test(url); 12 | 13 | export default { 14 | url, 15 | media, 16 | extractInstagramStories 17 | }; -------------------------------------------------------------------------------- /database/allCommands.json: -------------------------------------------------------------------------------- 1 | [ 2 | "welcome", 3 | "s", 4 | "menu", 5 | "tt", 6 | "tomp3", 7 | "bass", 8 | "extract", 9 | "sticker", 10 | "take", 11 | "toimage", 12 | "igdl", 13 | "instastory", 14 | "ytmp3", 15 | "ytshort", 16 | "ytmp4", 17 | "apkdl", 18 | "capcut", 19 | "fbdl", 20 | "fbreels", 21 | "gdrive", 22 | "ifunny", 23 | "imdb", 24 | "likee", 25 | "mediafire", 26 | "pinterest", 27 | "sfile", 28 | "soundcloud", 29 | "stele", 30 | "tiktok", 31 | "twitter", 32 | "xnxx", 33 | "xvideosdl", 34 | "affect", 35 | "attp", 36 | "biden", 37 | "caution", 38 | "communism", 39 | "drake", 40 | "emojimix", 41 | "facts", 42 | "gura", 43 | "kannagen", 44 | "nulis", 45 | "removebg", 46 | "rip", 47 | "ssmaps", 48 | "ssweb", 49 | "tahta", 50 | "ttp", 51 | "tts", 52 | "kusonime", 53 | "sendaudio", 54 | "delete", 55 | "quoted", 56 | "sendvideo", 57 | "backup", 58 | "bcmember", 59 | "get", 60 | "restart", 61 | "change", 62 | "alquran", 63 | "asmaulhusna", 64 | "bible", 65 | "hadist", 66 | "kisahnabi", 67 | "surah", 68 | "tafsir", 69 | "ghstalk", 70 | "igstalk", 71 | "ttstalk", 72 | "twitstalk", 73 | "owners", 74 | "allfitur", 75 | "mostcmd", 76 | "source", 77 | "statistic", 78 | "ig", 79 | "tolol", 80 | "ytplay", 81 | "smeme", 82 | "play", 83 | "help", 84 | "toimg", 85 | "owner", 86 | "skannagen", 87 | "fb", 88 | "quotes", 89 | "badut", 90 | "badut2", 91 | "badut3", 92 | "chat", 93 | "schat", 94 | "pindl", 95 | "fbreel", 96 | "quran" 97 | ] -------------------------------------------------------------------------------- /database/commands.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /database/hit.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /database/pdfSizes.json: -------------------------------------------------------------------------------- 1 | { 2 | "4A0": [ 3 | 4767.87, 4 | 6740.79 5 | ], 6 | "2A0": [ 7 | 3370.39, 8 | 4767.87 9 | ], 10 | "A0": [ 11 | 2383.94, 12 | 3370.39 13 | ], 14 | "A1": [ 15 | 1683.78, 16 | 2383.94 17 | ], 18 | "A2": [ 19 | 1190.55, 20 | 1683.78 21 | ], 22 | "A3": [ 23 | 841.89, 24 | 1190.55 25 | ], 26 | "A4": [ 27 | 595.28, 28 | 841.89 29 | ], 30 | "A5": [ 31 | 419.53, 32 | 595.28 33 | ], 34 | "A6": [ 35 | 297.64, 36 | 419.53 37 | ], 38 | "A7": [ 39 | 209.76, 40 | 297.64 41 | ], 42 | "A8": [ 43 | 147.4, 44 | 209.76 45 | ], 46 | "A9": [ 47 | 104.88, 48 | 147.4 49 | ], 50 | "A10": [ 51 | 73.7, 52 | 104.88 53 | ], 54 | "B0": [ 55 | 2834.65, 56 | 4008.19 57 | ], 58 | "B1": [ 59 | 2004.09, 60 | 2834.65 61 | ], 62 | "B2": [ 63 | 1417.32, 64 | 2004.09 65 | ], 66 | "B3": [ 67 | 1000.63, 68 | 1417.32 69 | ], 70 | "B4": [ 71 | 708.66, 72 | 1000.63 73 | ], 74 | "B5": [ 75 | 498.9, 76 | 708.66 77 | ], 78 | "B6": [ 79 | 354.33, 80 | 498.9 81 | ], 82 | "B7": [ 83 | 249.45, 84 | 354.33 85 | ], 86 | "B8": [ 87 | 175.75, 88 | 249.45 89 | ], 90 | "B9": [ 91 | 124.72, 92 | 175.75 93 | ], 94 | "B10": [ 95 | 87.87, 96 | 124.72 97 | ], 98 | "C0": [ 99 | 2599.37, 100 | 3676.54 101 | ], 102 | "C1": [ 103 | 1836.85, 104 | 2599.37 105 | ], 106 | "C2": [ 107 | 1298.27, 108 | 1836.85 109 | ], 110 | "C3": [ 111 | 918.43, 112 | 1298.27 113 | ], 114 | "C4": [ 115 | 649.13, 116 | 918.43 117 | ], 118 | "C5": [ 119 | 459.21, 120 | 649.13 121 | ], 122 | "C6": [ 123 | 323.15, 124 | 459.21 125 | ], 126 | "C7": [ 127 | 229.61, 128 | 323.15 129 | ], 130 | "C8": [ 131 | 161.57, 132 | 229.61 133 | ], 134 | "C9": [ 135 | 113.39, 136 | 161.57 137 | ], 138 | "C10": [ 139 | 79.37, 140 | 113.39 141 | ], 142 | "RA0": [ 143 | 2437.8, 144 | 3458.27 145 | ], 146 | "RA1": [ 147 | 1729.13, 148 | 2437.8 149 | ], 150 | "RA2": [ 151 | 1218.9, 152 | 1729.13 153 | ], 154 | "RA3": [ 155 | 864.57, 156 | 1218.9 157 | ], 158 | "RA4": [ 159 | 609.45, 160 | 864.57 161 | ], 162 | "SRA0": [ 163 | 2551.18, 164 | 3628.35 165 | ], 166 | "SRA1": [ 167 | 1814.17, 168 | 2551.18 169 | ], 170 | "SRA2": [ 171 | 1275.59, 172 | 1814.17 173 | ], 174 | "SRA3": [ 175 | 907.09, 176 | 1275.59 177 | ], 178 | "SRA4": [ 179 | 637.8, 180 | 907.09 181 | ], 182 | "EXECUTIVE": [ 183 | 521.86, 184 | 756.0 185 | ], 186 | "FOLIO": [ 187 | 612.0, 188 | 936.0 189 | ], 190 | "LEGAL": [ 191 | 612.0, 192 | 1008.0 193 | ], 194 | "LETTER": [ 195 | 612.0, 196 | 792.0 197 | ], 198 | "TABLOID": [ 199 | 792.0, 200 | 1224.0 201 | ] 202 | } -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.9" 2 | services: 3 | bot: 4 | build: . 5 | ports: 6 | - "8008:8080" -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/images/icon.png -------------------------------------------------------------------------------- /images/sertifikat.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/images/sertifikat.pdf -------------------------------------------------------------------------------- /images/thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/images/thumbnail.png -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | // External modules 2 | import _ from 'lodash'; 3 | import pino from 'pino'; 4 | import https from 'https'; 5 | import fs from 'fs'; 6 | import chalk from 'chalk'; 7 | import yargs from 'yargs'; 8 | import ffmpeg from 'fluent-ffmpeg'; 9 | import ffmpegInstaller from '@ffmpeg-installer/ffmpeg'; 10 | 11 | ffmpeg.setFfmpegPath(ffmpegInstaller.path); 12 | 13 | const { 14 | default: makeWASocket, 15 | delay, 16 | proto, 17 | WAProto, 18 | getDevice, 19 | jidDecode, 20 | useMultiFileAuthState, 21 | fetchLatestBaileysVersion, 22 | DisconnectReason, 23 | makeInMemoryStore, 24 | prepareWAMessageMedia, 25 | generateWAMessageFromContent, 26 | makeCacheableSignalKeyStore 27 | } = Baileys; 28 | 29 | import regex from './configs/regex.js'; 30 | import logger from './middleware/console.js'; 31 | import serializeMessage from './middleware/serialize.js'; 32 | import functions from './library/functions.js'; 33 | import pluginsCommand from './commands/index.commands.js'; 34 | import loadedPlugins from './loadedCommands.js'; 35 | 36 | const starting = async () => { 37 | const Logger = pino({}); 38 | Logger.level = 'silent'; 39 | const { state, saveCreds } = await useMultiFileAuthState('session'); 40 | const { version } = await fetchLatestBaileysVersion(); 41 | const store = makeInMemoryStore({ 42 | logger: Logger 43 | }); 44 | 45 | const xcoders = makeWASocket({ 46 | version: version, 47 | logger: Logger, 48 | mobile: process.argv.includes('--mobile'), 49 | auth: { 50 | creds: state.creds, 51 | keys: makeCacheableSignalKeyStore(state.keys, Logger) 52 | }, 53 | generateHighQualityLinkPreview: true, 54 | printQRInTerminal: true, 55 | markOnlineOnConnect: false, 56 | options: { 57 | httpsAgent: new https.Agent({ 58 | rejectUnauthorized: false 59 | }) 60 | }, 61 | patchMessageBeforeSending: (message) => { 62 | const requiresPatch = !!(message.buttonsMessage || message.templateMessage || message.listMessage); 63 | if (requiresPatch) message = { viewOnceMessage: { message: { messageContextInfo: { deviceListMetadataVersion: 2, deviceListMetadata: {} }, ...message } } }; 64 | return message; 65 | }, 66 | getMessage: async (key) => { 67 | if (store) { 68 | const msg = await store.loadMessage(key.remoteJid, key.id); 69 | return msg?.message || undefined; 70 | } 71 | return proto.Message.fromObject({}); 72 | } 73 | }); 74 | 75 | xcoders.ev.on('creds.update', saveCreds); 76 | store.bind(xcoders.ev); 77 | 78 | xcoders.ev.on('connection.update', async ({ qr, connection, lastDisconnect, receivedPendingNotifications }) => { 79 | if (connection === 'close') { 80 | const statusCode = lastDisconnect && lastDisconnect.error && lastDisconnect.error.output && lastDisconnect.error.output.statusCode; 81 | if (statusCode === DisconnectReason.loggedOut) { 82 | logger.warn('status server loggedOut, server stopped'); 83 | starting(); 84 | } 85 | if (statusCode === (DisconnectReason.connectionClosed || DisconnectReason.connectionLost)) { 86 | logger.warn('Connection Close or Lost, reconnecting server...'); 87 | starting(); 88 | } 89 | if (statusCode === DisconnectReason.connectionReplaced) { 90 | logger.error('Connection Replaced, server stopped.'); 91 | process.exit(); 92 | } 93 | if (statusCode === DisconnectReason.restartRequired) { 94 | logger.info('Restart Server required, restart Server.'); 95 | starting(); 96 | } 97 | if (statusCode === DisconnectReason.timedOut) { 98 | logger.warn('Time Out, starting server..'); 99 | starting(); 100 | } 101 | } else if (connection === 'open') { 102 | logger.success(chalk.green('[ xcoders ] Connected...')); 103 | global.qrcode = null; 104 | } else if (qr) { 105 | global.qrcode = qr; 106 | } 107 | if (receivedPendingNotifications) logger.info('Waiting new message...\n'); 108 | }); 109 | 110 | xcoders.ev.on('messages.upsert', async ({ type, messages }) => { 111 | try { 112 | if (!type == 'notify') return; 113 | if (!messages) return; 114 | const x = messages[0]; 115 | const m = await serializeMessage(xcoders, x, functions); 116 | for (let message of messages) { 117 | if (message.key && message.key.remoteJid == 'status@broadcast') { 118 | if (message.message?.protocolMessage) return; 119 | logger.info(`Read status ${message.pushName}`); 120 | await xcoders.readMessages([message.key]); 121 | } 122 | } 123 | await pluginsCommand(xcoders, x, m); 124 | } catch (error) { 125 | throw error; 126 | } 127 | }); 128 | 129 | xcoders.ev.on('messaging-history.set', ({ chats, contacts, messages, isLatest }) => { 130 | logger.info(`recv ${chats.length} chats, ${contacts.length} contacts, ${messages.length} msgs (is latest: ${isLatest})`); 131 | }); 132 | 133 | xcoders.ev.on('close', () => starting()); 134 | global.store = store; 135 | 136 | xcoders.sendFileFromUrl = async (jid, url, caption = '', quoted = '', options = {}) => { 137 | try { 138 | if (!regex.url(url)) return xcoders.sendMessage(jid, { text: '*_Error Downloading files..._*' }, { quoted }); 139 | const mentionedJid = options.mentionedJid ? options.mentionedJid : []; 140 | const { result, mimetype, ext, size } = await functions.getBuffer(url, { optional: true }); 141 | if (mimetype == 'image/gif' || options.gif) { 142 | await xcoders.sendMessage(jid, { image: result, caption, mentionedJid, jpegThumbnail: icon, gifPlayback: true, gifAttribution: 1, ...options }, { quoted }); 143 | } else if (/video/.test(mimetype)) { 144 | const type = size >= 50000000 ? 'document' : 'video'; 145 | await xcoders.sendMessage(jid, { [type]: result, caption, mentionedJid, fileName: functions.getRandom(ext), mimetype: mimetype, jpegThumbnail: icon, ...options }, { quoted }); 146 | } else if (/image/.test(mimetype)) { 147 | await xcoders.sendMessage(jid, { image: result, caption, mentionedJid, jpegThumbnail: icon, ...options }, { quoted }); 148 | } else if (/audio/.test(mimetype)) { 149 | await xcoders.sendMessage(jid, { audio: result, caption, mentionedJid, jpegThumbnail: icon, ...options }, { quoted }); 150 | } else if (!/video|image|audio/.test(mimetype)) { 151 | await xcoders.sendMessage(jid, { document: result, caption, mimetype: mimetype, fileName: `${options.name}.${ext}`, mentionedJid, jpegThumbnail: icon, ...options }, { quoted }); 152 | } 153 | } catch (error) { 154 | throw error; 155 | } 156 | }; 157 | 158 | xcoders.sendAudioFromUrl = async (jid, url, quoted, options = {}) => { 159 | try { 160 | if (!regex.url(url)) return xcoders.sendMessage(jid, { text: '*_Error Downloading audio files..._*' }, { quoted }); 161 | const mimetype = getDevice(quoted.id) == 'ios' ? 'audio/mpeg' : 'audio/mp4'; 162 | const type = options.type !== 'audio' ? 'documentMessage' : 'audioMessage'; 163 | const option = options.type !== 'audio' ? { externalAdReply: { title: options.title || options.fileName, body: options.body || `${global.packname} ${global.authorname}`, mediaType: 1, renderLargerThumbnail: true, showAdAttribution: true, thumbnail: options.thumbnail || global.icon, sourceUrl: options.source || global.host, mediaUrl: options.source || global.host } } : {}; 164 | const prepareMessage = (buffer) => prepareWAMessageMedia({ [options.type || 'document']: buffer, mimetype, fileName: options.fileName || functions.getRandom('.mp3'), contextInfo: { ...option, forwardingScore: 9999999, isForwarded: true } }, { upload: xcoders.waUploadToServer }); 165 | if (options.stream) { 166 | const fileName = options.fileName || functions.getRandom('.mp3'); 167 | const path_files = `./temp/${fileName}`; 168 | const readable = fs.createWriteStream(path_files); 169 | try { 170 | const response = await axios.get(url, { 171 | responseType: 'stream' 172 | }); 173 | const stream = response.data.pipe(readable); 174 | stream.on('error', async (error) => { 175 | if (fs.existsSync(path_files)) await fs.promises.unlink(path_files); 176 | console.error(error); 177 | return xcoders.sendMessage(jid, { text: '*_Error Download files..._*' }, { quoted }); 178 | }); 179 | stream.on('finish', async () => { 180 | try { 181 | const buffer = await fs.promises.readFile(path_files); 182 | if (fs.existsSync(path_files)) await fs.promises.unlink(path_files); 183 | const message = await prepareMessage(buffer); 184 | const media = generateWAMessageFromContent(jid, { [type]: message[type] }, { quoted }); 185 | return xcoders.relayMessage(jid, media.message, { messageId: media.key.id }); 186 | } catch (error) { 187 | console.error(error); 188 | return xcoders.sendMessage(jid, { text: '*_Error Reading files..._*' }, { quoted }); 189 | } 190 | }); 191 | } catch (error) { 192 | console.error(error); 193 | return xcoders.sendMessage(jid, { text: '*_Error Downloading files..._*' }, { quoted }); 194 | } 195 | } else { 196 | const buffer = await fetch(url).then(response => response.arrayBuffer()).catch(async (error) => { 197 | console.error(error); 198 | await xcoders.sendMessage(jid, { text: '*_Error..._*' }, { quoted }); 199 | }); 200 | const result = functions.convertToBuffer(buffer); 201 | await delay(1000); 202 | const message = await prepareMessage(result); 203 | const media = generateWAMessageFromContent(jid, { [type]: message[type] }, { quoted }); 204 | return xcoders.relayMessage(jid, media.message, { messageId: media.key.id }); 205 | } 206 | } catch (error) { 207 | throw error; 208 | } 209 | }; 210 | 211 | xcoders.requestPaymentMenu = async (jid, caption, options = {}) => { 212 | const generateWA = await generateWAMessageFromContent(jid, { requestPaymentMessage: { currencyCodeIso4217: 'USD', amount1000: '9999999999', requestFrom: options.sender, noteMessage: { extendedTextMessage: { text: '\n' + caption + '\n\n' + watermark + '\n\n', contextInfo: { mentionedJid: options.sender ? [options.sender] : [] } } }, expiryTimestamp: '0', amount: { value: '125', offset: '100', currencyCode: 'USD' } } }, { quoted: options.quoted }); 213 | return xcoders.relayMessage(jid, generateWA.message, { messageId: generateWA.key.id }); 214 | }; 215 | 216 | xcoders.sendGroupV4Invite = async (jid, participant, inviteCode, inviteExpiration, groupName, jpegThumbnail, caption, options = {}) => { 217 | const messageProto = await WAProto.Message.fromObject({ 218 | groupInviteMessage: WAProto.GroupInviteMessage.fromObject({ inviteCode, inviteExpiration: inviteExpiration ? parseInt(inviteExpiration) : + new Date(new Date + (3 * 86400000)), groupJid: jid, groupName: groupName ? groupName : (await xcoders.groupMetadata(jid)).subject, jpegThumbnail: jpegThumbnail ? await functions.getBuffer(jpegThumbnail) : '', caption }) 219 | }); 220 | const generate = await generateWAMessageFromContent(participant, messageProto, ...options); 221 | return xcoders.relayMessage(participant, generate.message, { messageId: generate.key.id }); 222 | }; 223 | 224 | xcoders.decodeJid = (jid) => { 225 | if (!jid && !/:\d+@/gi.test(jid)) return jid; 226 | const decode = jidDecode(jid) || {}; 227 | return decode.user && decode.server && decode.user + '@' + decode.server || jid; 228 | }; 229 | 230 | xcoders.serializeMessages = async (forced) => { 231 | return serializeMessage(xcoders, forced); 232 | }; 233 | return xcoders; 234 | } 235 | 236 | (async () => { 237 | try { 238 | const options = yargs(process.argv.slice(2)).exitProcess(false).parse(); 239 | global.options = options; 240 | global.logger = logger; 241 | 242 | await loadedPlugins(); 243 | await starting(); 244 | 245 | if (options.server) { 246 | await import('./server.js'); 247 | } 248 | } catch (error) { 249 | throw error; 250 | } 251 | 252 | })(); 253 | 254 | const files = global.absoluteUrl(import.meta.url); 255 | fs.watchFile(files, () => { 256 | fs.unwatchFile(files); 257 | console.log(chalk.redBright('Update index.js')); 258 | import(`${files}?update=${Date.now()}`); 259 | }); -------------------------------------------------------------------------------- /library/canvas.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import _ from 'lodash'; 4 | import * as canvasAsync from 'canvas'; 5 | import * as jimp from 'jimp'; 6 | import * as path from 'path'; 7 | 8 | class CustomCanvas { 9 | constructor() { 10 | // font properties 11 | this.pathFonts = path.join(process.cwd(), 'storage', 'fonts', 'Breaking.ttf'); 12 | // image properties 13 | this.pathImages = path.join(process.cwd(), 'storage', 'images'); 14 | this.imageTransparents = path.join(this.pathImages, 'transparent.png'); 15 | this.imageBackground = path.join(this.pathImages, 'background.png'); 16 | this.imageVoid = path.join(this.pathImages, 'profile_void.png'); 17 | this.imageStandard = path.join(this.pathImages, 'standard.png'); 18 | } 19 | 20 | createCanvas(width, height) { 21 | return canvasAsync.createCanvas(width, height); 22 | } 23 | 24 | registerFonts(fontPath, options) { 25 | canvasAsync.registerFont(fontPath, options); 26 | } 27 | 28 | async loadImages(imagePath) { 29 | return canvasAsync.loadImage(imagePath); 30 | } 31 | 32 | randomGradientImages() { 33 | const imageColdsky = path.join(this.pathImages, 'coldsky.png'); 34 | const imagePeakblue = path.join(this.pathImages, 'peakblue.png'); 35 | const imagePinkman = path.join(this.pathImages, 'pinkman.png'); 36 | const imageAqua = path.join(this.pathImages, 'aqua.png'); 37 | const imaageDarkness = path.join(this.pathImages, 'darkness.png'); 38 | const imageAngel = path.join(this.pathImages, 'angel.png'); 39 | const imageBackground = path.join(this.pathImages, 'background.png'); 40 | const arrayImages = [imageColdsky, imagePeakblue, imagePinkman, imageAqua, imaageDarkness, imageAngel, imageBackground]; 41 | return _.sample(arrayImages); 42 | } 43 | 44 | calculateFontSize(text, canvasWidth) { 45 | let fontSize = 100; 46 | const maxWidth = canvasWidth * 0.9; 47 | while (true) { 48 | const textWidth = this.calculateTextWidth(text, fontSize); 49 | if (textWidth <= maxWidth) { 50 | break; 51 | } 52 | fontSize -= 5; 53 | } 54 | return fontSize; 55 | } 56 | 57 | calculateTextWidth(text, fontSize) { 58 | const canvas = this.createCanvas(1, 1); 59 | const ctx = canvas.getContext('2d'); 60 | ctx.font = `bold ${fontSize}px Breaking`; 61 | const textMetrics = ctx.measureText(text); 62 | return textMetrics.width; 63 | } 64 | 65 | async create(text, image = null) { 66 | const link = _.sample(['invisible', 'standard', 'gradient']); 67 | if (link === 'invisible') { 68 | image = this.imageTransparents; 69 | } else if (link === 'standard') { 70 | image = this.imageStandard; 71 | } else if (link === 'gradient') { 72 | image = this.randomGradientImages(); 73 | } 74 | const background = await jimp.read(image); 75 | background.scale(1.25); 76 | background.blur(10); 77 | const resultBlur = await background.getBufferAsync('image/png'); 78 | const backgroundImage = await this.loadImages(resultBlur); 79 | const backgroundWidth = backgroundImage.width; 80 | const backgroundHeight = backgroundImage.height; 81 | 82 | const canvas = this.createCanvas(backgroundWidth, backgroundHeight); 83 | const ctx = canvas.getContext('2d'); 84 | 85 | ctx.drawImage(backgroundImage, 0, 0, backgroundWidth, backgroundHeight); 86 | 87 | this.registerFonts(this.pathFonts, { family: 'Breaking' }); 88 | const fontSize = this.calculateFontSize(text, backgroundWidth); 89 | ctx.font = `bold ${fontSize}px Breaking`; 90 | ctx.fillStyle = '#FFFFFF'; 91 | ctx.textBaseline = 'middle'; 92 | ctx.textAlign = 'center'; 93 | 94 | const textX = backgroundWidth / 2; 95 | const textY = backgroundHeight / 2; 96 | ctx.fillText(text, textX, textY); 97 | 98 | const watermarkFontSize = 13; 99 | const watermarkTextX = backgroundWidth / 2.1; 100 | const watermarkTextY = backgroundHeight - 44; // Adjust the vertical position as needed 101 | ctx.font = `bold ${watermarkFontSize}px Helvetica`; 102 | ctx.fillStyle = '#FFFFFF'; // Adjust the color and transparency as needed 103 | ctx.fillText(global.watermark.replace(/[*_乂]/g, ''), watermarkTextX, watermarkTextY); 104 | 105 | return canvas.toBuffer(); 106 | } 107 | } 108 | 109 | export default new CustomCanvas(); -------------------------------------------------------------------------------- /library/emojiRegex.js: -------------------------------------------------------------------------------- 1 | export default () => { 2 | // https://mths.be/emoji 3 | return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g; 4 | }; -------------------------------------------------------------------------------- /library/hitCommand.js: -------------------------------------------------------------------------------- 1 | import moment from "moment-timezone"; 2 | import functions from '../library/functions.js'; 3 | 4 | class HitCommandTracker { 5 | 6 | get hitCommand() { 7 | return global.hitCommand; 8 | } 9 | 10 | capitalize(str) { 11 | return functions.capitalize(str); 12 | } 13 | 14 | parseCount(number) { 15 | return `${(number ? number.toString() : '0').replace(/\B(?=(\d{3})+(?!\d))/g, '.')}`; 16 | }; 17 | 18 | monospace(str) { 19 | return '```' + str + '```'; 20 | } 21 | 22 | addHitCommand(title, boolean) { 23 | const key = boolean ? 'done' : 'fail'; 24 | const Commands = this?.hitCommand || global.hitCommand; 25 | if (Commands.hasOwnProperty(title)) { 26 | Commands[title].count += 1; 27 | Commands[title][key] += 1; 28 | Commands[title].timestamp = Date.now(); 29 | } else { 30 | Commands[title] = { count: 1, fail: 0, done: 0, timestamp: Date.now() }; 31 | Commands[title][key] += 1; 32 | } 33 | } 34 | 35 | getHitCommand(title) { 36 | if (this.hitCommand[title]) { 37 | return `• ${title}: ${this.hitCommand[title].count} Hit`; 38 | } else { 39 | return null; 40 | } 41 | } 42 | 43 | getSmallHitCommand() { 44 | const keys = Object.keys(this.hitCommand); 45 | if (keys.length < 1) return null; 46 | const minCount = Math.min(...keys.map(key => this.hitCommand[key].count)); 47 | const smallHitCommands = keys.filter(key => this.hitCommand[key].count === minCount); 48 | return smallHitCommands.map(command => `• ${command}: ${this.hitCommand[command].count} Hit`).join('\n'); 49 | } 50 | 51 | getHighHitCommand() { 52 | const keys = Object.keys(this.hitCommand); 53 | if (keys.length < 1) return null; 54 | const maxCount = Math.max(...keys.map(key => this.hitCommand[key].count)); 55 | const highHitCommands = keys.filter(key => this.hitCommand[key].count === maxCount); 56 | return highHitCommands.map(command => `• ${command}: ${this.hitCommand[command].count} Hit`).join('\n'); 57 | } 58 | 59 | shortedCommands(dataObj) { 60 | const data = dataObj || this.hitCommand; 61 | const sortedCommands = Object.keys(data).sort((a, b) => { 62 | if (data[b].count === data[a].count) { 63 | return data[b].done - data[a].done; 64 | } 65 | return data[b].count - data[a].count; 66 | }); 67 | return sortedCommands.map(command => { 68 | let { count, done, fail, timestamp } = data[command]; 69 | if (!timestamp) { 70 | data[command].timestamp = Date.now(); 71 | timestamp = Date.now(); 72 | } 73 | const update = moment(timestamp).fromNow(); 74 | return `⬟ ${this.monospace(command)}\n\t⊳ ${this.monospace('Done:')} *${this.parseCount(done)} Count*\n\t⊳ ${this.monospace('Fail:')} *${this.parseCount(fail)} Count*\n\t⊳ ${this.monospace('Total:')} *${this.parseCount(count)} Hit*\n\t⊳ ${this.monospace('Make in:')} *${this.capitalize(update)}*\n\n`; 75 | }).join(''); 76 | } 77 | 78 | popularCommand(count = 1, style, styleClass) { 79 | const keys = Object.keys(this.hitCommand); 80 | if (keys.length < 1) return ''; 81 | const sortedCommands = keys.sort((a, b) => { 82 | if (this.hitCommand[b].count === this.hitCommand[a].count) { 83 | return this.hitCommand[b].done - this.hitCommand[a].done; 84 | } 85 | return this.hitCommand[b].count - this.hitCommand[a].count; 86 | }).slice(0, count); 87 | return sortedCommands.map(command => { 88 | let { count, done, fail, timestamp } = this.hitCommand[command]; 89 | if (!timestamp) { 90 | this.hitCommand[command].timestamp = Date.now(); 91 | timestamp = Date.now(); 92 | } 93 | const update = moment(timestamp).fromNow(); 94 | return `${style}⁂ ${this.monospace(command)}\n${styleClass}• Done: *${this.parseCount(done)} Count*\n${styleClass}• Fail: *${this.parseCount(fail)} Count*\n${styleClass}• Total: *${this.parseCount(count)} Hit*\n${styleClass}• Make in: *${this.capitalize(update)}*\n\n`; 95 | }).join(''); 96 | } 97 | } 98 | 99 | export default new HitCommandTracker(); -------------------------------------------------------------------------------- /library/parseResult.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function capitalize(text) { 4 | return text.replace(/[^a-zA-Z0-9]/g, ' ').replace(/([a-z])([A-Z])/g, '$1 $2').replace(/\w\S*/g, function (txt) { 5 | return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); 6 | }); 7 | } 8 | 9 | class parseResult { 10 | 11 | capitalized(text) { 12 | return capitalize(text); 13 | } 14 | 15 | parseArray(arr) { 16 | let result = ''; 17 | for (let i = 0; i < arr.length; i++) { 18 | const value = arr[i]; 19 | if (typeof value === 'object' && !Array.isArray(value)) { 20 | const nestedEntries = this.parseResultObject(value); 21 | if (nestedEntries !== '') { 22 | result += `${nestedEntries}\n`; 23 | } 24 | } else if (Array.isArray(value)) { 25 | const nestedEntries = this.parseArray(value); 26 | if (nestedEntries !== '') { 27 | result += `${nestedEntries}\n`; 28 | } 29 | } else { 30 | result += `${value}, `; 31 | } 32 | } 33 | return result; 34 | } 35 | 36 | parseResultObject(input) { 37 | let result = ''; 38 | const keys = Object.keys({ ...input }); 39 | const values = Object.values({ ...input }); 40 | for (let i = 0; i < keys.length; i++) { 41 | const key = keys[i]; 42 | const value = values[i]; 43 | if (typeof value === 'string' && value.startsWith('http')) continue; 44 | if (typeof value === 'object' && !Array.isArray(value)) { 45 | const nestedEntries = this.parseResultObject(value); 46 | if (nestedEntries !== '') { 47 | result += `• ${capitalize(key)}:\n${nestedEntries}\n\n`; 48 | } 49 | } else if (Array.isArray(value)) { 50 | const nestedEntries = this.parseArray(value); 51 | if (nestedEntries !== '') { 52 | result += `• ${capitalize(key)}: ${nestedEntries}\n\n`; 53 | } 54 | } else { 55 | result += `• ${capitalize(key)}: ${value}\n`; 56 | } 57 | } 58 | return result; 59 | } 60 | 61 | parseResultArray(response) { 62 | let result = ''; 63 | for (let i = 0; i < response.length; i++) { 64 | const keys = Object.keys({ ...response[i] }); 65 | const values = Object.values({ ...response[i] }); 66 | const entries = keys.map((key, index) => { 67 | const value = values[index]; 68 | if (typeof value === 'string' && value.startsWith('http')) return false; 69 | if (typeof value === 'object' && !Array.isArray(value)) { 70 | const nestedEntries = Object.entries(value).map(([nestedKey, nestedValue]) => { 71 | if (typeof nestedValue === 'string' && nestedValue.startsWith('http')) return false; 72 | return ` • ${capitalize(nestedKey)}: ${nestedValue}`; 73 | }).filter(entry => entry !== false); 74 | if (nestedEntries.length > 0) { 75 | return `• ${capitalize(key)}:\n${nestedEntries.join('\n')}`; 76 | } 77 | } else if (Array.isArray(value)) { 78 | const nestedEntries = value.map(nestedValue => { 79 | if (typeof nestedValue === 'string' && nestedValue.startsWith('http')) return false; 80 | if (typeof nestedValue === 'object' && !Array.isArray(nestedValue)) return false; 81 | return ` • ${JSON.stringify(nestedValue)}`; 82 | }).filter(entry => entry !== false); 83 | if (nestedEntries.length > 0) { 84 | return `• ${capitalize(key)}:\n${nestedEntries.join('\n')}`; 85 | } 86 | } 87 | return `• ${capitalize(key)}: ${typeof value === 'string' ? value : typeof value === 'number' ? value.toString() : typeof value === 'boolean' ? value.toString() : value instanceof Object ? Object.keys({ ...value }).join(', ') : '-'}`; 88 | }).filter(entry => entry !== false); 89 | if (entries.length > 0) { 90 | result += entries.join('\n') + '\n\n'; 91 | } 92 | } 93 | return result; 94 | } 95 | 96 | literation(input) { 97 | let lines = input.split('\n'); 98 | let outputString = ''; 99 | for (let line of lines) { 100 | let colonIndex = line.indexOf(':'); 101 | let trimmedLine = line.trim(); 102 | if (colonIndex !== -1 && trimmedLine.charAt(colonIndex + 1) !== '') { 103 | outputString += line + '\n'; 104 | } 105 | } 106 | return outputString; 107 | } 108 | 109 | parse(input) { 110 | let result = ''; 111 | if (input instanceof Array) result = this.parseResultArray(input); 112 | if (input instanceof Object) result = this.parseResultObject(input); 113 | const results = result.replaceAll('\n\n\n', '\n').replaceAll('\n\n', ''); 114 | return this.literation(results).slice(0, -1); 115 | } 116 | } 117 | 118 | export default parseResult; -------------------------------------------------------------------------------- /library/similarity.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import similarity from 'similarity'; 4 | 5 | class Similarity { 6 | 7 | calculateSimilarityScoreOne(stringOne, stringTwo) { 8 | const lengthOne = stringOne.length; 9 | const lengthTwo = stringTwo.length; 10 | const maxLength = Math.max(lengthOne, lengthTwo); 11 | let commonChars = 0; 12 | for (let i = 0; i < maxLength; i++) { 13 | if (stringOne[i] && stringTwo[i] && stringOne[i] === stringTwo[i]) { 14 | commonChars++; 15 | } 16 | } 17 | const result = (commonChars / maxLength) * 100; 18 | return parseFloat(result.toFixed(2)); 19 | } 20 | 21 | calculateSimilarityScoreTwo(inputOne, inputTwo) { 22 | const stringOne = inputOne.length; 23 | const stringTwo = inputTwo.length; 24 | const chunk = []; 25 | for (let i = 0; i <= stringOne; i++) { 26 | chunk[i] = []; 27 | chunk[i][0] = i; 28 | } 29 | for (let index = 0; index <= stringTwo; index++) { 30 | chunk[0][index] = index; 31 | } 32 | for (let i = 1; i <= stringOne; i++) { 33 | for (let index = 1; index <= stringTwo; index++) { 34 | if (inputOne[i - 1] === inputTwo[index - 1]) { 35 | chunk[i][index] = chunk[i - 1][index - 1]; 36 | } else { 37 | chunk[i][index] = Math.min( 38 | chunk[i - 1][index] + 1, 39 | chunk[i][index - 1] + 1, 40 | chunk[i - 1][index - 1] + 1 41 | ); 42 | } 43 | } 44 | } 45 | const checkScore = 1 - chunk[stringOne][stringTwo] / Math.max(stringOne, stringTwo); 46 | const parse = parseFloat(checkScore.toFixed(2)); 47 | const serializeScore = parse.toString().replace('.', '').split('').reverse().join(''); 48 | return parseFloat(serializeScore); 49 | } 50 | 51 | matched(array, keyword, similarity) { 52 | const matches = []; 53 | for (const item of array) { 54 | const name = item.toLowerCase(); 55 | const checkScoreOne = this.calculateSimilarityScoreOne(name, keyword.toLowerCase()); 56 | const checkScoreTwo = this.calculateSimilarityScoreTwo(name, keyword.toLowerCase()); 57 | 58 | if (checkScoreOne >= similarity || name.includes(keyword.toLowerCase())) { 59 | const score = checkScoreOne === 100 ? checkScoreOne : checkScoreOne.toFixed(2); 60 | matches.push({ index: name, score: score.toString() }); 61 | } 62 | if (checkScoreTwo >= similarity || name.includes(keyword.toLowerCase())) { 63 | matches.push({ index: name, score: checkScoreTwo.toString() }); 64 | } 65 | } 66 | return matches.filter(({ score }) => score != 0.00) 67 | } 68 | 69 | exec(array, string, score = 0.6) { 70 | const match = []; 71 | for (var i = 0; i < array.length; i++) { 72 | const checkScore = similarity(array[i], string); 73 | if (checkScore >= score) { 74 | match.push({ index: array[i], score: checkScore }); 75 | } 76 | } 77 | return match; 78 | } 79 | } 80 | export default new Similarity(); -------------------------------------------------------------------------------- /library/store.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {import('@adiwajshing/baileys').WASocket | import('@adiwajshing/baileys').WALegacySocket} 3 | */ 4 | function bind(conn) { 5 | if (!conn.chats) conn.chats = {}; 6 | /** 7 | * 8 | * @param {import('@adiwajshing/baileys').Contact[]|{contacts:import('@adiwajshing/baileys').Contact[]}} contacts 9 | * @returns 10 | */ 11 | function updateNameToDb(contacts) { 12 | if (!contacts) return 13 | try { 14 | contacts = contacts.contacts || contacts 15 | for (const contact of contacts) { 16 | const id = conn.decodeJid(contact.id) 17 | if (!id || id === 'status@broadcast') continue 18 | let chats = conn.chats[id] 19 | if (!chats) chats = conn.chats[id] = { ...contact, id } 20 | conn.chats[id] = { 21 | ...chats, 22 | ...({ 23 | ...contact, id, ...(id.endsWith('@g.us') ? 24 | { subject: contact.subject || contact.name || chats.subject || '' } : 25 | { name: contact.notify || contact.name || chats.name || chats.notify || '' }) 26 | } || {}) 27 | } 28 | } 29 | } catch (e) { 30 | console.error(e) 31 | } 32 | } 33 | conn.ev.on('contacts.upsert', updateNameToDb) 34 | conn.ev.on('groups.update', updateNameToDb) 35 | conn.ev.on('contacts.set', updateNameToDb) 36 | conn.ev.on('chats.set', async ({ chats }) => { 37 | try { 38 | for (let { id, name, readOnly } of chats) { 39 | id = conn.decodeJid(id) 40 | if (!id || id === 'status@broadcast') continue 41 | const isGroup = id.endsWith('@g.us') 42 | let chats = conn.chats[id] 43 | if (!chats) chats = conn.chats[id] = { id } 44 | chats.isChats = !readOnly 45 | if (name) chats[isGroup ? 'subject' : 'name'] = name 46 | if (isGroup) { 47 | const metadata = await conn.groupMetadata(id).catch(_ => null) 48 | if (name || metadata?.subject) chats.subject = name || metadata.subject 49 | if (!metadata) continue 50 | chats.metadata = metadata 51 | } 52 | } 53 | } catch (e) { 54 | console.error(e) 55 | } 56 | }) 57 | conn.ev.on('group-participants.update', async function updateParticipantsToDb({ id, participants, action }) { 58 | if (!id) return 59 | id = conn.decodeJid(id) 60 | if (id === 'status@broadcast') return 61 | if (!(id in conn.chats)) conn.chats[id] = { id } 62 | let chats = conn.chats[id] 63 | chats.isChats = true 64 | const groupMetadata = await conn.groupMetadata(id).catch(_ => null) 65 | if (!groupMetadata) return 66 | chats.subject = groupMetadata.subject 67 | chats.metadata = groupMetadata 68 | }) 69 | conn.ev.on('groups.update', async function groupUpdatePushToDb(groupsUpdates) { 70 | try { 71 | for (const update of groupsUpdates) { 72 | const id = conn.decodeJid(update.id) 73 | if (!id || id === 'status@broadcast') continue 74 | const isGroup = id.endsWith('@g.us') 75 | if (!isGroup) continue 76 | let chats = conn.chats[id] 77 | if (!chats) chats = conn.chats[id] = { id } 78 | chats.isChats = true 79 | const metadata = await conn.groupMetadata(id).catch(_ => null) 80 | if (metadata) chats.metadata = metadata 81 | if (update.subject || metadata?.subject) chats.subject = update.subject || metadata.subject 82 | } 83 | } catch (e) { 84 | console.error(e) 85 | } 86 | }) 87 | conn.ev.on('chats.upsert', function chatsUpsertPushToDb(chatsUpsert) { 88 | try { 89 | const { id, name } = chatsUpsert 90 | if (!id || id === 'status@broadcast') return 91 | conn.chats[id] = { ...(conn.chats[id] || {}), ...chatsUpsert, isChats: true } 92 | const isGroup = id.endsWith('@g.us') 93 | if (isGroup) conn.insertAllGroup().catch(_ => null) 94 | } catch (e) { 95 | console.error(e) 96 | } 97 | }) 98 | conn.ev.on('presence.update', async function presenceUpdatePushToDb({ id, presences }) { 99 | try { 100 | const sender = Object.keys(presences)[0] || id 101 | const _sender = conn.decodeJid(sender) 102 | const presence = presences[sender]['lastKnownPresence'] || 'composing' 103 | let chats = conn.chats[_sender] 104 | if (!chats) chats = conn.chats[_sender] = { id: sender } 105 | chats.presences = presence 106 | if (id.endsWith('@g.us')) { 107 | let chats = conn.chats[id] 108 | if (!chats) chats = conn.chats[id] = { id } 109 | } 110 | } catch (e) { 111 | console.error(e) 112 | } 113 | }) 114 | return conn; 115 | } 116 | 117 | export default bind; -------------------------------------------------------------------------------- /loadedCommands.js: -------------------------------------------------------------------------------- 1 | import './configs/global.js'; 2 | import functions from './library/functions.js'; 3 | 4 | import fs from 'fs'; 5 | import path from 'path'; 6 | 7 | async function loadCommands() { 8 | const commandsPath = './commands'; 9 | const plugins = fs.readdirSync(commandsPath); 10 | for (const plugin of plugins) { 11 | if (!/\.js$/g.test(plugin)) { 12 | const commandFiles = fs.readdirSync(path.join(commandsPath, plugin)).filter(file => file.endsWith('.js')); 13 | for (const filename of commandFiles) { 14 | const pathFiles = path.join(commandsPath, plugin, filename); 15 | try { 16 | const command = (await import(`./${pathFiles}`)).default; 17 | const allCommand = functions.requireJson('./database/allCommands.json'); 18 | if (command) { 19 | global.headersCommands.push({ category: plugin, command: command.views }); 20 | if (allCommand.length < 1) { 21 | global.allCommands.push(command.views[0].split(' ')[0]); 22 | } else { 23 | global.allCommands.push(...allCommand, command.views[0].split(' ')[0]); 24 | } 25 | global.allCommands = [...new Set(global.allCommands)]; 26 | global.plugins[`${plugin}-${filename}`] = command; 27 | } 28 | } catch (error) { 29 | console.error(`Error loading command file ${pathFiles}: ${error.message}`); 30 | functions.reloadModule(pathFiles); 31 | } 32 | } 33 | } 34 | } 35 | } 36 | 37 | 38 | function updateCommandsFile() { 39 | const headers = global.headersCommands; 40 | const objects = headers.reduce((objects, items) => { 41 | if (objects[items.category]) { 42 | objects[items.category].command.push(...items.command); 43 | } else { 44 | objects[items.category] = { ...items }; 45 | } 46 | return objects; 47 | }, {}); 48 | Object.keys(objects).forEach(category => { 49 | global.Commands[category] = [...new Set(objects[category].command)].sort(); 50 | }); 51 | const keysCommander = Object.keys(global.commander); 52 | const keysCommands = Object.keys(global.Commands); 53 | if (keysCommander.length === 0 && keysCommands.length !== 0) { 54 | fs.writeFileSync('./database/commands.json', JSON.stringify(global.Commands, null, 2)); 55 | logger.success('Successfully loaded plugins'); 56 | } else if (keysCommands.length === keysCommander.length) { 57 | keysCommander.forEach(key => { 58 | if (global.commander[key].length !== global.Commands[key].length) { 59 | fs.writeFileSync('./database/commands.json', JSON.stringify(global.Commands, null, 2)); 60 | logger.success('Successfully added plugins'); 61 | } 62 | }); 63 | } else if (keysCommands.length !== (keysCommander.length || keysCommander.length === 0)) { 64 | fs.writeFileSync('./database/commands.json', JSON.stringify(global.Commands, null, 2)); 65 | logger.success('Successfully updated plugins'); 66 | } 67 | } 68 | 69 | export default async function index(functions) { 70 | await loadCommands(functions); 71 | updateCommandsFile(); 72 | } 73 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | import './configs/global.js'; 2 | import { spawn } from 'child_process'; 3 | import cfonts from 'cfonts'; 4 | import path from 'path'; 5 | import fs from 'fs'; 6 | 7 | function start(connect) { 8 | console.clear(); 9 | cfonts.say('xcoders bot', { 10 | font: 'block', 11 | align: 'center', 12 | gradient: ['#12c2e9', '#c471ed'], 13 | background: 'transparent', 14 | letterSpacing: 1, 15 | transitionGradient: true 16 | }); 17 | cfonts.say('Powered By FarhanXCode7', { 18 | font: 'console', 19 | align: 'center', 20 | gradient: ['#DCE35B', '#45B649'], 21 | transitionGradient: true 22 | }); 23 | const args = [path.join(connect), ...process.argv.slice(2)]; 24 | const pods = spawn(process.argv[0], args, { 25 | stdio: ['inherit', 'inherit', 'inherit', 'ipc'] 26 | }).on('message', (data) => { 27 | console.log('[ xcoders ]', data); 28 | switch (data) { 29 | case 'reset': 30 | pods.kill(); 31 | start.apply(this, arguments); 32 | break; 33 | } 34 | }).on('error', (error) => { 35 | if (error.code === 'ENOENT') { 36 | const files = global.absoluteUrl(args[0]); 37 | console.error(`File not found: ${files}`); 38 | fs.watchFile(files, () => { 39 | start(files); 40 | fs.unwatchFile(files); 41 | }); 42 | } else { 43 | console.error(error); 44 | } 45 | }); 46 | } 47 | 48 | start('./index.js'); 49 | -------------------------------------------------------------------------------- /middleware/console.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | class Logger { 4 | constructor() { 5 | this.closeByNewLine = false; 6 | this.useIcons = true; 7 | this.logsTitle = 'LOGS'; 8 | this.warningsTitle = 'WARNINGS'; 9 | this.errorsTitle = 'ERRORS'; 10 | this.informationsTitle = 'INFORMATIONS'; 11 | this.successesTitle = 'SUCCESS'; 12 | this.debugTitle = 'DEBUG'; 13 | this.assertsTitle = 'ASSERT'; 14 | } 15 | GetColor(foregroundColor = '', backgroundColor = '') { 16 | let foregroundsColors = '\x1b[37m'; 17 | let backgroundsColors = ''; 18 | switch (foregroundColor.trim().toLowerCase()) { 19 | case 'black': 20 | foregroundsColors = '\x1b[30m'; 21 | break; 22 | case 'red': 23 | foregroundsColors = '\x1b[31m'; 24 | break; 25 | case 'green': 26 | foregroundsColors = '\x1b[32m'; 27 | break; 28 | case 'yellow': 29 | foregroundsColors = '\x1b[33m'; 30 | break; 31 | case 'blue': 32 | foregroundsColors = '\x1b[34m'; 33 | break; 34 | case 'magenta': 35 | foregroundsColors = '\x1b[35m'; 36 | break; 37 | case 'cyan': 38 | foregroundsColors = '\x1b[36m'; 39 | break; 40 | case 'white': 41 | foregroundsColors = '\x1b[37m'; 42 | break; 43 | } 44 | 45 | switch (backgroundColor.trim().toLowerCase()) { 46 | case 'black': 47 | backgroundsColors = '\x1b[40m'; 48 | break; 49 | case 'red': 50 | backgroundsColors = '\x1b[44m'; 51 | break; 52 | case 'green': 53 | backgroundsColors = '\x1b[44m'; 54 | break; 55 | case 'yellow': 56 | backgroundsColors = '\x1b[43m'; 57 | break; 58 | case 'blue': 59 | backgroundsColors = '\x1b[44m'; 60 | break; 61 | case 'magenta': 62 | backgroundsColors = '\x1b[45m'; 63 | break; 64 | case 'cyan': 65 | backgroundsColors = '\x1b[46m'; 66 | break; 67 | case 'white': 68 | backgroundsColors = '\x1b[47m'; 69 | break; 70 | } 71 | return (foregroundsColors + backgroundsColors); 72 | } 73 | 74 | GetColorReset() { 75 | return '\x1b[0m'; 76 | } 77 | 78 | clear() { 79 | console.clear(); 80 | } 81 | 82 | print(foregroundColor = 'white', backgroundColor = 'black', ...strings) { 83 | const Icons = this.GetColor(foregroundColor, backgroundColor); 84 | console.log(Icons, strings.join(''), this.GetColorReset()); 85 | if (this.closeByNewLine) console.log(''); 86 | } 87 | 88 | log(...strings) { 89 | const foregrounds = 'white'; 90 | const backgrounds = ''; 91 | const icons = '\u25ce'; 92 | const groupTiles = ` ${this.logsTitle}`; 93 | if (strings.length > 1) { 94 | const Icons = this.GetColor(forEach, backgrounds); 95 | console.group(Icons, (this.useIcons ? icons : '') + groupTiles); 96 | const newLine = this.closeByNewLine; 97 | this.closeByNewLine = false; 98 | strings.forEach((items) => { 99 | this.print(foregrounds, backgrounds, items, this.GetColorReset()); 100 | }); 101 | this.closeByNewLine = newLine; 102 | console.groupEnd(); 103 | if (newLine) console.log(); 104 | } else { 105 | this.print(foregrounds, backgrounds, strings.map((item) => { 106 | return `${(this.useIcons ? `${icons} ` : '')}${item}`; 107 | })); 108 | } 109 | } 110 | warn(...strings) { 111 | const foregrounds = 'yellow'; 112 | const backgrounds = ''; 113 | const icons = '\u26a0'; 114 | const groupTiles = ` ${this.warningsTitle}`; 115 | if (strings.length > 1) { 116 | const Icons = this.GetColor(foregrounds, backgrounds); 117 | console.group(Icons, (this.useIcons ? icons : '') + groupTiles); 118 | const newLine = this.closeByNewLine; 119 | this.closeByNewLine = false; 120 | strings.forEach((item) => { 121 | this.print(foregrounds, backgrounds, item, this.GetColorReset()); 122 | }); 123 | this.closeByNewLine = newLine; 124 | console.groupEnd(); 125 | if (newLine) console.log(); 126 | } else { 127 | this.print(foregrounds, backgrounds, strings.map((item) => { 128 | return `${(this.useIcons ? `${icons} ` : '')}${item}`; 129 | })); 130 | } 131 | } 132 | error(...strings) { 133 | const foregrounds = 'red'; 134 | const backgrounds = ''; 135 | const icons = '\u26D4'; 136 | const groupTiles = ` ${this.errorsTitle}`; 137 | if (strings.length > 1) { 138 | const Icons = this.GetColor(foregrounds, backgrounds); 139 | console.group(Icons, (this.useIcons ? icons : '') + groupTiles); 140 | const newLine = this.closeByNewLine; 141 | this.closeByNewLine = false; 142 | strings.forEach((item) => { 143 | this.print(foregrounds, backgrounds, item); 144 | }); 145 | this.closeByNewLine = newLine; 146 | console.groupEnd(); 147 | if (newLine) console.log(); 148 | } else { 149 | this.print(foregrounds, backgrounds, strings.map((item) => { 150 | return `${(this.useIcons ? `${icons} ` : '')}${item}`; 151 | })); 152 | } 153 | } 154 | info(...strings) { 155 | const foregrounds = 'blue'; 156 | const backgrounds = ''; 157 | const icons = '\u2139'; 158 | const groupTiles = ` ${this.informationsTitle}`; 159 | if (strings.length > 1) { 160 | const Icons = this.GetColor(foregrounds, backgrounds); 161 | console.group(Icons, (this.useIcons ? icons : '') + groupTiles); 162 | const newLine = this.closeByNewLine; 163 | this.closeByNewLine = false; 164 | strings.forEach((item) => { 165 | this.print(foregrounds, backgrounds, item); 166 | }); 167 | this.closeByNewLine = newLine; 168 | console.groupEnd(); 169 | if (newLine) console.log(); 170 | } else { 171 | this.print(foregrounds, backgrounds, strings.map((item) => { 172 | return `${(this.useIcons ? `${icons} ` : '')}${item}`; 173 | })); 174 | } 175 | } 176 | success(...strings) { 177 | const foregrounds = 'green'; 178 | const backgrounds = ''; 179 | const icons = '\u2713'; 180 | const groupTiles = ` ${this.successesTitle}`; 181 | if (strings.length > 1) { 182 | const Icons = this.GetColor(foregrounds, backgrounds); 183 | console.group(Icons, (this.useIcons ? icons : '') + groupTiles); 184 | const newLine = this.closeByNewLine; 185 | this.closeByNewLine = false; 186 | strings.forEach((item) => { 187 | this.print(foregrounds, backgrounds, item); 188 | }); 189 | this.closeByNewLine = newLine; 190 | console.groupEnd(); 191 | if (newLine) console.log(); 192 | } else { 193 | this.print(foregrounds, backgrounds, strings.map((item) => { 194 | return `${(this.useIcons ? `${icons} ` : '')}${item}`; 195 | })); 196 | } 197 | } 198 | debug(...strings) { 199 | const foregrounds = 'magenta'; 200 | const backgrounds = ''; 201 | const icons = '\u1367'; 202 | const groupTiles = ` ${this.debugsTitle}`; 203 | if (strings.length > 1) { 204 | const Icons = this.GetColor(foregrounds, backgrounds); 205 | console.group(Icons, (this.useIcons ? icons : '') + groupTiles); 206 | const newLine = this.closeByNewLine; 207 | this.closeByNewLine = false; 208 | strings.forEach((item) => { 209 | this.print(foregrounds, backgrounds, item); 210 | }); 211 | this.closeByNewLine = newLine; 212 | console.groupEnd(); 213 | if (newLine) console.log(); 214 | } else { 215 | this.print(foregrounds, backgrounds, strings.map((item) => { 216 | return `${(this.useIcons ? `${icons} ` : '')}${item}`; 217 | })); 218 | } 219 | } 220 | load() { 221 | const P = ['\\', '|', '/', '-']; 222 | let x = 0; 223 | const loader = setInterval(() => { 224 | process.stdout.write(`\r${P[x++]}`); 225 | x %= P.length; 226 | }, 250); 227 | setTimeout(() => { 228 | clearInterval(loader); 229 | }, 5000); 230 | } 231 | assert(...strings) { 232 | const foregrounds = 'cyan'; 233 | const backgrounds = ''; 234 | const icons = '\u0021'; 235 | const groupTiles = ` ${this.assertsTitle}`; 236 | if (strings.length > 1) { 237 | const Icons = this.GetColor(foregrounds, backgrounds); 238 | console.group(Icons, (this.useIcons ? icons : '') + groupTiles); 239 | const newLine = this.closeByNewLine; 240 | this.closeByNewLine = false; 241 | strings.forEach((item) => { 242 | this.print(foregrounds, backgrounds, item); 243 | }); 244 | this.closeByNewLine = newLine; 245 | console.groupEnd(); 246 | if (newLine) console.log(); 247 | } else { 248 | this.print(foregrounds, backgrounds, strings.map((item) => { 249 | return `${(this.useIcons ? `${icons} ` : '')}${item}`; 250 | })); 251 | } 252 | } 253 | } 254 | 255 | export default new Logger(); -------------------------------------------------------------------------------- /middleware/html.js: -------------------------------------------------------------------------------- 1 | const html = (input, title) => ` 2 | 3 | 4 | 5 | 6 | Scan QR | ${title} 7 | 31 | 32 | 33 |
34 |

${title} 35 |
36 | Scan 37 |

38 | 39 | 40 | `; 41 | 42 | export default html; -------------------------------------------------------------------------------- /middleware/serialize.js: -------------------------------------------------------------------------------- 1 | import '../configs/global.js'; 2 | import crypto from 'crypto'; 3 | const { 4 | generateWAMessageFromContent, 5 | generateForwardMessageContent, 6 | jidNormalizedUser, 7 | extractMessageContent, 8 | areJidsSameUser, 9 | getContentType, 10 | isJidGroup, 11 | proto 12 | } = Baileys; 13 | 14 | const serialize = async (conn, m, functions) => { 15 | const copyNForward = async (jid, message, forceForward, options = {}) => { 16 | if (options.readViewOnce) { 17 | message.message = message.message && message.message.ephemeralMessage && message.message.ephemeralMessage.message ? message.message.ephemeralMessage.message : (message.message || undefined); 18 | const vtype = Object.keys(message.message.viewOnceMessage.message)[0]; 19 | delete message.message?.ignore ? message.message.ignore : message.message; 20 | delete message.message.viewOnceMessage.message[vtype].viewOnce; 21 | message.message = { ...message.message.viewOnceMessage.message }; 22 | } 23 | const mtype = getContentType(message.message); 24 | const content = generateForwardMessageContent(message, forceForward); 25 | const ctype = getContentType(content); 26 | let context = {}; 27 | if (mtype !== 'conversation') context = message.message[mtype]?.contextInfo; 28 | const messageOptions = { 29 | ...content[ctype], 30 | ...options, 31 | ...(options.contextInfo && { 32 | contextInfo: { 33 | ...content[ctype].contextInfo, 34 | ...options.contextInfo, 35 | }, 36 | }), 37 | }; 38 | messageOptions.contextInfo = { 39 | ...context, 40 | ...messageOptions.contextInfo, 41 | }; 42 | const waMessage = generateWAMessageFromContent(jid, content, messageOptions); 43 | waMessage.key.id = `XCODERS_BOT_${crypto.randomBytes(13).toString('hex').toUpperCase()}`; 44 | await conn.relayMessage(jid, waMessage.message, { messageId: waMessage.key.id }); 45 | return waMessage; 46 | }; 47 | const cMod = async (jid, copy, text = '', sender = conn.user.id, options = {}) => { 48 | let mtype = getContentType(copy.message); 49 | let isEphemeral = mtype === 'ephemeralMessage'; 50 | if (isEphemeral) { 51 | mtype = Object.keys(copy.message.ephemeralMessage.message)[0]; 52 | copy.message = copy.message.ephemeralMessage.message[mtype]; 53 | } 54 | let content = copy.message; 55 | if (typeof content === 'string') { 56 | copy.message = text || content; 57 | } else if (text || content.caption) { 58 | content.caption = text || content.caption; 59 | } else if (content.text) { 60 | content.text = text || content.text; 61 | } 62 | if (typeof content !== 'string') { 63 | copy.message = { ...content, ...options }; 64 | } 65 | if (copy.key.participant) { 66 | sender = sender || copy.key.participant; 67 | } else if (copy.key.remoteJid.includes('@s.whatsapp.net')) { 68 | sender = sender || copy.key.remoteJid; 69 | } else if (copy.key.remoteJid.includes('@broadcast')) { 70 | sender = sender || copy.key.remoteJid; 71 | } 72 | copy.key.remoteJid = jid; 73 | copy.key.fromMe = areJidsSameUser(sender, (conn.user && conn.user.id)); 74 | return proto.WebMessageInfo.fromObject(copy); 75 | }; 76 | if (!m) return m; 77 | if (m.key) { 78 | m.id = m.key.id; 79 | m.isBaileys = m.id ? m.id.startsWith('BAE5') : false; 80 | m.chat = m.key.remoteJid; 81 | m.fromMe = m.key.fromMe; 82 | m.isGroups = isJidGroup(m.chat) || m.chat.endsWith('@g.us'); 83 | m.sender = m.fromMe ? jidNormalizedUser(conn.user.id) : (m.key.participant || m.chat); 84 | } 85 | m.message = extractMessageContent(m.message); 86 | if (m.message) { 87 | m.mtype = getContentType(m.message) || Object.keys(m.message)[0]; 88 | m.body = ''; 89 | if (m.mtype === 'conversation') m.body = m.message.conversation; 90 | if (m.mtype === 'imageMessage') m.body = m.message.imageMessage.caption; 91 | if (m.mtype === 'videoMessage') m.body = m.message.videoMessage.caption; 92 | if (m.mtype === 'extendedTextMessage') m.body = m.message.extendedTextMessage.text; 93 | if (m.mtype === 'buttonsResponseMessage') m.body = m.message.buttonsResponseMessage.selectedButtonId; 94 | if (m.mtype === 'listResponseMessage') m.body = m.message.listResponseMessage.singleSelectReply.selectedRowId; 95 | if (m.mtype === 'templateButtonReplyMessage') m.body = m.message.templateButtonReplyMessage.selectedId; 96 | if (m.mtype === 'messageContextInfo') m.body = (m.message.listResponseMessage.singleSelectReply.selectedRowId || m.message.buttonsResponseMessage.selectedButtonId || m.text); 97 | m.coders = m.message[m.mtype]; 98 | if (m.mtype === 'ephemeralMessage') { 99 | await serialize(conn, m.coders, functions); 100 | m.mtype = m.coders.mtype; 101 | m.coders = m.coders.coders; 102 | } 103 | let quoted = m.quoted = m.coders.contextInfo ? m.coders.contextInfo.quotedMessage : null; 104 | m.mentionedJid = m.coders.contextInfo?.mentionedJid || []; 105 | if (m.quoted) { 106 | const type = getContentType(m.quoted) || Object.keys(m.quoted)[0]; 107 | m.quoted = m.quoted[type]; 108 | if (/productMessage/.test(type)) m.quoted = m.quoted[Object.keys(m.quoted)[0]]; 109 | if (typeof m.quoted === 'string') m.quoted = { text: m.quoted }; 110 | m.quoted.id = m.coders.contextInfo.stanzaId; 111 | m.quoted.mtype = getContentType(m.quoted.message) || getContentType(m.coders.contextInfo.quotedMessage) || null; 112 | m.quoted.chat = m.coders.contextInfo.remoteJid || m.chat; 113 | m.quoted.isBaileys = m.quoted.id ? m.quoted.id.startsWith('BAE5') : false; 114 | m.quoted.sender = jidNormalizedUser(m.coders.contextInfo.participant); 115 | m.quoted.fromMe = areJidsSameUser(m.quoted.sender, (conn.user && conn.user.id)); 116 | m.quoted.text = m.quoted.text || m.quoted.caption || ''; 117 | m.quoted.mentionedJid = m.coders.contextInfo ? m.coders.contextInfo.mentionedJid : []; 118 | m.getQuotedObj = m.getQuotedMessage = async () => { 119 | if (!m.quoted.id) return false; 120 | const quotedMsg = await store.loadMessage(m.chat, m.quoted.id); 121 | return serialize(conn, quotedMsg, functions); 122 | }; 123 | let vM = m.quoted.fakeObj = proto.WebMessageInfo.fromObject({ 124 | key: { 125 | remoteJid: m.quoted.chat, 126 | fromMe: m.quoted.fromMe, 127 | id: m.quoted.id, 128 | participant: m.quoted.participant 129 | }, 130 | message: quoted, ...(m.isGroups ? { participant: m.quoted.sender } : {}) 131 | }); 132 | m.quoted.delete = () => conn.sendMessage(m.quoted.chat, { delete: vM.key }); 133 | m.quoted.copyNForward = (jid, forceForward = false, options = {}) => copyNForward(jid, vM, forceForward, options); 134 | m.quoted.cMod = (jid, text = '', sender = m.quoted.sender, options = {}) => cMod(jid, vM, text, sender, options); 135 | m.quoted.download = () => functions.downloadContentMediaMessage(m.quoted); 136 | } 137 | } 138 | if (m.coders) { 139 | m.download = () => functions.downloadContentMediaMessage(m.coders); 140 | m.text = (m.mtype == 'listResponseMessage' ? m.coders.singleSelectReply.selectedRowId : '') || m.coders.text || m.coders.caption || m.coders || ''; 141 | } 142 | m.reply = (text, chatId, options) => conn.sendMessage(chatId ? chatId : m.chat, { text: text }, { quoted: m, detectLinks: false, thumbnail: global.thumbnail, ...options }); 143 | m.copy = () => serialize(conn, proto.WebMessageInfo.fromObject(proto.WebMessageInfo.toObject(m)), functions); 144 | m.copyNForward = (jid = m.chat, message, forceForward = false, options = {}) => copyNForward(jid, message, forceForward, options); 145 | m.cMod = (jid, text = '', sender = m.sender, options = {}) => cMod(jid, m, text, sender, options); 146 | return m; 147 | }; 148 | 149 | export default serialize; -------------------------------------------------------------------------------- /middleware/service.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs'; 2 | import _ from 'lodash'; 3 | import moment from 'moment-timezone'; 4 | 5 | import loadedCommands from '../loadedCommands.js'; 6 | import hitCommands from '../library/hitCommand.js'; 7 | import functions from '../library/functions.js'; 8 | 9 | const style = '⭑'; 10 | const list = ['/', 'or']; 11 | const randomSplit = _.sample(list); 12 | const monospace = (str) => '```' + str + '```'; 13 | const interline = (str) => '_' + str + '_'; 14 | 15 | const allmenu = (m, prefix, name) => { 16 | let size = null; 17 | const listFeatures = functions.requireJson('./database/commands.json'); 18 | const pathFolder = './session'; 19 | if (global.sizeSession) { 20 | size = global.sizeSession; 21 | } else { 22 | size = (process.platform !== 'android' ? functions.folderSize(pathFolder) : fs.lstatSync(pathFolder)).size; 23 | global.sizeSession = size; 24 | } 25 | if (Object.keys(listFeatures).length < 1) { 26 | return loadedCommands(functions); 27 | } 28 | let position = ''; 29 | let assignFeatures = _.assign(listFeatures); 30 | Object.keys(listFeatures).forEach((a) => { 31 | position += `\t\t\t\n${interline(style + ' ' + prefix + assignFeatures[a].join('_\n_' + style + ' ' + prefix).replaceAll('<', '*<').replaceAll('>', '>*').replace(':', randomSplit))}\n\n`; 32 | }); 33 | return ` 34 | ${monospace(`Hallo ${name} ⦋ @${m.sender.split('@')[0]} ⦌`)} 👋 35 | 36 | ⬟ *Date*: ${monospace(moment().tz('Asia/Jakarta').locale('id').format('LLL'))} 37 | ⬟ *Session*: ${monospace(functions.formatSize(size))} 38 | 39 | ⬟ *Notes*: 40 | ${'⧾ ' + monospace('Gunakan Fitur tanpa simbol <>')} 41 | ${'⧾ ' + monospace('Jangan spam bot...')} 42 | 43 | ${position} 44 | ${hitCommands.popularCommand(1) ? `⬟ *3 Most Popular Features*\n\r${hitCommands.popularCommand(3, '\r \r \r', '\t\t\t').slice(0, -2)}` : ''}`; 45 | }; 46 | 47 | const mostPopular = (obj) => { 48 | return hitCommands.shortedCommands(obj); 49 | } 50 | 51 | const countFeatures = (requireJson) => { 52 | const listFeatures = requireJson('./database/commands.json'); 53 | let position = ''; 54 | const assignFeatures = _.assign(listFeatures); 55 | 56 | Object.keys(listFeatures).forEach((str) => { 57 | position += `${str}\n${assignFeatures[str].length} Fitur\n\n`; 58 | }); 59 | 60 | return position; 61 | }; 62 | 63 | const stats = (os, speed, performance, formatDuration, formatSize) => { 64 | const used = process.memoryUsage(); 65 | const cpus = os.cpus().map(cpu => { 66 | cpu.total = Object.keys(cpu.times).reduce((last, type) => last + cpu.times[type], 0); 67 | return cpu; 68 | }); 69 | const cpu = cpus.reduce((last, cpu, _, { length }) => { 70 | last.total += cpu.total; 71 | last.speed += cpu.speed / length; 72 | last.times.user += cpu.times.user; 73 | last.times.nice += cpu.times.nice; 74 | last.times.sys += cpu.times.sys; 75 | last.times.idle += cpu.times.idle; 76 | last.times.irq += cpu.times.irq; 77 | return last; 78 | }, { speed: 0, total: 0, times: { user: 0, nice: 0, sys: 0, idle: 0, irq: 0 } }); 79 | let timestamp = speed(); 80 | let latensi = speed() - timestamp; 81 | let perf_now = speed(); 82 | let perf_old = performance(); 83 | 84 | return ` 85 | Kecepatan Respon ${latensi.toFixed(4)} _Second_ \n ${perf_old - perf_now} _miliseconds_ 86 | 87 | ⊳ Runtime : ${formatDuration(process.uptime())} 88 | 89 | 💻 Info Server 90 | ⊳ RAM: ${formatSize(os.totalmem() - os.freemem())} / ${formatSize(os.totalmem())} 91 | ⊳ OS Type: ${os.type()} 92 | ⊳ OS Version: ${os.version()} 93 | ⊳ Hostname: ${os.hostname()} 94 | 95 | 🔰 NodeJS Memory Usage 96 | ${Object.keys(used).map((key, _, arr) => `⊳ ${key.padEnd(Math.max(...arr.map(v => v.length)), ' ')}: ${formatSize(used[key])}`).join('\n')} 97 | ${cpus[0] ? ` 98 | 🌐 Total CPU Usage 99 | ${cpus[0].model.trim()} (${cpu.speed} MHZ) 100 | ${Object.keys(cpu.times).map(type => `⊳ ${(type).padEnd(6)}: ${(100 * cpu.times[type] / cpu.total).toFixed(2)}%`).join('\n')} 101 | 102 | ♨️ CPU Core(s) Usage (${cpus.length} Core CPU) 103 | ${cpus.map((cpu, i) => `${i + 1}. ${cpu.model.trim()} (${cpu.speed} MHZ)\n${Object.keys(cpu.times).map(type => `⊳ ${(type).padEnd(6)}: ${(100 * cpu.times[type] / cpu.total).toFixed(2)}%`).join('\n')}`).join('\n\n')}` : ''} 104 | `.trim(); 105 | }; 106 | 107 | export default { 108 | stats, 109 | countFeatures, 110 | mostPopular, 111 | allmenu 112 | }; -------------------------------------------------------------------------------- /middleware/streamReadable.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // https://github.com/samcday/node-stream-buffer/blob/main/lib/readable_streambuffer.js 4 | import { Readable } from 'stream'; 5 | import { inherits } from 'util'; 6 | 7 | const constants = { 8 | DEFAULT_INITIAL_SIZE: (8 * 1024), 9 | DEFAULT_INCREMENT_AMOUNT: (8 * 1024), 10 | DEFAULT_FREQUENCY: 1, 11 | DEFAULT_CHUNK_SIZE: 1024 12 | }; 13 | 14 | class ReadableStreamBuffer { 15 | constructor(options) { 16 | const that = this; 17 | options = options || {}; 18 | Readable.call(this, options); 19 | this.stopped = false; 20 | const frequency = options.hasOwnProperty('frequency') ? options.frequency : constants.DEFAULT_FREQUENCY; 21 | const chunkSize = options.chunkSize || constants.DEFAULT_CHUNK_SIZE; 22 | const initialSize = options.initialSize || constants.DEFAULT_INITIAL_SIZE; 23 | const incrementAmount = options.incrementAmount || constants.DEFAULT_INCREMENT_AMOUNT; 24 | let size = 0; 25 | let buffer = Buffer.alloc(initialSize); 26 | let allowPush = false; 27 | const sendData = function () { 28 | const amount = Math.min(chunkSize, size); 29 | let sendMore = false; 30 | if (amount > 0) { 31 | let chunk = null; 32 | chunk = Buffer.alloc(amount); 33 | buffer.copy(chunk, 0, 0, amount); 34 | sendMore = that.push(chunk) !== false; 35 | allowPush = sendMore; 36 | buffer.copy(buffer, 0, amount, size); 37 | size -= amount; 38 | } 39 | if (size === 0 && that.stopped) { 40 | that.push(null); 41 | } 42 | if (sendMore) { 43 | sendData.timeout = setTimeout(sendData, frequency); 44 | } else { 45 | sendData.timeout = null; 46 | } 47 | }; 48 | this.stop = function () { 49 | if (this.stopped) { 50 | throw new Error('stop() called on already stopped ReadableStreamBuffer'); 51 | } 52 | this.stopped = true; 53 | if (size === 0) { 54 | this.push(null); 55 | } 56 | }; 57 | this.size = function () { 58 | return size; 59 | }; 60 | this.maxSize = function () { 61 | return buffer.length; 62 | }; 63 | const increaseBufferIfNecessary = function (incomingDataSize) { 64 | if ((buffer.length - size) < incomingDataSize) { 65 | const factor = Math.ceil((incomingDataSize - (buffer.length - size)) / incrementAmount); 66 | const newBuffer = Buffer.alloc(buffer.length + (incrementAmount * factor)); 67 | buffer.copy(newBuffer, 0, 0, size); 68 | buffer = newBuffer; 69 | } 70 | }; 71 | const kickSendDataTask = function () { 72 | if (!sendData.timeout && allowPush) { 73 | sendData.timeout = setTimeout(sendData, frequency); 74 | } 75 | }; 76 | this.put = function (data, encoding) { 77 | if (that.stopped) { 78 | throw new Error('Tried to write data to a stopped ReadableStreamBuffer'); 79 | } 80 | if (Buffer.isBuffer(data)) { 81 | increaseBufferIfNecessary(data.length); 82 | data.copy(buffer, size, 0); 83 | size += data.length; 84 | } else { 85 | data = data + ''; 86 | const dataSizeInBytes = Buffer.byteLength(data); 87 | increaseBufferIfNecessary(dataSizeInBytes); 88 | buffer.write(data, size, encoding || 'utf8'); 89 | size += dataSizeInBytes; 90 | } 91 | kickSendDataTask(); 92 | }; 93 | this._read = function () { 94 | allowPush = true; 95 | kickSendDataTask(); 96 | }; 97 | } 98 | } 99 | 100 | export default ReadableStreamBuffer; 101 | 102 | inherits(ReadableStreamBuffer, Readable); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@xcoders-teams/baileys-bot-md", 3 | "author": "FarhanXCode7", 4 | "publisher": "xcoders-teams", 5 | "version": "1.0.5", 6 | "main": "main.js", 7 | "type": "module", 8 | "license": "ISC", 9 | "readme": "README.md", 10 | "description": "simple whatsapp bot for documentation rest api: api-xcoders.site", 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/xcoders-teams/xcodersbot.git" 14 | }, 15 | "bugs": { 16 | "url": "https://github.com/xcoders-teams/xcoders-bot/issues" 17 | }, 18 | "scripts": { 19 | "experimental": "node --experimental-modules main.js", 20 | "start": "node main.js" 21 | }, 22 | "dependencies": { 23 | "@adiwajshing/keyed-db": "^0.2.4", 24 | "@ffmpeg-installer/ffmpeg": "^1.0.13", 25 | "@whiskeysockets/baileys": "^6.3.1", 26 | "archiver": "^5.3.1", 27 | "awesome-phonenumber": "^4.4.1", 28 | "axios": "^1.4.0", 29 | "canvas": "^2.11.2", 30 | "cfonts": "2.9.1", 31 | "chalk": "4.1.2", 32 | "cheerio": "1.0.0-rc.12", 33 | "file-type": "^18.5.0", 34 | "fluent-ffmpeg": "^2.1.2", 35 | "form-data": "^4.0.0", 36 | "lodash": "^4.17.21", 37 | "moment-timezone": "^0.5.43", 38 | "node-cron": "^3.0.2", 39 | "node-fetch": "^3.3.1", 40 | "node-webpmux": "^3.1.7", 41 | "os": "^0.1.2", 42 | "pdfkit": "^0.13.0", 43 | "performance-now": "^2.1.0", 44 | "pino": "^8.14.1", 45 | "request": "^2.88.2", 46 | "similarity": "^1.2.1", 47 | "yargs": "^17.7.2" 48 | }, 49 | "devDependencies": { 50 | "express": "^4.18.2", 51 | "jimp": "^0.16.13", 52 | "qrcode": "^1.5.3", 53 | "qrcode-terminal": "^0.12.0" 54 | } 55 | } -------------------------------------------------------------------------------- /replit.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: { 2 | deps = [ 3 | pkgs.nodejs-18_x 4 | pkgs.nodePackages.typescript-language-server 5 | pkgs.yarn 6 | pkgs.ffmpeg 7 | pkgs.libuuid 8 | pkgs.libwebp 9 | pkgs.git 10 | pkgs.replitPackages.jest 11 | ]; 12 | env = { 13 | LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ 14 | pkgs.libuuid 15 | ]; 16 | }; 17 | } -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | import './configs/global.js'; 2 | import { fetchLatestBaileysVersion } from '@whiskeysockets/baileys'; 3 | import express from 'express'; 4 | import axios from 'axios'; 5 | import qrcode from 'qrcode'; 6 | import util from 'util'; 7 | 8 | import html from './middleware/html.js'; 9 | 10 | const apps = express(); 11 | 12 | apps.set('json spaces', 2); 13 | 14 | apps.get('*', async (_, res) => { 15 | try { 16 | if (global.qrcode) { 17 | const { version, isLatest } = await fetchLatestBaileysVersion(); 18 | const codeQR = await qrcode.toDataURL(global.qrcode, { scale: 10 }); 19 | const generateHTML = html(codeQR, `using WA v${version.join('.')}, isLatest: ${isLatest}`); 20 | res.send(generateHTML); 21 | } else { 22 | const { data } = await axios.get('http://ip-api.com/json'); 23 | res.json({ 24 | status: true, 25 | creator: 'xcoders teams', 26 | server: data 27 | }); 28 | } 29 | } catch (error) { 30 | res.send(util.format(error)); 31 | } 32 | }); 33 | 34 | apps.listen(PORT, () => console.log(`Express connected in port: ${PORT}`)); -------------------------------------------------------------------------------- /storage/fonts/Breaking.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/storage/fonts/Breaking.ttf -------------------------------------------------------------------------------- /storage/fonts/xcode.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/storage/fonts/xcode.ttf -------------------------------------------------------------------------------- /storage/images/angel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/storage/images/angel.png -------------------------------------------------------------------------------- /storage/images/aqua.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/storage/images/aqua.png -------------------------------------------------------------------------------- /storage/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/storage/images/background.png -------------------------------------------------------------------------------- /storage/images/coldsky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/storage/images/coldsky.png -------------------------------------------------------------------------------- /storage/images/darkness.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/storage/images/darkness.png -------------------------------------------------------------------------------- /storage/images/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/storage/images/empty.png -------------------------------------------------------------------------------- /storage/images/peakblue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/storage/images/peakblue.png -------------------------------------------------------------------------------- /storage/images/pinkman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/storage/images/pinkman.png -------------------------------------------------------------------------------- /storage/images/profile_void.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/storage/images/profile_void.png -------------------------------------------------------------------------------- /storage/images/standard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/storage/images/standard.png -------------------------------------------------------------------------------- /storage/images/standart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/storage/images/standart.png -------------------------------------------------------------------------------- /storage/images/transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcoders-teams/xcoders-bot/4cd037d7dc5f8bd9baf05fe0b8fe382b2037c18b/storage/images/transparent.png -------------------------------------------------------------------------------- /temp/data.exif: -------------------------------------------------------------------------------- 1 | II*AW2{"sticker-pack-id":"com.snowcorp.stickerly.android.stickercontentprovider b5e7275f-f1de-4137-961f-57becfad34f2","sticker-pack-name":"Powered By","sticker-pack-publisher":"Farhannnn","emojis":["😯"," 😦"," 😧"," 😮"," 😲"," 🙀"," 😱"," 🤯"," 😳"," ❗"," ❕"," 🤬"," 😡"," 😠"," 🙄"," 👿"," 😾"," 😤"," 💢"," 👺"," 🗯️"," 😒"," 🥵"],"android-app-store-link":"https://play.google.com/store/apps/details?id=com.stickify.stickermaker","ios-app-store-link":"https://itunes.apple.com/app/sticker-maker-studio/id1443326857"} -------------------------------------------------------------------------------- /temp/trash.txt: -------------------------------------------------------------------------------- 1 | gada apa2 --------------------------------------------------------------------------------