├── auth ├── Phantom ├── auth.json └── creds-2.json ├── bdd ├── Phantom ├── alive.js ├── banUser.js ├── banGroup.js ├── cron.js ├── hentai.js ├── onlyAdmin.js ├── welcome.js ├── mention.js ├── warn.js ├── stickcmd.js ├── level.js ├── sudo.js ├── antilien.js └── antibot.js ├── media ├── Phantom ├── rm.gif ├── antibot.gif ├── chrono.webp ├── remover.gif ├── lyrics-img.jpg └── deleted-message.jpg ├── phantom ├── king ├── Phantom ├── proprio.js ├── Reboot.js ├── ping.js ├── img.js ├── parole.js ├── fancy.js ├── voir.js ├── events.js ├── gitclone.js ├── warn.js ├── quote.js ├── profile.js ├── weather.js ├── stickersearch.js ├── tts.js ├── stickcmd.js ├── alive.js ├── repo.js ├── canvacord.js ├── heroku.js ├── menu.js ├── General.js ├── igdl-fb-tk.js ├── reaction.js ├── song.js ├── Answer.js ├── weeb.js ├── devinette.js ├── yt-search.js ├── git.js ├── sc.js ├── script.js ├── menu.js.prec ├── hentai.js ├── anime.js ├── games.js ├── audioedit.js └── rank.js ├── framework ├── Phantom ├── dl │ ├── dl.json │ └── Function.js ├── app.js ├── traduction.js ├── zokou.js ├── imgur.js ├── ytdl-core.js └── index.js ├── .gitignore ├── heroku.yml ├── Dockerfile ├── exemple_de_set.env ├── package.json ├── set.env_example ├── readme.md ├── app.json └── set.js /auth/Phantom: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /bdd/Phantom: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /media/Phantom: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /phantom/king: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /auth/auth.json: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /framework/Phantom: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /phantom/Phantom: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /framework/dl/dl.json: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /media/rm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phantom-kin/Phantom-MD/HEAD/media/rm.gif -------------------------------------------------------------------------------- /media/antibot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phantom-kin/Phantom-MD/HEAD/media/antibot.gif -------------------------------------------------------------------------------- /media/chrono.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phantom-kin/Phantom-MD/HEAD/media/chrono.webp -------------------------------------------------------------------------------- /media/remover.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phantom-kin/Phantom-MD/HEAD/media/remover.gif -------------------------------------------------------------------------------- /media/lyrics-img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phantom-kin/Phantom-MD/HEAD/media/lyrics-img.jpg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /auth 2 | /set.env 3 | /package-lock.json 4 | /node_modules 5 | /store.json 6 | /audio.mp3 -------------------------------------------------------------------------------- /media/deleted-message.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phantom-kin/Phantom-MD/HEAD/media/deleted-message.jpg -------------------------------------------------------------------------------- /heroku.yml: -------------------------------------------------------------------------------- 1 | build: 2 | docker: 3 | worker: Dockerfile 4 | run: 5 | worker: npm run phantom 6 | 7 | 8 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/lyfe00011/md:beta 2 | RUN git clone https://github.com/Phantom-kin/Phantom-MD.git /root/Phantom-kin/ 3 | WORKDIR /root/Phantom-kin/ 4 | RUN yarn install 5 | CMD ["npm", "start"] 6 | -------------------------------------------------------------------------------- /framework/app.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.reagir = void 0; 4 | async function reagir(dest, zok, msg, emoji) { 5 | await zok.sendMessage(dest, { react: { text: emoji, key: msg.key } }); 6 | } 7 | exports.reagir = reagir; 8 | -------------------------------------------------------------------------------- /framework/traduction.js: -------------------------------------------------------------------------------- 1 | const translatte = require('translatte'); 2 | 3 | async function traduire(text, options) { 4 | try { 5 | const result = await translatte(text, options); 6 | return result.text; 7 | } catch (error) { 8 | throw error; 9 | } 10 | } 11 | 12 | module.exports = traduire; 13 | -------------------------------------------------------------------------------- /exemple_de_set.env: -------------------------------------------------------------------------------- 1 | OWNER_NAME="PHANTOM" 2 | PREFIX="," 3 | PUBLIC_MODE='non' 4 | AUTO_READ_STATUS="non" 5 | AUTO_DOWNLOAD_STATUS="oui" 6 | BOT_NAME= "𝙿𝙷𝙰𝙽𝚃𝙾𝙼-𝙼𝙳" 7 | IMAGE_MENU= "https://static.animecorner.me/2023/08/op2.jpg" 8 | NUMERO_OWNER= "27748255848" 9 | OWNER_NAME= "Phantom" 10 | DATABASE_URL= "" 11 | WARN_COUNT= "" 12 | OPENAI_API_KEY= "" 13 | STARTING_BOT_MESSAGE='yes' 14 | ANTI_DELETE_MESSAGE='yes' 15 | -------------------------------------------------------------------------------- /framework/zokou.js: -------------------------------------------------------------------------------- 1 | var tabCmds = []; 2 | let cm = []; 3 | function zokou(obj, fonctions) { 4 | let infoComs = obj; 5 | if (!obj.categorie) { 6 | infoComs.categorie = "General"; 7 | } 8 | if (!obj.reaction) { 9 | infoComs.reaction = "✅"; 10 | } 11 | infoComs.fonction = fonctions; 12 | cm.push(infoComs); 13 | // console.log('chargement...') 14 | return infoComs; 15 | } 16 | module.exports = { zokou, Module: zokou, cm }; 17 | -------------------------------------------------------------------------------- /phantom/proprio.js: -------------------------------------------------------------------------------- 1 | const {zokou}=require("../framework/zokou") 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | zokou({nomCom:"reboot",categorie:"Mods",reaction:"👨🏿‍💼"},async(dest,z,com)=>{ 10 | 11 | 12 | 13 | const{repondre,ms,dev,superUser}=com; 14 | 15 | if(!superUser) 16 | { 17 | return repondre("This command is for owner only"); 18 | } 19 | 20 | const {exec}=require("child_process") 21 | 22 | repondre("*restarting ...*"); 23 | 24 | exec("pm2 restart all"); 25 | 26 | 27 | 28 | 29 | 30 | 31 | }) -------------------------------------------------------------------------------- /phantom/Reboot.js: -------------------------------------------------------------------------------- 1 | const {zokou}=require("../framework/zokou") 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | zokou({nomCom:"restart",categorie:"Mods",reaction:"📴"},async(dest,z,com)=>{ 10 | 11 | 12 | 13 | const{repondre,ms,dev,superUser}=com; 14 | 15 | if(!superUser) 16 | { 17 | return repondre("This command is for owner only"); 18 | } 19 | 20 | const {exec}=require("child_process") 21 | 22 | repondre("Phantom-MD Bot Restarting ⏳"); 23 | 24 | exec("pm2 restart all"); 25 | 26 | 27 | 28 | 29 | 30 | 31 | }) 32 | -------------------------------------------------------------------------------- /phantom/ping.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const { zokou } = require("../framework/zokou"); 4 | zokou({ nomCom: "test", reaction: "🧒", nomFichier: __filename }, async (dest, zk, commandeOptions) => { 5 | console.log("Commande saisie !!!s"); 6 | let z = '*🌍𝙱𝙾𝚃 𝙸𝚂 𝙾𝙽𝙻𝙸𝙽𝙴🌍* 🙏 \n\n ' + "𝚃𝙷𝙴 𝙱𝙾𝚃 𝙸𝚂 𝚁𝚄𝙽𝙽𝙸𝙽𝙶 𝙾𝙽 𝙶𝙾 𝚂𝙿𝙴𝙴𝙳😉👍"; 7 | let d = ' 𝚃𝙴𝚂𝚃 𝚂𝚃𝙰𝚃𝚄𝚂✨'; 8 | let varmess = z + d; 9 | var jpg = 'https://files.catbox.moe/uuye39.jpg'; 10 | await zk.sendMessage(dest, { image: { url: jpg }, caption: varmess }); 11 | //console.log("montest") 12 | 13 | console.log("mon test"); 14 | -------------------------------------------------------------------------------- /phantom/img.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | const {zokou} = require('../framework/zokou'); 5 | var gis = require('g-i-s'); 6 | 7 | 8 | zokou({ 9 | nomCom: "img", 10 | categorie: "Search", 11 | reaction: "📷" 12 | }, 13 | async (dest, zk, commandeOptions) => { 14 | const { repondre, ms, arg } = commandeOptions; 15 | 16 | if (!arg[0]) { 17 | repondre('Bro...Phantom-MD is asking you to be specific!'); 18 | return; 19 | } 20 | 21 | const searchTerm = arg.join(" "); 22 | //repondre("termes " +searchTerm); 23 | gis(searchTerm,envoiImage); 24 | 25 | function envoiImage(e,r) 26 | { 27 | if(e){repondre("oups une error ")}else{for(var a=0;a<5;a++){zk.sendMessage(dest,{image:{url:r[a].url}},{quoted:ms});}} 28 | 29 | } 30 | 31 | //gis(searchTerm,envoiImage); 32 | 33 | }); 34 | -------------------------------------------------------------------------------- /framework/imgur.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const fs = require('fs'); 3 | const FormData = require('form-data'); 4 | 5 | async function uploadImageToImgur(imagePath, clientId) { 6 | try { 7 | const data = new FormData(); 8 | data.append('image', fs.createReadStream(imagePath)); 9 | 10 | const headers = { 11 | 'Authorization': `Client-ID ${clientId}`, 12 | ...data.getHeaders() 13 | }; 14 | 15 | const config = { 16 | method: 'post', 17 | maxBodyLength: Infinity, 18 | url: 'https://api.imgur.com/3/image', 19 | headers: headers, 20 | data: data 21 | }; 22 | 23 | const response = await axios(config); 24 | const imageUrl = response.data.data.link; 25 | return imageUrl; 26 | } catch (error) { 27 | console.error('Erreur lors de l\'envoi sur Imgur:', error); 28 | throw new Error('Une erreur est survenue lors de l\'envoi sur Imgur.'); 29 | } 30 | } 31 | 32 | module.exports = { uploadImageToImgur }; 33 | -------------------------------------------------------------------------------- /phantom/parole.js: -------------------------------------------------------------------------------- 1 | const {zokou} =require("../framework/zokou"); 2 | const axios =require("axios"); 3 | 4 | 5 | zokou({ nomCom: "lyrics", 6 | reaction: "✨", 7 | categorie: "Search" }, async (dest, zk, commandeOptions) => { 8 | 9 | const { repondre, arg, ms } = commandeOptions; 10 | 11 | try { 12 | 13 | if (!arg || arg.length === 0) return repondre("Where is the name of musique"); 14 | 15 | let result = await axios.get(`https://vihangayt.me/search/lyrics?q=${arg.join(' ')}`); 16 | 17 | let lyrics = result.data.data; 18 | 19 | if (lyrics.error) return repondre("no lyrics found"); 20 | 21 | let msg = `---------Phantom-lyrics-finder-------- 22 | 23 | * *Artist :* ${lyrics.artist} 24 | 25 | 26 | * *Title :* ${lyrics.title} 27 | 28 | 29 | ${lyrics.lyrics}` 30 | 31 | zk.sendMessage(dest,{image : { url : './media/lyrics-img.jpg'} , caption : msg}, { quoted : ms }); 32 | 33 | } catch (err) { 34 | repondre('Error') 35 | } 36 | }) 37 | -------------------------------------------------------------------------------- /phantom/fancy.js: -------------------------------------------------------------------------------- 1 | const { zokou } = require("../framework/zokou"); 2 | const fancy = require("../bmw/style"); 3 | 4 | zokou({ nomCom: "fancy", categorie: "Fun", reaction: "〽️" }, async (dest, zk, commandeOptions) => { 5 | const { arg, repondre, prefixe } = commandeOptions; 6 | const id = arg[0]?.match(/\d+/)?.join(''); 7 | const text = arg.slice(1).join(" "); 8 | 9 | try { 10 | if (id === undefined || text === undefined) { 11 | return await repondre(`\nExemple : ${prefixe}fancy 13 Phantom-MD\n` + String.fromCharCode(8206).repeat(4001) + fancy.list('PHANTOM-MD', fancy)); 12 | } 13 | 14 | const selectedStyle = fancy[parseInt(id) - 1]; 15 | if (selectedStyle) { 16 | return await repondre(fancy.apply(selectedStyle, text)); 17 | } else { 18 | return await repondre('_Style introuvable :(_'); 19 | } 20 | } catch (error) { 21 | console.error(error); 22 | return await repondre('_Une erreur s\'est produite :(_'); 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /framework/ytdl-core.js: -------------------------------------------------------------------------------- 1 | const yts = require('yt-search'); 2 | const ytdl = require('ytdl-core'); 3 | const fs = require('fs'); 4 | 5 | 6 | /* fonction pour avoir les données d'une recherche*/ 7 | 8 | async function getytlink(key) { 9 | try { 10 | const resultat = await yts(key); 11 | const videos = resultat.videos; 12 | const choix = videos[0]; 13 | return { 14 | lien : choix.url , 15 | affiche : choix.thumbnail, 16 | titre : choix.title, 17 | duree : choix.timestamp, 18 | id : choix.videoId, 19 | } ; 20 | } catch (erreur) { 21 | console.error('Erreur lors de la recherche YouTube :', erreur); 22 | return null; 23 | } 24 | } 25 | 26 | module.exports = getytlink; 27 | 28 | /* fonction pour télécharger les videos avec ytdl-core*/ 29 | 30 | 31 | 32 | 33 | 34 | async function ytdwn(url) { 35 | const info = await ytdl.getInfo(url); 36 | const format = ytdl.chooseFormat(info.formats, { quality: '18' }); 37 | const video = ytdl.downloadFromInfo(info, format) 38 | 39 | return video ; 40 | 41 | } 42 | 43 | module.exports = ytdwn; 44 | 45 | 46 | -------------------------------------------------------------------------------- /phantom/voir.js: -------------------------------------------------------------------------------- 1 | const {zokou}=require("../framework/zokou") ; 2 | 3 | 4 | 5 | zokou({nomCom:"vv",categorie:"General",reaction:"🤲🏿"},async(dest,zk,commandeOptions)=>{ 6 | 7 | const {ms,msgRepondu,repondre}=commandeOptions; 8 | 9 | 10 | if(!msgRepondu){return repondre("*Mention a view once media* .");} 11 | 12 | 13 | if(msgRepondu.viewOnceMessageV2) 14 | { 15 | if(msgRepondu.viewOnceMessageV2.message.imageMessage) 16 | { 17 | var image =await zk.downloadAndSaveMediaMessage(msgRepondu.viewOnceMessageV2.message.imageMessage) 18 | var texte = msgRepondu.viewOnceMessageV2.message.imageMessage.caption 19 | 20 | await zk.sendMessage(dest,{image:{url:image},caption:texte},{quoted:ms}) 21 | }else if(msgRepondu.viewOnceMessageV2.message.videoMessage){ 22 | 23 | var video = await zk.downloadAndSaveMediaMessage(msgRepondu.viewOnceMessageV2.message.videoMessage) 24 | var texte =msgRepondu.viewOnceMessageV2.message.videoMessage.caption 25 | 26 | 27 | await zk.sendMessage(dest,{video:{url:video},caption:texte},{quoted:ms}) 28 | 29 | } 30 | }else 31 | { 32 | return repondre("this message is not on view once .") 33 | } 34 | 35 | 36 | 37 | }) 38 | -------------------------------------------------------------------------------- /phantom/events.js: -------------------------------------------------------------------------------- 1 | const { zokou } = require('../framework/zokou'); 2 | const { attribuerUnevaleur } = require('../bdd/welcome'); 3 | 4 | async function events(nomCom) { 5 | zokou({ 6 | nomCom: nomCom, 7 | categorie: 'Group' 8 | }, async (dest, zk, commandeOptions) => { 9 | const { ms, arg, repondre, superUser, verifAdmin } = commandeOptions; 10 | 11 | if (verifAdmin || superUser) { 12 | if (!arg[0] || arg.join(' ') === ' ') { 13 | repondre(nomCom + ' ' + ' on to active and ' + ' ' + nomCom + ' ' + 'off to put off'); 14 | } else { 15 | if (arg[0] === 'on' || arg[0] === 'off') { 16 | 17 | await attribuerUnevaleur(dest, nomCom, arg[0]); 18 | repondre( nomCom + "is actualised on " + arg[0]); 19 | } else { 20 | repondre('on for active and off for desactive'); 21 | } 22 | } 23 | } else { 24 | repondre('You can\'t use this command lol '); 25 | } 26 | }); 27 | } 28 | 29 | // Appel de la fonction events pour les valeurs 'welcome' et 'goodbye' 30 | events('welcome'); 31 | events('goodbye'); 32 | events('antipromote'); 33 | events('antidemote') ; 34 | -------------------------------------------------------------------------------- /framework/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.genererNomFichier = exports.stick = exports.format = exports.styletext = exports.zJson = exports.getBuffer = exports.reaction = exports.police = exports.zokou = void 0; 4 | let { zokou } = require("./zokou"); 5 | exports.zokou = zokou; 6 | const mesfonctions_1 = require("./mesfonctions"); 7 | Object.defineProperty(exports, "reaction", { enumerable: true, get: function () { return mesfonctions_1.reaction; } }); 8 | Object.defineProperty(exports, "police", { enumerable: true, get: function () { return mesfonctions_1.police; } }); 9 | Object.defineProperty(exports, "getBuffer", { enumerable: true, get: function () { return mesfonctions_1.getBuffer; } }); 10 | Object.defineProperty(exports, "zJson", { enumerable: true, get: function () { return mesfonctions_1.zJson; } }); 11 | Object.defineProperty(exports, "format", { enumerable: true, get: function () { return mesfonctions_1.format; } }); 12 | Object.defineProperty(exports, "styletext", { enumerable: true, get: function () { return mesfonctions_1.styletext; } }); 13 | Object.defineProperty(exports, "stick", { enumerable: true, get: function () { return mesfonctions_1.stick; } }); 14 | Object.defineProperty(exports, "genererNomFichier", { enumerable: true, get: function () { return mesfonctions_1.genererNomFichier; } }); 15 | var { reagir } = require("./app"); 16 | -------------------------------------------------------------------------------- /phantom/gitclone.js: -------------------------------------------------------------------------------- 1 | const { 2 | zokou 3 | } = require("../framework/zokou"); 4 | zokou({ 5 | 'nomCom': 'github', 6 | 'reaction': '✅, 7 | 'categorie': "Search" 8 | }, 9 | async (_0x52e003, _0x14d9f6, _0x5f1e4d) => { 10 | const _0x3c7f3f = _0x4f7595.join(" "); 11 | if (!_0x3c7f3f) { 12 | return _0x3b1d82("Give me a valid github username like: " + _0x4fdb82 + "github Phantom-kin"); 13 | } 14 | const _0x5d3fd3 = await fetch("https://api.github.com/users/" + _0x3c7f3f); 15 | const _0x546dd2 = await _0x5d3fd3.json(); 16 | const _0x5892a1 = _0x546dd2.id; 17 | const _0x9d02ae = _0x546dd2.name; 18 | const _0x406595 = _0x546dd2.login; 19 | const _0x3a4d0f = _0x546dd2.bio; 20 | const _0x34623f = _0x546dd2.company; 21 | const _0x5b8e0e = _0x546dd2.location; 22 | const _0x24d738 = _0x546dd2.email; 23 | const _0x3a22e7 = _0x546dd2.blog; 24 | const _0x170599 = _0x546dd2.repos_url; 25 | const _0x1ada1e = _0x546dd2.gists_url; 26 | const _0x1f7a0c = _0x546dd2.followers; 27 | const _0x86d2d1 = _0x546dd2.following; 28 | await _0x3b1d82("\n °GITHUB USER INFO°\n \n🚩 Id : " + _0x5892a1 + "\n🔖 Name : " + _0x9d02ae + "\n🔖 Username : " + _0x406595 + "\n✨ Bio : " + _0x3a4d0f + "\n🏢 Company : " + _0x34623f + "\n📍 Location : " + _0x5b8e0e + "\n📧 Email : " + _0x24d738 + "\n📰 Blog : " + _0x3a22e7 + "\n🔓 Public Repo : " + _0x170599 + "\n🔐 Public Gists : " + _0x1ada1e + "\n👪 Followers : " + _0x1f7a0c + "\n🫶 Following : " + _0x86d2d1); 29 | }); 30 | -------------------------------------------------------------------------------- /phantom/warn.js: -------------------------------------------------------------------------------- 1 | const { zokou } = require('../framework/zokou'); 2 | const {ajouterUtilisateurAvecWarnCount , getWarnCountByJID , resetWarnCountByJID} = require('../bdd/warn') 3 | const s = require("../set") 4 | 5 | 6 | zokou( 7 | { 8 | nomCom : 'warn', 9 | categorie : 'Group' 10 | 11 | },async (dest,zk,commandeOptions) => { 12 | 13 | const {ms , arg, repondre,superUser,verifGroupe,verifAdmin , msgRepondu , auteurMsgRepondu} = commandeOptions; 14 | if(!verifGroupe ) {repondre('this is a group commands') ; return}; 15 | 16 | if(verifAdmin || superUser) { 17 | if(!msgRepondu){repondre('reply a message of user to warn'); return}; 18 | 19 | if (!arg || !arg[0] || arg.join('') === '') { 20 | await ajouterUtilisateurAvecWarnCount(auteurMsgRepondu) 21 | let warn = await getWarnCountByJID(auteurMsgRepondu) 22 | let warnlimit = s.WARN_COUNT 23 | 24 | if( warn >= warnlimit ) { await repondre('this user reach limit of warning , so i kick him/her'); 25 | zk.groupParticipantsUpdate(dest, [auteurMsgRepondu], "remove") 26 | } else { 27 | 28 | var rest = warnlimit - warn ; 29 | repondre(`this user is warn , rest before kick : ${rest} `) 30 | } 31 | } else if ( arg[0] === 'reset') { await resetWarnCountByJID(auteurMsgRepondu) 32 | 33 | repondre("Warn count is reset for this user")} else ( repondre('reply to a user by typing .warn ou .warn reset')) 34 | 35 | } else { 36 | repondre('you are not admin') 37 | } 38 | 39 | }); -------------------------------------------------------------------------------- /phantom/quote.js: -------------------------------------------------------------------------------- 1 | const { zokou } = require('../framework/zokou'); 2 | 3 | zokou({ nomCom: 'quote', categorie: 'Fun' }, async (dest, zk, commandeOptions) => { 4 | const { ms, repondre, verifGroupe, arg } = commandeOptions; 5 | if (!verifGroupe) { 6 | repondre('Commande réservée au groupe uniquement'); 7 | return; 8 | } 9 | 10 | if (!arg[0]) { 11 | try { 12 | fetch('https://animechan.xyz/api/random') 13 | .then((response) => response.json()) 14 | .then(async (quote) => { 15 | repondre(`╔══════════════════════════╗ 16 | ║ Phantom-MD ║ 17 | ╚══════════════════════════╝ 18 | 19 | 🎬 Anime: ${quote.anime} 20 | 👤 Character: ${quote.character} 21 | 💬 Quote: ${quote.quote} 22 | 23 | Powered By Phantom-MD`); 24 | }); 25 | } catch (e) { 26 | repondre('Erreur lors de la génération de la citation : ' + e.message); 27 | } 28 | } else { 29 | const query = arg.join(' '); 30 | 31 | try { 32 | fetch('https://animechan.xyz/api/random/character?name=' + query) 33 | .then((response) => response.json()) 34 | .then(async (quote) => { 35 | repondre(`╔══════════════════════════╗ 36 | ║ Phantom-MD ║ 37 | ╚══════════════════════════╝ 38 | 39 | 🎬 Anime: ${quote.anime} 40 | 👤 Character: ${quote.character} 41 | 💬 Quote: ${quote.quote} 42 | 43 | Powered By Phantom-MD`); 44 | }); 45 | } catch (e) { 46 | repondre('Erreur lors de la génération de la citation : ' + e.message); 47 | } 48 | } 49 | }); 50 | -------------------------------------------------------------------------------- /phantom/profile.js: -------------------------------------------------------------------------------- 1 | const {zokou} = require("../framework/zokou"); 2 | const conf = require("../set") 3 | const {jidDecode}=require("@whiskeysockets/baileys") 4 | 5 | 6 | zokou( { 7 | nomCom : "profile", 8 | categorie : "Fun", 9 | }, 10 | async(dest,zk, commandeOptions)=> { 11 | 12 | const {ms , arg, repondre,auteurMessage,nomAuteurMessage, msgRepondu , auteurMsgRepondu} = commandeOptions ; 13 | let jid = null 14 | let nom = null ; 15 | 16 | 17 | 18 | 19 | 20 | if (!msgRepondu) { 21 | jid = auteurMessage; 22 | nom = nomAuteurMessage; 23 | 24 | try { ppUrl = await zk.profilePictureUrl(jid , 'image') ; } catch { ppUrl = conf.IMAGE_MENU}; 25 | const status = await zk.fetchStatus(jid) ; 26 | 27 | mess = { 28 | image : { url : ppUrl }, 29 | caption : '*Nom :* '+ nom + '\n*Status :*\n' + status.status 30 | } 31 | 32 | } else { 33 | jid = auteurMsgRepondu; 34 | nom ="@"+auteurMsgRepondu.split("@")[0] ; 35 | 36 | try { ppUrl = await zk.profilePictureUrl(jid , 'image') ; } catch { ppUrl = conf.IMAGE_MENU}; 37 | const status = await zk.fetchStatus(jid) ; 38 | 39 | mess = { 40 | image : { url : ppUrl }, 41 | caption : '*Name :* '+ nom + '\n*Status :*\n' + status.status, 42 | mentions:[auteurMsgRepondu] 43 | } 44 | 45 | } ; 46 | 47 | 48 | 49 | 50 | 51 | zk.sendMessage(dest,mess,{quoted : ms}) 52 | }); 53 | -------------------------------------------------------------------------------- /phantom/weather.js: -------------------------------------------------------------------------------- 1 | const { 2 | zokou 3 | } = require("../framework/zokou"); 4 | zokou({ 5 | 'nomCom': "weather", 6 | 'reaction': "🌡️", 7 | 'categorie': "Search" 8 | }, 9 | async (_0x626df9, _0x17e5bb, _0x37baf6) => { 10 | const _0x445647 = _0x1180fa.join(" "); 11 | if (!_0x445647) { 12 | return _0xecdf09("Give me location..."); 13 | } 14 | const _0x470189 = await fetch("https://api.openweathermap.org/data/2.5/weather?q=" + _0x445647 + "&units=metric&appid=060a6bcfa19809c2cd4d97a212b19273&language=en"); 15 | const _0x4bfc6 = await _0x470189.json(); 16 | const _0x3cf19a = _0x4bfc6.name; 17 | const _0x52e997 = _0x4bfc6.main.temp; 18 | const _0x32180e = _0x4bfc6.weather[0x0].description; 19 | const _0x2da493 = _0x4bfc6.main.humidity; 20 | const _0x368581 = _0x4bfc6.wind.speed; 21 | const _0x28a97c = _0x4bfc6.rain ? _0x4bfc6.rain['1h'] : 0x0; 22 | const _0x39a4af = _0x4bfc6.clouds.all; 23 | const _0x41b2f8 = new Date(_0x4bfc6.sys.sunrise * 0x3e8); 24 | const _0x4393a0 = new Date(_0x4bfc6.sys.sunset * 0x3e8); 25 | await _0xecdf09(" *SUPER-MD WEATHER UPDATES* \n\n❄️ Weather in " + _0x3cf19a + "\n\n🌡️ *Temperature:* " + _0x52e997 + "°C\n📝 *Description:* " + _0x32180e + "\n❄️ *Humidity:* " + _0x2da493 + "%\n🌀 *Wind Speed:* " + _0x368581 + " m/s\n🌧️ *Rain Volume (last hour):* " + _0x28a97c + " mm\n☁️ *Cloudiness:* " + _0x39a4af + "%\n🌄 *Sunrise:* " + _0x41b2f8.toLocaleTimeString() + "\n🌅 *Sunset:* " + _0x4393a0.toLocaleTimeString() + "\n🌫️ *Latitude:* " + _0x4bfc6.coord.lat + "\n🌪️ *Longitude:* " + _0x4bfc6.coord.lon + "\n\n🗺 *Country:* " + _0x4bfc6.sys.country + "\n\n\n*°Powered By Phantom-MD*"); 26 | }); 27 | -------------------------------------------------------------------------------- /phantom/stickersearch.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | const { Sticker, StickerTypes } = require("wa-sticker-formatter"); 3 | const {zokou} = require("../framework/zokou"); 4 | 5 | zokou({ 6 | nomCom: "stickersearch", 7 | categorie: 'Search', 8 | reaction: "🍁" 9 | }, 10 | async (dest, zk, commandeOptions) => { 11 | const { repondre, ms, arg, nomAuteurMessage } = commandeOptions; 12 | 13 | if (!arg[0]) { 14 | repondre("where is the request ? !"); 15 | return; 16 | } 17 | 18 | const gifSearchTerm = arg.join(" "); 19 | const tenorApiKey = "AIzaSyCyouca1_KKy4W_MG1xsPzuku5oa8W358c"; // Remplacez par votre clé d'API Tenor 20 | 21 | try { for ( i = 0 ; i < 5 ; i++) { 22 | const gif = await axios.get( 23 | `https://tenor.googleapis.com/v2/search?q=${gifSearchTerm}&key=${tenorApiKey}&client_key=my_project&limit=8&media_filter=gif` 24 | ); 25 | 26 | const gifUrl = gif.data.results[i].media_formats.gif.url; 27 | 28 | 29 | 30 | 31 | // Assurez-vous de remplacer les valeurs manquantes dans la création du sticker 32 | const packname = nomAuteurMessage; // Remplacez par le nom de votre pack de stickers 33 | 34 | const stickerMess = new Sticker(gifUrl, { 35 | pack: packname, 36 | author: 'Phantom-MD', 37 | type: StickerTypes.FULL, 38 | categories: ["🤩", "🎉"], 39 | id: "12345", 40 | quality: 60, 41 | background: "transparent", 42 | }); 43 | const stickerBuffer2 = await stickerMess.toBuffer(); 44 | zk.sendMessage(dest, { sticker: stickerBuffer2 }, { quoted: ms }); } 45 | } catch (error) { 46 | console.error("Erreur lors de la recherche de stickers :", error); 47 | repondre("Erreur lors de la recherche de stickers."); 48 | } 49 | }); 50 | -------------------------------------------------------------------------------- /phantom/tts.js: -------------------------------------------------------------------------------- 1 | const googleTTS = require('google-tts-api'); 2 | const {zokou} = require("../framework/zokou"); 3 | 4 | 5 | zokou( { 6 | nomCom : "dit", 7 | categorie : "tts", 8 | reaction : "👄" }, 9 | async(dest,zk, commandeOptions)=> { 10 | 11 | const {ms,arg,repondre} = commandeOptions; 12 | if (!arg[0]) {repondre("Insert a word");return} ; 13 | const mots = arg.join(" ") 14 | 15 | const url = googleTTS.getAudioUrl( mots, { 16 | lang: 'fr', 17 | slow: false, 18 | host: 'https://translate.google.com', 19 | }); 20 | console.log(url); 21 | zk.sendMessage(dest, { audio: { url:url},mimetype:'audio/mp4' }, { quoted: ms,ptt: true }); 22 | 23 | 24 | 25 | } 26 | ) ; 27 | 28 | zokou( { 29 | nomCom : "itta", 30 | categorie : "tts", 31 | reaction : "👄" }, 32 | async(dest,zk, commandeOptions)=> { 33 | 34 | const {ms,arg,repondre} = commandeOptions; 35 | if (!arg[0]) {repondre("Insert a word");return} ; 36 | const mots = arg.join(" ") 37 | 38 | const url = googleTTS.getAudioUrl( mots, { 39 | lang: 'ja', 40 | slow: false, 41 | host: 'https://translate.google.com', 42 | }); 43 | console.log(url); 44 | zk.sendMessage(dest, { audio: { url:url},mimetype:'audio/mp4' }, { quoted: ms,ptt: true }); 45 | 46 | 47 | 48 | } 49 | ) ; 50 | 51 | zokou( { 52 | nomCom : "say", 53 | categorie : "tts", 54 | reaction : "👄" }, 55 | async(dest,zk, commandeOptions)=> { 56 | 57 | const {ms,arg,repondre} = commandeOptions; 58 | if (!arg[0]) {repondre("Insert a word");return} ; 59 | const mots = arg.join(" ") 60 | 61 | const url = googleTTS.getAudioUrl( mots, { 62 | lang: 'en', 63 | slow: false, 64 | host: 'https://translate.google.com', 65 | }); 66 | console.log(url); 67 | zk.sendMessage(dest, { audio: { url:url},mimetype:'audio/mp4' }, { quoted: ms,ptt: true }); 68 | 69 | 70 | 71 | } 72 | ) ; 73 | 74 | -------------------------------------------------------------------------------- /auth/creds-2.json: -------------------------------------------------------------------------------- 1 | {"noiseKey":{"private":{"type":"Buffer","data":"8AIVqeax6f1Zj4uJh0AUfBzcIxlxMC8nKGL+zArBkFg="},"public":{"type":"Buffer","data":"Q/8LG0pK1WcEQY6RnwnimmRoC11Q0+64m84Rq+KtQD8="}},"pairingEphemeralKeyPair":{"private":{"type":"Buffer","data":"yP3KcxC+1TZkmYvH1zc3mJRcYzRLoNoi3azUnA3TnXU="},"public":{"type":"Buffer","data":"7oeZyNybY/wxIlR9lqhGkt+PAWYAkARDuWWrR/Vv2UA="}},"signedIdentityKey":{"private":{"type":"Buffer","data":"YFoS/QqF0wgVahisE96MxCMg0K+oSK1TCjNN6bRaeWY="},"public":{"type":"Buffer","data":"M9uPS0PRPMg2PeXjr5F/QHKQENxdoMHVzXm/XwLFH38="}},"signedPreKey":{"keyPair":{"private":{"type":"Buffer","data":"uLEgdV+8YOmXSQGAANIDb/7u63v+s17E3QowDiY3uEs="},"public":{"type":"Buffer","data":"fQ2Tbc9kIxk6B1hXxfWqrtt7PAvIDpI0sVJuVZ34HRU="}},"signature":{"type":"Buffer","data":"EuYOxVGvQBogu0Oq6/s1QYplmVqV6SPwJUQdp8TRB78sfAOWliO4cb95a1rfTpzU7fgZbxK/0mdCIFIam3pciw=="},"keyId":1},"registrationId":51,"advSecretKey":"THZOQ67Fh4a5S9qDq9m80v9sGh5JQs5/eL0VnSJXfRw=","processedHistoryMessages":[],"nextPreKeyId":31,"firstUnuploadedPreKeyId":31,"accountSyncCounter":0,"accountSettings":{"unarchiveChats":false},"deviceId":"H3aao8VLTLqBDscyLKtAcw","phoneId":"da450a09-c8ac-4028-a244-a233413776a3","identityId":{"type":"Buffer","data":"9fV+t198a+xL4hfDzqoM2wyXR9A="},"registered":true,"backupToken":{"type":"Buffer","data":"BwdyE5P+ShrbZlE49adiDRcC0Tc="},"registration":{},"pairingCode":"5ZP514L9","me":{"id":"254710772666:87@s.whatsapp.net","name":"Ibrahim Adams"},"account":{"details":"CO6ehacDEI2luLQGGAMgACgA","accountSignatureKey":"l+KuMQPS+2B6i6fBRlQSD3nhTpgOWytb5KLaTRAr8W0=","accountSignature":"8c0U8y4+tW+Y9j3g7ymrAwp8+wa7+gWPsqDh5YETET49LXpGciMDm/B+6qLXzAJskYbNePcImKkVLFgEhD91BA==","deviceSignature":"2SUXPwPCv96GY59Z4ZaI7GY27zpHzzLJHWS0CkdpUG8xVLnT+N4bcMVkHQSqhOm58XbDvrCiIfKENSBjlJjKgg=="},"signalIdentities":[{"identifier":{"name":"254710772666:87@s.whatsapp.net","deviceId":0},"identifierKey":{"type":"Buffer","data":"BZfirjED0vtgeounwUZUEg954U6YDlsrW+Si2k0QK/Ft"}}],"platform":"smba","lastAccountSyncTimestamp":1720586906,"myAppStateKeyId":"AAAAAAKa"} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Phantom-MD", 3 | "version": "2.0.0", 4 | "description": "", 5 | "main": "phantom.js", 6 | "scripts": { 7 | "test": "node phantom.js", 8 | "s": "node phantom.js", 9 | "phantom": "pm2 start phantom.js --attach", 10 | "phantom": "pm2 start phantom.js --attach", 11 | "c": "tsc" 12 | }, 13 | "keywords": [ 14 | "bot", 15 | "Baileys", 16 | "Bmw-md", 17 | "whatsapp", 18 | "whatsapp-bot", 19 | "bmw-md-boy" 20 | ], 21 | "author": "Phantom", 22 | "license": "ISC", 23 | "dependencies": { 24 | "@adiwajshing/keyed-db": "^0.2.4", 25 | "@hapi/boom": "^10.0.1", 26 | "@types/node": "^18.0.6", 27 | "@whiskeysockets/baileys": "github:Luffy2ndAccount/Baileys", 28 | "ytdl-core": "github:franceking1/flash-dls", 29 | "@xaviabot/fb-downloader": "^1.0.14", 30 | "aptoide-scraper": "^1.0.1", 31 | "axios": "^1.4.0", 32 | "cache-manager": "latest", 33 | "canvacord": "^5.4.8", 34 | "chal": "^0.0.1-security.0", 35 | "chalk": "^5.3.0", 36 | "cheerio": "^1.0.0-rc.12", 37 | "dotenv": "^16.3.1", 38 | "ffmpeg": "^0.0.4", 39 | "file-type": "16.5.3", 40 | "fluent-ffmpeg": "^2.1.2", 41 | "form-data": "^4.0.0", 42 | "fs-extra": "^11.1.1", 43 | "g-i-s": "^2.1.7", 44 | "gist": "^0.2.0", 45 | "genius-lyrics": "^4.4.3", 46 | "google-it": "^1.6.4", 47 | "google-tts-api": "latest", 48 | "heroku-client": "^3.1.0", 49 | "human-readable": "^0.2.1", 50 | "javascript-obfuscator": "^4.1.0", 51 | "jimp": "^0.16.13", 52 | "latest": "^0.2.0", 53 | "link-preview-js": "^3.0.4", 54 | "moment-timezone": "^0.5.43", 55 | "mumaker": "^2.0.0", 56 | "node-cron": "^3.0.3", 57 | "node-fetch": "^3.2.6", 58 | "node-id3": "^0.2.6", 59 | "pg": "^8.11.2", 60 | "pino": "^8.15.0", 61 | "qrcode-terminal": "^0.12.0", 62 | "readline": "^1.3.0", 63 | "sequelize": "^6.32.1", 64 | "sqlite3": "^5.1.6", 65 | "translatte": "^3.0.1", 66 | "types": "^0.1.1", 67 | "typescript": "^5.1.6", 68 | "wa-sticker-formatter": "^4.4.4", 69 | "youtube-yts": "^2.0.0", 70 | "yt-search": "^2.10.4", 71 | "youtubedl-core": "^4.11.7" 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /phantom/stickcmd.js: -------------------------------------------------------------------------------- 1 | const {zokou }= require ('../framework/zokou') ; 2 | const {addstickcmd, deleteCmd, getCmdById, inStickCmd , getAllStickCmds} = require('../bdd/stickcmd') ; 3 | 4 | 5 | 6 | zokou( 7 | { 8 | nomCom : 'setcmd', 9 | categorie : 'stickcmd' 10 | 11 | }, async (dest,zk,commandeOptions) => { 12 | 13 | const {ms , arg, repondre,superUser , msgRepondu} = commandeOptions; 14 | 15 | if (!superUser) { repondre('you can\'t use this command') ; return} ; 16 | 17 | if(msgRepondu && msgRepondu.stickerMessage ) { 18 | 19 | if(!arg || !arg[0]) { repondre('put the name of the command') ; return} ; 20 | 21 | 22 | await addstickcmd(arg[0].toLowerCase() , msgRepondu.stickerMessage.url ) ; 23 | 24 | repondre('Stick cmd save successfully') 25 | 26 | } else { 27 | 28 | repondre('mention a sticker') 29 | } 30 | 31 | }) ; 32 | 33 | zokou( 34 | { 35 | nomCom: 'delcmd', 36 | categorie: 'stickcmd' 37 | }, 38 | async (dest, zk, commandeOptions) => { 39 | 40 | const { ms, arg, repondre, superUser } = commandeOptions; 41 | 42 | if (!superUser) { 43 | repondre('only Mods can use this command'); 44 | return; 45 | } 46 | 47 | if (!arg || !arg[0]) { 48 | repondre('put the name of the command that you want to delete'); 49 | return; 50 | } 51 | 52 | const cmdToDelete = arg[0]; 53 | 54 | 55 | try { 56 | await deleteCmd(cmdToDelete.toLowerCase()); 57 | repondre(`the commande ${cmdToDelete} is deleted successfully.`); 58 | } catch { 59 | repondre(`the command ${cmdToDelete} don't existe`); 60 | } 61 | } 62 | ); 63 | 64 | 65 | zokou( 66 | { 67 | nomCom: 'allcmd', 68 | categorie: 'stickcmd' 69 | }, 70 | async (dest, zk, commandeOptions) => { 71 | const { repondre, superUser } = commandeOptions; 72 | 73 | if (!superUser) { 74 | repondre('only Mods can use this command'); 75 | return; 76 | } 77 | 78 | const allCmds = await getAllStickCmds(); 79 | 80 | if (allCmds.length > 0) { 81 | const cmdList = allCmds.map(cmd => cmd.cmd).join(', '); 82 | repondre(`*List of all stickcmd :* 83 | ${cmdList}`); 84 | } else { 85 | repondre('No stickcmd save'); 86 | } 87 | } 88 | ); 89 | -------------------------------------------------------------------------------- /phantom/alive.js: -------------------------------------------------------------------------------- 1 | const { zokou } = require('../framework/zokou'); 2 | const {addOrUpdateDataInAlive , getDataFromAlive} = require('../bdd/alive') 3 | const moment = require("moment-timezone"); 4 | const s = require(__dirname + "/../set"); 5 | 6 | zokou( 7 | { 8 | nomCom : 'alive', 9 | categorie : 'General' 10 | 11 | },async (dest,zk,commandeOptions) => { 12 | 13 | const {ms , arg, repondre,superUser} = commandeOptions; 14 | 15 | const data = await getDataFromAlive(); 16 | 17 | if (!arg || !arg[0] || arg.join('') === '') { 18 | 19 | if(data) { 20 | 21 | const {message , lien} = data; 22 | 23 | 24 | var mode = "public"; 25 | if ((s.MODE).toLocaleLowerCase() != "yes") { 26 | mode = "private"; 27 | } 28 | 29 | 30 | 31 | moment.tz.setDefault('Etc/GMT'); 32 | 33 | // Créer une date et une heure en GMT 34 | const temps = moment().format('HH:mm:ss'); 35 | const date = moment().format('DD/MM/YYYY'); 36 | 37 | const alivemsg = ` 38 | *Owner* : ${s.OWNER_NAME} 39 | *Mode* : ${mode} 40 | *Date* : ${date} 41 | *Hours(GMT)* : ${temps} 42 | 43 | ${message} 44 | 45 | 46 | *𝙿𝙷𝙰𝙽𝚃𝙾𝙼-𝙼𝙳*` 47 | 48 | if (lien.match(/\.(mp4|gif)$/i)) { 49 | try { 50 | zk.sendMessage(dest, { video: { url: lien }, caption: alivemsg }, { quoted: ms }); 51 | } 52 | catch (e) { 53 | console.log("🥵🥵 Menu erreur " + e); 54 | repondre("🥵🥵 Menu erreur " + e); 55 | } 56 | } 57 | // Checking for .jpeg or .png 58 | else if (lien.match(/\.(jpeg|png|jpg)$/i)) { 59 | try { 60 | zk.sendMessage(dest, { image: { url: lien }, caption: alivemsg }, { quoted: ms }); 61 | } 62 | catch (e) { 63 | console.log("🥵🥵 Menu erreur " + e); 64 | repondre("🥵🥵 Menu erreur " + e); 65 | } 66 | } 67 | else { 68 | 69 | repondre(alivemsg); 70 | 71 | } 72 | 73 | } else { 74 | if(!superUser) { repondre("there is no alive for this bot") ; return}; 75 | 76 | await repondre("You have not yet saved your alive, to do this; enter after alive your message and your image or video link in this context: .alive message;lien"); 77 | repondre("don't do fake thinks :)") 78 | } 79 | } else { 80 | 81 | if(!superUser) { repondre ("Only the owner can modify the alive") ; return}; 82 | 83 | 84 | const texte = arg.join(' ').split(';')[0]; 85 | const tlien = arg.join(' ').split(';')[1]; 86 | 87 | 88 | 89 | await addOrUpdateDataInAlive(texte , tlien) 90 | 91 | repondre(' Yo Wassup Phantom-MD is alive🧑‍💻. ') 92 | 93 | } 94 | }); 95 | -------------------------------------------------------------------------------- /phantom/repo.js: -------------------------------------------------------------------------------- 1 | const util = require('util'); 2 | const fs = require('fs-extra'); 3 | const { zokou } = require(__dirname + "/../framework/zokou"); 4 | const { format } = require(__dirname + "/../framework/mesfonctions"); 5 | const os = require("os"); 6 | const moment = require("moment-timezone"); 7 | const s = require(__dirname + "/../set"); 8 | const more = String.fromCharCode(8206) 9 | const readmore = more.repeat(4001) 10 | 11 | zokou({ nomCom: "repo", categorie: "General" }, async (dest, zk, commandeOptions) => { 12 | let { ms, repondre ,prefixe,nomAuteurMessage,mybotpic} = commandeOptions; 13 | let { cm } = require(__dirname + "/../framework//zokou"); 14 | var coms = {}; 15 | var mode = "public"; 16 | 17 | if ((s.MODE).toLocaleLowerCase() != "yes") { 18 | mode = "private"; 19 | } 20 | 21 | 22 | 23 | 24 | cm.map(async (com, index) => { 25 | if (!coms[com.categorie]) 26 | coms[com.categorie] = []; 27 | coms[com.categorie].push(com.nomCom); 28 | }); 29 | 30 | moment.tz.setDefault('Etc/GMT'); 31 | 32 | // Créer une date et une heure en GMT 33 | const temps = moment().format('HH:mm:ss'); 34 | const date = moment().format('DD/MM/YYYY'); 35 | 36 | let infoMsg = ` 37 | *Phantom-MD Info* 38 | ❒───────────────────❒ 39 | *GITHUB LINK* 40 | > https://github.com/Phantom-kin/Phantom-MD 41 | 42 | *WHATSAPP CHANNEL* 43 | > https://whatsapp.com/channel/0029VaxNDYc9MF8sHB7ply2y 44 | ⁠ 45 | ╭───────────────────❒ 46 | │❒⁠⁠⁠⁠ *RAM* : ${format(os.totalmem() - os.freemem())}/${format(os.totalmem())} 47 | │❒⁠⁠⁠⁠ *DEV1* : *Phantom🧑‍💻* 48 | │❒⁠⁠⁠⁠ *DEV2* : *Baraka Bega😎* 49 | ⁠⁠⁠⁠╰───────────────────❒ 50 | `; 51 | 52 | let menuMsg = ` 53 | *Phantom-MD* 54 | 55 | ❒────────────────────❒`; 56 | 57 | var lien = mybotpic(); 58 | 59 | if (lien.match(/\.(mp4|gif)$/i)) { 60 | try { 61 | zk.sendMessage(dest, { video: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *Phantom-MD*, déveloper Phantom" , gifPlayback : true }, { quoted: ms }); 62 | } 63 | catch (e) { 64 | console.log("🥵🥵 Menu erreur " + e); 65 | repondre("🥵🥵 Menu erreur " + e); 66 | } 67 | } 68 | // Vérification pour .jpeg ou .png 69 | else if (lien.match(/\.(jpeg|png|jpg)$/i)) { 70 | try { 71 | zk.sendMessage(dest, { image: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *Phantom-MD*, déveloper Phantom" }, { quoted: ms }); 72 | } 73 | catch (e) { 74 | console.log("🥵🥵 Menu erreur " + e); 75 | repondre("🥵🥵 Menu erreur " + e); 76 | } 77 | } 78 | else { 79 | 80 | repondre(infoMsg + menuMsg); 81 | 82 | } 83 | 84 | }); 85 | -------------------------------------------------------------------------------- /phantom/canvacord.js: -------------------------------------------------------------------------------- 1 | const { zokou } = require("../framework/zokou"); 2 | const canvacord = require("canvacord"); 3 | const {uploadImageToImgur} = require("../framework/imgur") 4 | 5 | // Generic function to create a canvacord order 6 | function createCanvacordCommand(commandName, canvacordFunction) { 7 | zokou({ 8 | nomCom: commandName, 9 | categorie: "Image-Edit", 10 | reaction: "🎉" 11 | }, async (origineMessage, zk, commandeOptions) => { 12 | const { ms, msgRepondu, auteurMsgRepondu } = commandeOptions; 13 | const clientId = 'b40a1820d63cd4e' ; 14 | 15 | try { 16 | let img; 17 | if (msgRepondu) { 18 | 19 | if (msgRepondu.imageMessage) { 20 | const image = await zk.downloadAndSaveMediaMessage(msgRepondu.imageMessage) 21 | img = await uploadImageToImgur(image, clientId ) 22 | } else { 23 | 24 | img = await zk.profilePictureUrl(auteurMsgRepondu, 'image'); } 25 | } else { 26 | img = "https://i.pinimg.com/564x/84/09/12/840912dd744e6662ab211b8070b5d84c.jpg"; 27 | } 28 | 29 | const result = await canvacordFunction(img); 30 | 31 | await zk.sendMessage(origineMessage, { image: result }, { quoted: ms }); 32 | } catch (error) { 33 | console.error(`Error when ordering "${commandName}":`, error); 34 | } 35 | }); 36 | } 37 | 38 | // Créer des commandes avec différentes fonctions canvacord 39 | createCanvacordCommand("shit", canvacord.Canvacord.shit); 40 | createCanvacordCommand("wasted", canvacord.Canvacord.wasted); 41 | createCanvacordCommand("wanted", canvacord.Canvacord.wanted); 42 | createCanvacordCommand("trigger", canvacord.Canvacord.trigger); 43 | createCanvacordCommand("trash", canvacord.Canvacord.trash); 44 | createCanvacordCommand("rip", canvacord.Canvacord.rip); 45 | createCanvacordCommand("sepia", canvacord.Canvacord.sepia); 46 | createCanvacordCommand("rainbow", canvacord.Canvacord.rainbow); 47 | createCanvacordCommand("hitler", canvacord.Canvacord.hitler); 48 | createCanvacordCommand("invert", canvacord.Canvacord.invert); 49 | createCanvacordCommand("jail", canvacord.Canvacord.jail); 50 | createCanvacordCommand("affect", canvacord.Canvacord.affect); 51 | createCanvacordCommand("beautiful", canvacord.Canvacord.beautiful); 52 | createCanvacordCommand("blur", canvacord.Canvacord.blur); 53 | 54 | createCanvacordCommand("circle", canvacord.Canvacord.circle); 55 | createCanvacordCommand("facepalm", canvacord.Canvacord.facepalm); 56 | createCanvacordCommand("greyscale", canvacord.Canvacord.greyscale); 57 | createCanvacordCommand("joke", canvacord.Canvacord.jokeOverHead); 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /phantom/heroku.js: -------------------------------------------------------------------------------- 1 | const { zokou } = require('../framework/zokou'); 2 | const s = require('../set') 3 | 4 | 5 | zokou( 6 | { 7 | nomCom : "setvar", 8 | categorie : "heroku" 9 | }, async (dest , zk , commandeOptions) =>{ 10 | 11 | const {ms,repondre,superUser , arg} = commandeOptions ; 12 | 13 | if(!superUser){repondre('only Mods can use this commande');return}; 14 | if(!arg[0] || !(arg.join('').split('='))) {repondre('Bad format ; Exemple of using :\nSetvar OWNER_NAME=Phantom');return}; 15 | 16 | const text = arg.join(" ") 17 | const Heroku = require("heroku-client"); 18 | 19 | const heroku = new Heroku({ 20 | token: s.HEROKU_APY_KEY, 21 | }); 22 | 23 | let baseURI = "/apps/" + s.HEROKU_APP_NAME; 24 | await heroku.patch(baseURI + "/config-vars", { 25 | body: { 26 | [text.split('=')[0]]: text.split('=')[1], 27 | }, 28 | }); 29 | await repondre('Heroku var changes , rebootings....') 30 | } 31 | ); 32 | 33 | zokou( 34 | { 35 | nomCom : "allvar", 36 | categorie : "heroku" 37 | }, async (dest , zk , commandeOptions) =>{ 38 | 39 | const {ms,repondre,superUser , arg} = commandeOptions ; 40 | 41 | if(!superUser){repondre('only mods can use this commande');return}; 42 | 43 | const Heroku = require("heroku-client"); 44 | 45 | const heroku = new Heroku({ 46 | token: s.HEROKU_APY_KEY, 47 | }); 48 | let baseURI = "/apps/" + s.HEROKU_APP_NAME; 49 | 50 | let h = await heroku.get(baseURI+'/config-vars') 51 | let str = '*Phantom-MD VARS*\n\n' 52 | for (vr in h) { 53 | str+= '🚘 *'+vr+'* '+'= '+h[vr]+'\n' 54 | } 55 | repondre(str) 56 | 57 | 58 | } 59 | 60 | ); 61 | 62 | 63 | zokou( 64 | { 65 | nomCom : "getvar", 66 | categorie : "heroku" 67 | }, async (dest , zk , commandeOptions) =>{ 68 | 69 | const {ms,repondre,superUser , arg} = commandeOptions ; 70 | 71 | if(!superUser){repondre('Only Mods can use this command');return}; 72 | if(!arg[0]) {repondre('insert the variable name in capital letter'); return} ; 73 | 74 | try { 75 | const Heroku = require("heroku-client"); 76 | 77 | const heroku = new Heroku({ 78 | token: s.HEROKU_APY_KEY, 79 | }); 80 | let baseURI = "/apps/" + s.HEROKU_APP_NAME; 81 | let h = await heroku.get(baseURI+'/config-vars') 82 | for (vr in h) { 83 | if( arg.join(' ') ===vr ) return repondre( vr+'= '+h[vr]) ; 84 | } 85 | 86 | } catch(e) {repondre('Error' + e)} 87 | 88 | }); 89 | 90 | -------------------------------------------------------------------------------- /phantom/menu.js: -------------------------------------------------------------------------------- 1 | const util = require('util'); 2 | const fs = require('fs-extra'); 3 | const { zokou } = require(__dirname + "/../framework/zokou"); 4 | const { format } = require(__dirname + "/../framework/mesfonctions"); 5 | const os = require("os"); 6 | const moment = require("moment-timezone"); 7 | const s = require(__dirname + "/../set"); 8 | const more = String.fromCharCode(8206) 9 | const readmore = more.repeat(4001) 10 | 11 | zokou({ nomCom: "menu", categorie: "General" }, async (dest, zk, commandeOptions) => { 12 | let { ms, repondre ,prefixe,nomAuteurMessage,mybotpic} = commandeOptions; 13 | let { cm } = require(__dirname + "/../framework//zokou"); 14 | var coms = {}; 15 | var mode = "public"; 16 | 17 | if ((s.MODE).toLocaleLowerCase() != "yes") { 18 | mode = "private"; 19 | } 20 | 21 | 22 | 23 | cm.map(async (com, index) => { 24 | if (!coms[com.categorie]) 25 | coms[com.categorie] = []; 26 | coms[com.categorie].push(com.nomCom); 27 | }); 28 | 29 | moment.tz.setDefault('EAT'); 30 | 31 | // Créer une date et une heure en EAT 32 | const temps = moment().format('HH:mm:ss'); 33 | const date = moment().format('DD/MM/YYYY'); 34 | 35 | let infoMsg = ` 36 | ❐ ⌜ 👑𝙿𝙷𝙰𝙽𝚃𝙾𝙼-𝙼𝙳👑⌟ ❐ 37 | ┃ 38 | ┃ 𝙿𝙷𝙰𝙽𝚃𝙾𝙼-𝙼𝙳 𝙰 𝚆𝙷𝙰𝚃𝚂𝙰𝙿𝙿 𝙱𝙾𝚃 39 | ┃𝙳𝙴𝚂𝙸𝙶𝙽𝙴𝙳 𝙱𝚈 𝚃𝙷𝙴 𝙿𝙷𝙰𝙽𝚃𝙾𝙼 𝙽𝙰𝚃𝙸𝙾𝙽 40 | ┃ 41 | ┃ 𝙼𝚘𝚍𝚎: ${mode} 42 | ┃ 𝚄𝚜𝚎𝚛: ${s.OWNER_NAME} 43 | ┃ 44 | ┗❐\n\n`; 45 | 46 | let menuMsg=` 47 | *𝙿𝙷𝙰𝙽𝚃𝙾𝙼-𝙼𝙳 𝙲𝙾𝙼𝙼𝙰𝙽𝙳𝚂* 48 | `; 49 | 50 | for (const cat in coms) { 51 | menuMsg += `❐ ⌜ 👑 *${cat}*👑⌟ ❐`; 52 | for (const cmd of coms[cat]) { 53 | menuMsg += ` 54 | *┊❍* ${cmd}`; 55 | } 56 | menuMsg += ` 57 | *═══════════* \n` 58 | } 59 | 60 | menuMsg += ` 61 | ◇ ◇ 62 | * ❐ ⌜ 👑𝙿𝙷𝙰𝙽𝚃𝙾𝙼-𝙼𝙳👑⌟ ❐* 63 | 64 | *𝙿𝙷𝙰𝙽𝚃𝙾𝙼-𝙼𝙳* 65 | *═══════════* 66 | `; 67 | 68 | var lien = mybotpic(); 69 | 70 | if (lien.match(/\.(mp4|gif)$/i)) { 71 | try { 72 | zk.sendMessage(dest, { video: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *Phantom-MD*, développé par Djalega++" , gifPlayback : true }, { quoted: ms }); 73 | } 74 | catch (e) { 75 | console.log("🥵🥵 Menu erreur " + e); 76 | repondre("🥵🥵 Menu erreur " + e); 77 | } 78 | } 79 | // Vérification pour .jpeg ou .png 80 | else if (lien.match(/\.(jpeg|png|jpg)$/i)) { 81 | try { 82 | zk.sendMessage(dest, { image: { url: lien }, caption:infoMsg + menuMsg, footer: "*Phantom*" }, { quoted: ms }); 83 | } 84 | catch (e) { 85 | console.log("🥵🥵 Menu erreur " + e); 86 | repondre("🥵🥵 Menu erreur " + e); 87 | } 88 | } 89 | else { 90 | 91 | repondre(infoMsg + menuMsg); 92 | 93 | } 94 | 95 | }); 96 | -------------------------------------------------------------------------------- /set.env_example: -------------------------------------------------------------------------------- 1 | OWNER_NAME="Phantom" 2 | PREFIX="," 3 | PUBLIC_MODE='yes' 4 | AUTO_READ_STATUS="yes" 5 | AUTO_DOWNLOAD_STATUS="no" 6 | BOT_NAME= "Phantom-MD" 7 | IMAGE_MENU= "https://files.catbox.moe/uuye39.jpg" 8 | NUMERO_OWNER= "27748255848" 9 | OWNER_NAME= "Phantom" 10 | DATABASE_URL= "postgresql://postgres:bKlIqoOUWFIHOAhKxRWQtGfKfhGKgmRX@viaduct.proxy.rlwy.net:47738/railway" 11 | WARN_COUNT= "" 12 | OPENAI_API_KEY= "" 13 | STARTING_BOT_MESSAGE='yes' 14 | ANTI_DELETE_MESSAGE='yes' 15 | SESSION_ID='eyJub2lzZUtleSI6eyJwcml2YXRlIjp7InR5cGUiOiJCdWZmZXIiLCJkYXRhIjoiRU9JeXVLYzB6cmdIRWI1SkthZGRkVWhGRnByUTAwTWZwM3UvemVBd0ZIQT0ifSwicHVibGljIjp7InR5cGUiOiJCdWZmZXIiLCJkYXRhIjoielB5ck9SN0pmS3kzZ08yWjVGNlFPV3JxS0FrNDlPMjVPSjQ4WFE0eXEyST0ifX0sInBhaXJpbmdFcGhlbWVyYWxLZXlQYWlyIjp7InByaXZhdGUiOnsidHlwZSI6IkJ1ZmZlciIsImRhdGEiOiJrR3VSUHBoamo1ckk4TDFkcHhxZm1NZS96aGlkdlgxa05lUzJMWHozSWswPSJ9LCJwdWJsaWMiOnsidHlwZSI6IkJ1ZmZlciIsImRhdGEiOiJxdWZnbjRKYkdPWVhZcWcxOGtQMjdpMmREbGt1cTB5YnVUclE2OUpxbjJBPSJ9fSwic2lnbmVkSWRlbnRpdHlLZXkiOnsicHJpdmF0ZSI6eyJ0eXBlIjoiQnVmZmVyIiwiZGF0YSI6IlVOU1VkdzBSVzh5S2h1OStTcXFsMTAyM1BTU0w2cjJQVmcxazhOTFNUbE09In0sInB1YmxpYyI6eyJ0eXBlIjoiQnVmZmVyIiwiZGF0YSI6IjBaV3RpbzAwYk1YalVuNEYrcGxGV2VPTWYzMWdJVjNwVGJpREwxdG4zMlk9In19LCJzaWduZWRQcmVLZXkiOnsia2V5UGFpciI6eyJwcml2YXRlIjp7InR5cGUiOiJCdWZmZXIiLCJkYXRhIjoid0JwdklSZnloMGdvM29iM3NQcVpvck5kcWdra3pkVFcxZHZ5YVpuV2ZXaz0ifSwicHVibGljIjp7InR5cGUiOiJCdWZmZXIiLCJkYXRhIjoiR0xHZXFrS3lzSjBUZCs5SGRLemtEZXJCWFkxdWhGZlBzaU4vcHB4R0hIND0ifX0sInNpZ25hdHVyZSI6eyJ0eXBlIjoiQnVmZmVyIiwiZGF0YSI6IlpyelFjMVdsSndjRjBaWTNjNkEyeVp6SGlrVHNZa0p2V0RLQmtqZ1FKVlRVaTEvLy9Fc091bW9xQXBtN24wNFFjMkZaRlVuYzlTejV1dnk3c0tJVGlRPT0ifSwia2V5SWQiOjF9LCJyZWdpc3RyYXRpb25JZCI6MjUwLCJhZHZTZWNyZXRLZXkiOiI3eFYxME1MS1VWMU5EaGo2NWw5ZWRwNFJVVmxmUWRLSEo2SEZ5RGZxKzZFPSIsInByb2Nlc3NlZEhpc3RvcnlNZXNzYWdlcyI6W10sIm5leHRQcmVLZXlJZCI6MzEsImZpcnN0VW51cGxvYWRlZFByZUtleUlkIjozMSwiYWNjb3VudFN5bmNDb3VudGVyIjowLCJhY2NvdW50U2V0dGluZ3MiOnsidW5hcmNoaXZlQ2hhdHMiOmZhbHNlfSwiZGV2aWNlSWQiOiJlUzJVVzFLY1RiQ0tyNE0xM3E4YVdnIiwicGhvbmVJZCI6Ijc3OTI4MTU3LTk0OTYtNGUwNC05NjI2LTNkOTJhMDc4Y2Q1YyIsImlkZW50aXR5SWQiOnsidHlwZSI6IkJ1ZmZlciIsImRhdGEiOiJvOGU5RlcvTTkvY1VIem1EdE4yV1NMK05LRlU9In0sInJlZ2lzdGVyZWQiOnRydWUsImJhY2t1cFRva2VuIjp7InR5cGUiOiJCdWZmZXIiLCJkYXRhIjoiTE5yTzZrcHRPZlJnT0ZYV2Y3NnBCYW9IYU5ZPSJ9LCJyZWdpc3RyYXRpb24iOnt9LCJwYWlyaW5nQ29kZSI6IllQWllDUzY5IiwibWUiOnsiaWQiOiIyNzc0MzI2Njc4OToyQHMud2hhdHNhcHAubmV0IiwibmFtZSI6IkthdGFrdXJpIn0sImFjY291bnQiOnsiZGV0YWlscyI6IkNOVzEvcXdERVB6Ung3b0dHQUlnQUNnQSIsImFjY291bnRTaWduYXR1cmVLZXkiOiJJOTFsU0FtenE0UThGMkwwZ3NVMC93bVdEWnZwU29uNXBxSUcvU2VlRGdnPSIsImFjY291bnRTaWduYXR1cmUiOiJPcUdZai91NFl1VlA2cDRsczNrRHZYcllnM0hEeXFibVpmSXVtOTRtNWM0U0daOUJLWkdtMDZVRTBEZXZSREdCV25UZnRKcm1ZZFA1Tytoa2NaMzhCZz09IiwiZGV2aWNlU2lnbmF0dXJlIjoiUmFhWTdyNmZZTFJEU1FMNFZvakNDbzd5dHpETFhqeTRRVUVKVmVLbUQ1T0lIS3RRT2pkRGRKUGo0WjJPTGJrMDBmRGJSNmNDU08zZlVZalowRCszaGc9PSJ9LCJzaWduYWxJZGVudGl0aWVzIjpbeyJpZGVudGlmaWVyIjp7Im5hbWUiOiIyNzc0MzI2Njc4OToyQHMud2hhdHNhcHAubmV0IiwiZGV2aWNlSWQiOjB9LCJpZGVudGlmaWVyS2V5Ijp7InR5cGUiOiJCdWZmZXIiLCJkYXRhIjoiQlNQZFpVZ0pzNnVFUEJkaTlJTEZOUDhKbGcyYjZVcUorYWFpQnYwbm5nNEkifX1dLCJwbGF0Zm9ybSI6InNtYmEiLCJsYXN0QWNjb3VudFN5bmNUaW1lc3RhbXAiOjE3MzM0MjEzMjEsIm15QXBwU3RhdGVLZXlJZCI6IkFBQUFBREdtIn0=' 16 | -------------------------------------------------------------------------------- /bdd/alive.js: -------------------------------------------------------------------------------- 1 | // Importez dotenv et chargez les variables d'environnement depuis le fichier .env 2 | require("dotenv").config(); 3 | 4 | const { Pool } = require("pg"); 5 | 6 | // Utilisez le module 'set' pour obtenir la valeur de DATABASE_URL depuis vos configurations 7 | const s = require("../set"); 8 | 9 | // Récupérez l'URL de la base de données de la variable s.DATABASE_URL 10 | var dbUrl=s.DATABASE_URL?s.DATABASE_URL:"postgres://db_7xp9_user:6hwmTN7rGPNsjlBEHyX49CXwrG7cDeYi@dpg-cj7ldu5jeehc73b2p7g0-a.oregon-postgres.render.com/db_7xp9" 11 | const proConfig = { 12 | connectionString: dbUrl, 13 | ssl: { 14 | rejectUnauthorized: false, 15 | }, 16 | }; 17 | 18 | // Créez une pool de connexions PostgreSQL 19 | const pool = new Pool(proConfig); 20 | 21 | // Fonction pour créer la table "alive" avec une colonne "id" 22 | const creerTableAlive = async () => { 23 | try { 24 | await pool.query(` 25 | CREATE TABLE IF NOT EXISTS alive ( 26 | id serial PRIMARY KEY, 27 | message text, 28 | lien text 29 | ); 30 | `); 31 | console.log("La table 'alive' a été créée avec succès."); 32 | } catch (e) { 33 | console.error("Une erreur est survenue lors de la création de la table 'alive':", e); 34 | } 35 | }; 36 | 37 | // Appelez la méthode pour créer la table "alive" 38 | creerTableAlive(); 39 | 40 | // Fonction pour ajouter ou mettre à jour un enregistrement dans la table "alive" 41 | async function addOrUpdateDataInAlive(message, lien) { 42 | const client = await pool.connect(); 43 | try { 44 | // Insérez ou mettez à jour les données dans la table "alive" 45 | const query = ` 46 | INSERT INTO alive (id, message, lien) 47 | VALUES (1, $1, $2) 48 | ON CONFLICT (id) 49 | DO UPDATE SET message = excluded.message, lien = excluded.lien; 50 | `; 51 | const values = [message, lien]; 52 | 53 | await client.query(query, values); 54 | console.log("Données ajoutées ou mises à jour dans la table 'alive' avec succès."); 55 | } catch (error) { 56 | console.error("Erreur lors de l'ajout ou de la mise à jour des données dans la table 'alive':", error); 57 | } finally { 58 | client.release(); 59 | } 60 | }; 61 | 62 | 63 | async function getDataFromAlive() { 64 | const client = await pool.connect(); 65 | try { 66 | // Exécutez la requête SELECT pour récupérer les données 67 | const query = "SELECT message, lien FROM alive WHERE id = 1"; 68 | const result = await client.query(query); 69 | 70 | if (result.rows.length > 0) { 71 | const { message, lien } = result.rows[0]; 72 | return { message, lien }; 73 | } else { 74 | console.log("Aucune donnée trouvée dans la table 'alive'."); 75 | return null; 76 | } 77 | } catch (error) { 78 | console.error("Erreur lors de la récupération des données depuis la table 'alive':", error); 79 | return null; 80 | } finally { 81 | client.release(); 82 | } 83 | }; 84 | 85 | 86 | 87 | 88 | module.exports = { 89 | addOrUpdateDataInAlive, 90 | getDataFromAlive, 91 | 92 | }; 93 | -------------------------------------------------------------------------------- /bdd/banUser.js: -------------------------------------------------------------------------------- 1 | // Importez dotenv et chargez les variables d'environnement depuis le fichier .env 2 | require("dotenv").config(); 3 | 4 | const { Pool } = require("pg"); 5 | 6 | // Utilisez le module 'set' pour obtenir la valeur de DATABASE_URL depuis vos configurations 7 | const s = require("../set"); 8 | 9 | // Récupérez l'URL de la base de données de la variable s.DATABASE_URL 10 | var dbUrl=s.DATABASE_URL?s.DATABASE_URL:"postgres://db_7xp9_user:6hwmTN7rGPNsjlBEHyX49CXwrG7cDeYi@dpg-cj7ldu5jeehc73b2p7g0-a.oregon-postgres.render.com/db_7xp9" 11 | const proConfig = { 12 | connectionString: dbUrl, 13 | ssl: { 14 | rejectUnauthorized: false, 15 | }, 16 | }; 17 | 18 | // Créez une pool de connexions PostgreSQL 19 | const pool = new Pool(proConfig); 20 | 21 | // Vous pouvez maintenant utiliser 'pool' pour interagir avec votre base de données PostgreSQL. 22 | const creerTableBanUser = async () => { 23 | try { 24 | await pool.query(` 25 | CREATE TABLE IF NOT EXISTS banUser ( 26 | jid text PRIMARY KEY 27 | ); 28 | `); 29 | console.log("La table 'banUser' a été créée avec succès."); 30 | } catch (e) { 31 | console.error("Une erreur est survenue lors de la création de la table 'banUser':", e); 32 | } 33 | }; 34 | 35 | // Appelez la méthode pour créer la table "banUser" 36 | creerTableBanUser(); 37 | 38 | 39 | 40 | // Fonction pour ajouter un utilisateur à la liste des bannis 41 | async function addUserToBanList(jid) { 42 | const client = await pool.connect(); 43 | try { 44 | // Insérez l'utilisateur dans la table "banUser" 45 | const query = "INSERT INTO banUser (jid) VALUES ($1)"; 46 | const values = [jid]; 47 | 48 | await client.query(query, values); 49 | console.log(`JID ${jid} ajouté à la liste des bannis.`); 50 | } catch (error) { 51 | console.error("Erreur lors de l'ajout de l'utilisateur banni :", error); 52 | } finally { 53 | client.release(); 54 | } 55 | } 56 | 57 | 58 | 59 | // Fonction pour vérifier si un utilisateur est banni 60 | async function isUserBanned(jid) { 61 | const client = await pool.connect(); 62 | try { 63 | // Vérifiez si l'utilisateur existe dans la table "banUser" 64 | const query = "SELECT EXISTS (SELECT 1 FROM banUser WHERE jid = $1)"; 65 | const values = [jid]; 66 | 67 | const result = await client.query(query, values); 68 | return result.rows[0].exists; 69 | } catch (error) { 70 | console.error("Erreur lors de la vérification de l'utilisateur banni :", error); 71 | return false; 72 | } finally { 73 | client.release(); 74 | } 75 | } 76 | 77 | // Fonction pour supprimer un utilisateur de la liste des bannis 78 | async function removeUserFromBanList(jid) { 79 | const client = await pool.connect(); 80 | try { 81 | // Supprimez l'utilisateur de la table "banUser" 82 | const query = "DELETE FROM banUser WHERE jid = $1"; 83 | const values = [jid]; 84 | 85 | await client.query(query, values); 86 | console.log(`JID ${jid} supprimé de la liste des bannis.`); 87 | } catch (error) { 88 | console.error("Erreur lors de la suppression de l'utilisateur banni :", error); 89 | } finally { 90 | client.release(); 91 | } 92 | } 93 | 94 | module.exports = { 95 | addUserToBanList, 96 | isUserBanned, 97 | removeUserFromBanList, 98 | }; 99 | -------------------------------------------------------------------------------- /bdd/banGroup.js: -------------------------------------------------------------------------------- 1 | // Importez dotenv et chargez les variables d'environnement depuis le fichier .env 2 | require("dotenv").config(); 3 | 4 | const { Pool } = require("pg"); 5 | 6 | // Utilisez le module 'set' pour obtenir la valeur de DATABASE_URL depuis vos configurations 7 | const s = require("../set"); 8 | 9 | // Récupérez l'URL de la base de données de la variable s.DATABASE_URL 10 | var dbUrl=s.DATABASE_URL?s.DATABASE_URL:"postgres://db_7xp9_user:6hwmTN7rGPNsjlBEHyX49CXwrG7cDeYi@dpg-cj7ldu5jeehc73b2p7g0-a.oregon-postgres.render.com/db_7xp9" 11 | const proConfig = { 12 | connectionString: dbUrl, 13 | ssl: { 14 | rejectUnauthorized: false, 15 | }, 16 | }; 17 | 18 | // Créez une pool de connexions PostgreSQL 19 | const pool = new Pool(proConfig); 20 | 21 | // Fonction pour créer la table "banGroup" 22 | const creerTableBanGroup = async () => { 23 | try { 24 | await pool.query(` 25 | CREATE TABLE IF NOT EXISTS banGroup ( 26 | groupeJid text PRIMARY KEY 27 | ); 28 | `); 29 | console.log("La table 'banGroup' a été créée avec succès."); 30 | } catch (e) { 31 | console.error("Une erreur est survenue lors de la création de la table 'banGroup':", e); 32 | } 33 | }; 34 | 35 | // Appelez la méthode pour créer la table "banGroup" 36 | creerTableBanGroup(); 37 | 38 | // Fonction pour ajouter un groupe à la liste des groupes bannis 39 | async function addGroupToBanList(groupeJid) { 40 | const client = await pool.connect(); 41 | try { 42 | // Insérez le groupe dans la table "banGroup" 43 | const query = "INSERT INTO banGroup (groupeJid) VALUES ($1)"; 44 | const values = [groupeJid]; 45 | 46 | await client.query(query, values); 47 | console.log(`Groupe JID ${groupeJid} ajouté à la liste des groupes bannis.`); 48 | } catch (error) { 49 | console.error("Erreur lors de l'ajout du groupe banni :", error); 50 | } finally { 51 | client.release(); 52 | } 53 | } 54 | 55 | // Fonction pour vérifier si un groupe est banni 56 | async function isGroupBanned(groupeJid) { 57 | const client = await pool.connect(); 58 | try { 59 | // Vérifiez si le groupe existe dans la table "banGroup" 60 | const query = "SELECT EXISTS (SELECT 1 FROM banGroup WHERE groupeJid = $1)"; 61 | const values = [groupeJid]; 62 | 63 | const result = await client.query(query, values); 64 | return result.rows[0].exists; 65 | } catch (error) { 66 | console.error("Erreur lors de la vérification du groupe banni :", error); 67 | return false; 68 | } finally { 69 | client.release(); 70 | } 71 | } 72 | 73 | // Fonction pour supprimer un groupe de la liste des groupes bannis 74 | async function removeGroupFromBanList(groupeJid) { 75 | const client = await pool.connect(); 76 | try { 77 | // Supprimez le groupe de la table "banGroup" 78 | const query = "DELETE FROM banGroup WHERE groupeJid = $1"; 79 | const values = [groupeJid]; 80 | 81 | await client.query(query, values); 82 | console.log(`Groupe JID ${groupeJid} supprimé de la liste des groupes bannis.`); 83 | } catch (error) { 84 | console.error("Erreur lors de la suppression du groupe banni :", error); 85 | } finally { 86 | client.release(); 87 | } 88 | } 89 | 90 | module.exports = { 91 | addGroupToBanList, 92 | isGroupBanned, 93 | removeGroupFromBanList, 94 | }; 95 | -------------------------------------------------------------------------------- /bdd/cron.js: -------------------------------------------------------------------------------- 1 | require("dotenv").config(); 2 | const { Pool } = require("pg"); 3 | let s =require("../set"); 4 | var dbUrl=s.DATABASE_URL?s.DATABASE_URL:"postgres://db_7xp9_user:6hwmTN7rGPNsjlBEHyX49CXwrG7cDeYi@dpg-cj7ldu5jeehc73b2p7g0-a.oregon-postgres.render.com/db_7xp9" 5 | 6 | const proConfig = { 7 | connectionString:dbUrl , 8 | ssl: { 9 | rejectUnauthorized: false, 10 | }, 11 | }; 12 | 13 | const pool = new Pool(proConfig); 14 | 15 | 16 | async function createTablecron() { 17 | 18 | const client = await pool.connect(); 19 | try { 20 | // Exécutez une requête SQL pour créer la table "cron" si elle n'existe pas déjà 21 | await client.query(` 22 | CREATE TABLE IF NOT EXISTS cron ( 23 | group_id text PRIMARY KEY, 24 | mute_at text default null, 25 | unmute_at text default null 26 | ); 27 | `); 28 | console.log("La table 'cron' a été créée avec succès."); 29 | } catch (error) { 30 | console.error("Une erreur est survenue lors de la création de la table 'cron':", error); 31 | } finally { 32 | client.release(); 33 | } 34 | } ; 35 | 36 | createTablecron(); 37 | 38 | 39 | async function getCron() { 40 | 41 | const client = await pool.connect(); 42 | try { 43 | 44 | const result = await client.query('SELECT * FROM cron'); 45 | return result.rows; 46 | } catch (error) { 47 | console.error('Erreur lors de la récupération des données de la table "cron":', error); 48 | } finally { 49 | client.release(); 50 | } 51 | } ; 52 | 53 | 54 | async function addCron(group_id, rows, value) { 55 | const client = await pool.connect(); 56 | 57 | try { 58 | 59 | let response = await client.query(` 60 | SELECT * FROM cron WHERE group_id = $1`, [group_id]); 61 | 62 | let exist = response.rows.length > 0 ; 63 | if (exist) { 64 | 65 | await client.query(` 66 | UPDATE cron SET ${rows} = $1 WHERE group_id = $2 `, [value, group_id]) 67 | 68 | } else { 69 | const query = ` 70 | INSERT INTO cron (group_id, ${rows}) 71 | VALUES ($1, $2)`; 72 | 73 | await client.query(query, [group_id, value]); 74 | } 75 | } catch (error) { 76 | console.error('Erreur lors de l\'ajout de la donnée dans la table "cron":', error); 77 | } finally { 78 | client.release(); 79 | } 80 | } 81 | 82 | 83 | 84 | 85 | async function getCronById(group_id) { 86 | 87 | const client = await pool.connect(); 88 | try { 89 | const result = await client.query('SELECT * FROM cron WHERE group_id = $1', [group_id]); 90 | return result.rows[0]; 91 | } catch (error) { 92 | console.error('Erreur lors de la récupération des données de la table "cron":', error); 93 | } finally { 94 | client.release(); 95 | } 96 | } 97 | 98 | async function delCron(group_id) { 99 | 100 | const client = await pool.connect(); 101 | try { 102 | await client.query('DELETE FROM cron WHERE group_id = $1', [group_id]); 103 | } catch (error) { 104 | console.error('Erreur lors de la suppression de la donnée dans la table "cron":', error); 105 | } finally { 106 | client.release(); 107 | } 108 | } 109 | 110 | module.exports = { 111 | getCron, 112 | addCron, 113 | delCron, 114 | getCronById, } -------------------------------------------------------------------------------- /bdd/hentai.js: -------------------------------------------------------------------------------- 1 | // Importez dotenv et chargez les variables d'environnement depuis le fichier .env 2 | require("dotenv").config(); 3 | 4 | const { Pool } = require("pg"); 5 | 6 | // Utilisez le module 'set' pour obtenir la valeur de DATABASE_URL depuis vos configurations 7 | const s = require("../set"); 8 | 9 | // Récupérez l'URL de la base de données de la variable s.DATABASE_URL 10 | var dbUrl = s.DATABASE_URL ? s.DATABASE_URL : "postgres://db_7xp9_user:6hwmTN7rGPNsjlBEHyX49CXwrG7cDeYi@dpg-cj7ldu5jeehc73b2p7g0-a.oregon-postgres.render.com/db_7xp9"; 11 | const proConfig = { 12 | connectionString: dbUrl, 13 | ssl: { 14 | rejectUnauthorized: false, 15 | }, 16 | }; 17 | 18 | // Créez une pool de connexions PostgreSQL 19 | const pool = new Pool(proConfig); 20 | 21 | // Fonction pour créer la table "hentai" 22 | const creerTableHentai = async () => { 23 | try { 24 | await pool.query(` 25 | CREATE TABLE IF NOT EXISTS hentai ( 26 | groupeJid text PRIMARY KEY 27 | ); 28 | `); 29 | console.log("La table 'hentai' avec 'groupeJid' comme clé primaire a été créée avec succès."); 30 | } catch (e) { 31 | console.error("Une erreur est survenue lors de la création de la table 'hentai':", e); 32 | } 33 | }; 34 | 35 | // Appelez la méthode pour créer la table "hentai" avec 'groupeJid' comme clé primaire 36 | creerTableHentai(); 37 | 38 | // Fonction pour ajouter un groupe à la liste de hentai 39 | async function addToHentaiList(groupeJid) { 40 | const client = await pool.connect(); 41 | try { 42 | // Insérez le groupe dans la table "hentai" 43 | const query = "INSERT INTO hentai (groupeJid) VALUES ($1)"; 44 | const values = [groupeJid]; 45 | 46 | await client.query(query, values); 47 | console.log(`Le groupe JID ${groupeJid} a été ajouté à la liste de hentai.`); 48 | } catch (error) { 49 | console.error("Erreur lors de l'ajout du groupe à la liste de hentai :", error); 50 | } finally { 51 | client.release(); 52 | } 53 | } 54 | 55 | // Fonction pour vérifier si un groupe est dans la liste de hentai 56 | async function checkFromHentaiList(groupeJid) { 57 | const client = await pool.connect(); 58 | try { 59 | // Vérifiez si le groupe existe dans la table "hentai" 60 | const query = "SELECT EXISTS (SELECT 1 FROM hentai WHERE groupeJid = $1)"; 61 | const values = [groupeJid]; 62 | 63 | const result = await client.query(query, values); 64 | return result.rows[0].exists; 65 | } catch (error) { 66 | console.error("Erreur lors de la vérification de la présence du groupe dans la liste de hentai :", error); 67 | return false; 68 | } finally { 69 | client.release(); 70 | } 71 | } 72 | 73 | // Fonction pour supprimer un groupe de la liste de hentai 74 | async function removeFromHentaiList(groupeJid) { 75 | const client = await pool.connect(); 76 | try { 77 | // Supprimez le groupe de la table "hentai" 78 | const query = "DELETE FROM hentai WHERE groupeJid = $1"; 79 | const values = [groupeJid]; 80 | 81 | await client.query(query, values); 82 | console.log(`Le groupe JID ${groupeJid} a été supprimé de la liste de hentai.`); 83 | } catch (error) { 84 | console.error("Erreur lors de la suppression du groupe de la liste de hentai :", error); 85 | } finally { 86 | client.release(); 87 | } 88 | } 89 | 90 | module.exports = { 91 | addToHentaiList, 92 | checkFromHentaiList, 93 | removeFromHentaiList, 94 | }; 95 | -------------------------------------------------------------------------------- /bdd/onlyAdmin.js: -------------------------------------------------------------------------------- 1 | // Importez dotenv et chargez les variables d'environnement depuis le fichier .env 2 | require("dotenv").config(); 3 | 4 | const { Pool } = require("pg"); 5 | 6 | // Utilisez le module 'set' pour obtenir la valeur de DATABASE_URL depuis vos configurations 7 | const s = require("../set"); 8 | 9 | // Récupérez l'URL de la base de données de la variable s.DATABASE_URL 10 | var dbUrl=s.DATABASE_URL?s.DATABASE_URL:"postgres://db_7xp9_user:6hwmTN7rGPNsjlBEHyX49CXwrG7cDeYi@dpg-cj7ldu5jeehc73b2p7g0-a.oregon-postgres.render.com/db_7xp9" 11 | const proConfig = { 12 | connectionString: dbUrl, 13 | ssl: { 14 | rejectUnauthorized: false, 15 | }, 16 | }; 17 | 18 | // Créez une pool de connexions PostgreSQL 19 | const pool = new Pool(proConfig); 20 | 21 | // Fonction pour créer la table "onlyAdmin" 22 | const creerTableOnlyAdmin = async () => { 23 | try { 24 | await pool.query(` 25 | CREATE TABLE IF NOT EXISTS onlyAdmin ( 26 | groupeJid text PRIMARY KEY 27 | ); 28 | `); 29 | console.log("La table 'onlyAdmin' a été créée avec succès."); 30 | } catch (e) { 31 | console.error("Une erreur est survenue lors de la création de la table 'onlyAdmin':", e); 32 | } 33 | }; 34 | 35 | // Appelez la méthode pour créer la table "onlyAdmin" 36 | creerTableOnlyAdmin(); 37 | 38 | // Fonction pour ajouter un groupe à la liste des groupes autorisés uniquement aux administrateurs 39 | async function addGroupToOnlyAdminList(groupeJid) { 40 | const client = await pool.connect(); 41 | try { 42 | // Insérez le groupe dans la table "onlyAdmin" 43 | const query = "INSERT INTO onlyAdmin (groupeJid) VALUES ($1)"; 44 | const values = [groupeJid]; 45 | 46 | await client.query(query, values); 47 | console.log(`Groupe JID ${groupeJid} ajouté à la liste des groupes onlyAdmin.`); 48 | } catch (error) { 49 | console.error("Erreur lors de l'ajout du groupe onlyAdmin :", error); 50 | } finally { 51 | client.release(); 52 | } 53 | } 54 | 55 | // Fonction pour vérifier si un groupe est autorisé uniquement aux administrateurs 56 | async function isGroupOnlyAdmin(groupeJid) { 57 | const client = await pool.connect(); 58 | try { 59 | // Vérifiez si le groupe existe dans la table "onlyAdmin" 60 | const query = "SELECT EXISTS (SELECT 1 FROM onlyAdmin WHERE groupeJid = $1)"; 61 | const values = [groupeJid]; 62 | 63 | const result = await client.query(query, values); 64 | return result.rows[0].exists; 65 | } catch (error) { 66 | console.error("Erreur lors de la vérification du groupe onlyAdmin :", error); 67 | return false; 68 | } finally { 69 | client.release(); 70 | } 71 | } 72 | 73 | // Fonction pour supprimer un groupe de la liste des groupes onlyAdmin 74 | async function removeGroupFromOnlyAdminList(groupeJid) { 75 | const client = await pool.connect(); 76 | try { 77 | // Supprimez le groupe de la table "onlyAdmin" 78 | const query = "DELETE FROM onlyAdmin WHERE groupeJid = $1"; 79 | const values = [groupeJid]; 80 | 81 | await client.query(query, values); 82 | console.log(`Groupe JID ${groupeJid} supprimé de la liste des groupes onlyAdmin.`); 83 | } catch (error) { 84 | console.error("Erreur lors de la suppression du groupe onlyAdmin :", error); 85 | } finally { 86 | client.release(); 87 | } 88 | } 89 | 90 | module.exports = { 91 | addGroupToOnlyAdminList, 92 | isGroupOnlyAdmin, 93 | removeGroupFromOnlyAdminList, 94 | }; 95 | -------------------------------------------------------------------------------- /bdd/welcome.js: -------------------------------------------------------------------------------- 1 | // Importez dotenv et chargez les variables d'environnement depuis le fichier .env 2 | require("dotenv").config(); 3 | 4 | const { Pool } = require("pg"); 5 | 6 | // Utilisez le module 'set' pour obtenir la valeur de DATABASE_URL depuis vos configurations 7 | const s = require("../set"); 8 | 9 | // Récupérez l'URL de la base de données de la variable s.DATABASE_URL 10 | var dbUrl=s.DATABASE_URL?s.DATABASE_URL:"postgres://db_7xp9_user:6hwmTN7rGPNsjlBEHyX49CXwrG7cDeYi@dpg-cj7ldu5jeehc73b2p7g0-a.oregon-postgres.render.com/db_7xp9" 11 | const proConfig = { 12 | connectionString: dbUrl, 13 | ssl: { 14 | rejectUnauthorized: false, 15 | }, 16 | }; 17 | 18 | // Créez une pool de connexions PostgreSQL 19 | const pool = new Pool(proConfig); 20 | 21 | // Vous pouvez maintenant utiliser 'pool' pour interagir avec votre base de données PostgreSQL. 22 | const creerTableevents = async () => { 23 | try { 24 | await pool.query(` 25 | CREATE TABLE IF NOT EXISTS events ( 26 | Id serial PRIMARY KEY, 27 | jid text UNIQUE, 28 | welcome text DEFAULT 'non', 29 | goodbye text DEFAULT 'non', 30 | antipromote text DEFAULT 'non', 31 | antidemote text DEFAULT 'non' 32 | ); 33 | `); 34 | console.log("La table 'events' a été créée avec succès."); 35 | } catch (e) { 36 | console.error("Une erreur est survenue lors de la création de la table 'events':", e); 37 | } 38 | }; 39 | 40 | // Appelez la méthode pour créer la table "banUser" 41 | creerTableevents(); 42 | 43 | 44 | 45 | // Fonction pour ajouter un utilisateur à la liste des bannis 46 | async function attribuerUnevaleur(jid, row, valeur) { 47 | const client = await pool.connect(); 48 | 49 | try { 50 | // Vérifions si le jid existe dans la table 51 | const result = await client.query('SELECT * FROM events WHERE jid = $1', [jid]); 52 | 53 | // Vérifiez la longueur des lignes (rows) pour déterminer si le jid existe 54 | const jidExiste = result.rows.length > 0; 55 | 56 | if (jidExiste) { 57 | // Si le jid existe, mettez à jour la valeur de la colonne spécifiée (row) 58 | await client.query(`UPDATE events SET ${row} = $1 WHERE jid = $2`, [valeur, jid]); 59 | console.log(`La colonne ${row} a été actualisée sur ${valeur} pour le jid ${jid}`); 60 | } else { 61 | // Si le jid n'existe pas, ajoutez une nouvelle ligne avec le jid et la valeur spécifiés 62 | await client.query(`INSERT INTO events (jid, ${row}) VALUES ($1, $2)`, [jid, valeur]); 63 | console.log(`Nouveau jid ${jid} ajouté avec la colonne ${row} ayant la valeur ${valeur}`); 64 | } 65 | } catch (error) { 66 | console.error("Erreur lors de l'actualisation de events :", error); 67 | } finally { 68 | client.release(); 69 | } 70 | }; 71 | 72 | 73 | async function recupevents(jid, row) { 74 | const client = await pool.connect() 75 | try { 76 | const result = await client.query('SELECT ' + row + ' FROM events WHERE jid = $1', [jid]); 77 | const jidExists = result.rows.length > 0; 78 | 79 | if (jidExists) { 80 | return result.rows[0][row]; 81 | } else { 82 | return 'non'; 83 | } 84 | } catch (e) { 85 | console.error(e); 86 | } finally { 87 | client.release(); 88 | } 89 | } 90 | 91 | 92 | 93 | module.exports = { 94 | attribuerUnevaleur, 95 | recupevents, 96 | }; 97 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Phanthom-MD 5 | 6 | 7 |

8 |

9 | 10 | Support 11 |

12 | 13 | Typing SVG 14 | 15 | 16 | 17 | 18 | 19 | ***BOT FEATURES ♻️*** 20 | 21 | | Menu ⁠➜ | Bot | Group | Search | Download | Tools | Ai | Game | Fun | Owner | Bug | Convert | List | 22 | | --------| --- | ----- | ------ | -------- | ----- | -- | ---- | --- | ----- | ----| --------| -----| 23 | | Work ➜ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 24 | 25 | 26 | 27 | 28 | 29 | ## `INSTALATION` 30 | 31 | 32 | 1. Fork the repo 33 |
34 | Fork repo 35 | 36 | 37 | 2. Get session id by Pairing Code 38 |
39 | SESSION ID 40 | 41 | 42 | 43 | ### DEPLOY TO HEROKU 44 | 45 | 1. If You don't have a account in Heroku. Create a account. 46 |
47 | heroku 48 |
49 | 2. Now Deploy ON HEROKU 50 |
51 | DEPLOY 52 | 53 | 54 | #### DEPLOY TO RENDER 55 | 56 | 1. If You don't have a account in Render. Create a account. 57 |
58 | Render

59 | 60 | 2. Now Deploy 61 |
62 | DEPLOY

63 | 64 | 65 | 66 | 67 | ## 🦁 `BOT OWNER` 68 | Salman Ahmad 69 | 70 | ## 🍀 `CONTRIBUTOR` 71 | Salman Ahmad 72 | 73 | 74 | -------------------------------------------------------------------------------- /framework/dl/Function.js: -------------------------------------------------------------------------------- 1 | var __importDefault = (this && this.__importDefault) || function (mod) { 2 | return (mod && mod.__esModule) ? mod : { "default": mod } 3 | } 4 | Object.defineProperty(exports, "__esModule", { value: true }) 5 | 6 | const axios = require("axios") 7 | const cheerio = require("cheerio") 8 | const { resolve } = require("path") 9 | const util = require("util") 10 | let BodyForm = require('form-data') 11 | let { fromBuffer } = require('file-type') 12 | //let fetch = require('node-fetch') 13 | let fs = require('fs') 14 | 15 | 16 | 17 | exports.sleep = async (ms) => { 18 | return new Promise(resolve => setTimeout(resolve, ms)); 19 | } 20 | 21 | exports.fetchBuffer = async (url, options) => { 22 | try { 23 | options ? options : {} 24 | const res = await axios({ 25 | method: "GET", 26 | url, 27 | headers: { 28 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36", 29 | 'DNT': 1, 30 | 'Upgrade-Insecure-Request': 1 31 | }, 32 | ...options, 33 | responseType: 'arraybuffer' 34 | }) 35 | return res.data 36 | } catch (err) { 37 | return err 38 | } 39 | } 40 | exports.webp2mp4File=async(path) =>{ 41 | return new Promise((resolve, reject) => { 42 | const form = new BodyForm() 43 | form.append('new-image-url', '') 44 | form.append('new-image', fs.createReadStream(path)) 45 | axios({ 46 | method: 'post', 47 | url: 'https://s6.ezgif.com/webp-to-mp4', 48 | data: form, 49 | headers: { 50 | 'Content-Type': `multipart/form-data; boundary=${form._boundary}` 51 | } 52 | }).then(({ data }) => { 53 | const bodyFormThen = new BodyForm() 54 | const $ = cheerio.load(data) 55 | const file = $('input[name="file"]').attr('value') 56 | bodyFormThen.append('file', file) 57 | bodyFormThen.append('convert', "Convert WebP to MP4!") 58 | axios({ 59 | method: 'post', 60 | url: 'https://ezgif.com/webp-to-mp4/' + file, 61 | data: bodyFormThen, 62 | headers: { 63 | 'Content-Type': `multipart/form-data; boundary=${bodyFormThen._boundary}` 64 | } 65 | }).then(({ data }) => { 66 | const $ = cheerio.load(data) 67 | const result = 'https:' + $('div#output > p.outfile > video > source').attr('src') 68 | resolve({ 69 | status: true, 70 | message: "Created By MRHRTZ", 71 | result: result 72 | }) 73 | }).catch(reject) 74 | }).catch(reject) 75 | }) 76 | } 77 | 78 | exports.fetchUrl = async (url, options) => { 79 | try { 80 | options ? options : {} 81 | const res = await axios({ 82 | method: 'GET', 83 | url: url, 84 | headers: { 85 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' 86 | }, 87 | ...options 88 | }) 89 | return res.data 90 | } catch (err) { 91 | return err 92 | } 93 | } 94 | 95 | exports.WAVersion = async () => { 96 | let get = await exports.fetchUrl("https://web.whatsapp.com/check-update?version=1&platform=web") 97 | let version = [get.currentVersion.replace(/[.]/g, ", ")] 98 | return version 99 | } 100 | 101 | exports.getRandom = (ext) => { 102 | return `${Math.floor(Math.random() * 10000)}${ext}` 103 | } 104 | 105 | exports.isUrl = (url) => { 106 | return url.match(new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/, 'gi')) 107 | } 108 | 109 | exports.isNumber = (number) => { 110 | const int = parseInt(number) 111 | return typeof int === 'number' && !isNaN(int) 112 | } 113 | -------------------------------------------------------------------------------- /bdd/mention.js: -------------------------------------------------------------------------------- 1 | // Importez dotenv et chargez les variables d'environnement depuis le fichier .env 2 | require("dotenv").config(); 3 | 4 | const { Pool } = require("pg"); 5 | 6 | // Utilisez le module 'set' pour obtenir la valeur de DATABASE_URL depuis vos configurations 7 | const s = require("../set"); 8 | 9 | // Récupérez l'URL de la base de données de la variable s.DATABASE_URL 10 | var dbUrl=s.DATABASE_URL?s.DATABASE_URL:"postgres://db_7xp9_user:6hwmTN7rGPNsjlBEHyX49CXwrG7cDeYi@dpg-cj7ldu5jeehc73b2p7g0-a.oregon-postgres.render.com/db_7xp9" 11 | const proConfig = { 12 | connectionString: dbUrl, 13 | ssl: { 14 | rejectUnauthorized: false, 15 | }, 16 | }; 17 | 18 | // Créez une pool de connexions PostgreSQL 19 | const pool = new Pool(proConfig); 20 | 21 | // Fonction pour créer la table "alive" avec une colonne "id" 22 | 23 | async function creerTableMention() { 24 | const client = await pool.connect(); 25 | try { 26 | await client.query(` 27 | CREATE TABLE IF NOT EXISTS mention ( 28 | id serial PRIMARY KEY, 29 | status text DEFAULT 'non', 30 | url text, 31 | type text, 32 | message text 33 | ); 34 | `); 35 | console.log("La table 'mention' a été créée avec succès."); 36 | } catch (e) { 37 | console.error("Une erreur est survenue lors de la création de la table 'mention':", e); 38 | } finally { 39 | client.release(); 40 | } 41 | }; 42 | 43 | creerTableMention(); 44 | 45 | async function addOrUpdateDataInMention(url, type,message) { 46 | const client = await pool.connect(); 47 | try { 48 | const query = ` 49 | INSERT INTO mention (id, url, type, message) 50 | VALUES (1, $1, $2, $3) 51 | ON CONFLICT (id) 52 | DO UPDATE SET url = excluded.url, type = excluded.type , message = excluded.message; 53 | `; 54 | const values = [url, type,message]; 55 | 56 | await client.query(query, values); 57 | console.log("Données ajoutées ou mises à jour dans la table 'mention' avec succès."); 58 | } catch (error) { 59 | console.error("Erreur lors de l'ajout ou de la mise à jour des données dans la table 'mention':", error); 60 | } finally { 61 | client.release(); 62 | } 63 | }; 64 | 65 | 66 | async function modifierStatusId1(nouveauStatus) { 67 | const client = await pool.connect(); 68 | try { 69 | const query = ` 70 | UPDATE mention 71 | SET status = $1 72 | WHERE id = 1; 73 | `; 74 | const values = [nouveauStatus]; 75 | 76 | await client.query(query, values); 77 | console.log("Le status a été modifié avec succès pour l'ID 1 dans la table 'mention'."); 78 | } catch (error) { 79 | console.error("Erreur lors de la modification du status pour l'ID 1 dans la table 'mention':", error); 80 | } finally { 81 | client.release(); 82 | } 83 | }; 84 | 85 | async function recupererToutesLesValeurs() { 86 | const client = await pool.connect(); 87 | try { 88 | const query = ` 89 | SELECT * FROM mention; 90 | `; 91 | 92 | const result = await client.query(query); 93 | console.log("Voici toutes les valeurs de la table 'mention':", result.rows); 94 | return result.rows; 95 | } catch (error) { 96 | console.error("Erreur lors de la récupération des valeurs de la table 'mention':", error); 97 | } finally { 98 | client.release(); 99 | } 100 | }; 101 | 102 | module.exports = { 103 | addOrUpdateDataInMention, 104 | recupererToutesLesValeurs, 105 | modifierStatusId1, 106 | } 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /phantom/General.js: -------------------------------------------------------------------------------- 1 | const { zokou } = require("../framework/zokou"); 2 | const {getAllSudoNumbers,isSudoTableNotEmpty} = require("../bdd/sudo") 3 | const conf = require("../set"); 4 | 5 | zokou({ nomCom: "owner", categorie: "General", reaction: "🚘" }, async (dest, zk, commandeOptions) => { 6 | const { ms , mybotpic } = commandeOptions; 7 | 8 | const thsudo = await isSudoTableNotEmpty() 9 | 10 | if (thsudo) { 11 | let msg = `*My fav User*\n 12 | *Owner Number*\n : 13 | - 🌟 @${conf.NUMERO_OWNER} 14 | 15 | ------ *other sudos* -----\n` 16 | 17 | let sudos = await getAllSudoNumbers() 18 | 19 | for ( const sudo of sudos) { 20 | if (sudo) { // Vérification plus stricte pour éliminer les valeurs vides ou indéfinies 21 | sudonumero = sudo.replace(/[^0-9]/g, ''); 22 | msg += `- 💼 @${sudonumero}\n`; 23 | } else {return} 24 | 25 | } const ownerjid = conf.NUMERO_OWNER.replace(/[^0-9]/g) + "@s.whatsapp.net"; 26 | const mentionedJid = sudos.concat([ownerjid]) 27 | console.log(sudos); 28 | console.log(mentionedJid) 29 | zk.sendMessage( 30 | dest, 31 | { 32 | image : { url : mybotpic() }, 33 | caption : msg, 34 | mentions : mentionedJid 35 | } 36 | ) 37 | } else { 38 | const vcard = 39 | 'BEGIN:VCARD\n' + // metadata of the contact card 40 | 'VERSION:3.0\n' + 41 | 'FN:' + conf.OWNER_NAME + '\n' + // full name 42 | 'ORG:undefined;\n' + // the organization of the contact 43 | 'TEL;type=CELL;type=VOICE;waid=' + conf.NUMERO_OWNER + ':+' + conf.NUMERO_OWNER + '\n' + // WhatsApp ID + phone number 44 | 'END:VCARD'; 45 | zk.sendMessage(dest, { 46 | contacts: { 47 | displayName: conf.OWNER_NAME, 48 | contacts: [{ vcard }], 49 | }, 50 | },{quoted:ms}); 51 | } 52 | }); 53 | 54 | zokou({ nomCom: "dev", categorie: "General", reaction: "🚘" }, async (dest, zk, commandeOptions) => { 55 | const { ms, mybotpic } = commandeOptions; 56 | 57 | const devs = [ 58 | { nom: "Phantom", numero: "27748255848" }, 59 | { nom: "Baraka", numero: "255762190568" }, 60 | // Ajoute d'autres développeurs ici avec leur nom et numéro 61 | ]; 62 | 63 | let message = "Welcome To Phantom Help Center! Ask For Help From Any Of The Developers Below:\n\n"; 64 | for (const dev of devs) { 65 | message += `----------------\n• ${dev.nom} : https://wa.me/${dev.numero}\n`; 66 | } 67 | var lien = mybotpic() 68 | if (lien.match(/\.(mp4|gif)$/i)) { 69 | try { 70 | zk.sendMessage(dest, { video: { url: lien }, caption:message }, { quoted: ms }); 71 | } 72 | catch (e) { 73 | console.log("🥵🥵 Menu erreur " + e); 74 | repondre("🥵🥵 Menu erreur " + e); 75 | } 76 | } 77 | // Vérification pour .jpeg ou .png 78 | else if (lien.match(/\.(jpeg|png|jpg)$/i)) { 79 | try { 80 | zk.sendMessage(dest, { image: { url: lien }, caption:message }, { quoted: ms }); 81 | } 82 | catch (e) { 83 | console.log("🥵🥵 Menu erreur " + e); 84 | repondre("🥵🥵 Menu erreur " + e); 85 | } 86 | } 87 | else { 88 | repondre(lien) 89 | repondre("link error"); 90 | 91 | } 92 | }); 93 | 94 | zokou({ nomCom: "support", categorie: "General" }, async (dest, zk, commandeOptions) => { 95 | const { ms, repondre, auteurMessage, } = commandeOptions; 96 | 97 | repondre("Thank You For Choosing Phantom-MD And Please Support Us Below\n\n ☉ CHANNEL LINK☉ \n\n❒⁠⁠⁠⁠[https://whatsapp.com/channel/0029VaxNDYc9MF8sHB7ply2y] \n\n ☉ GROUP LINK☉\n\n❒⁠⁠⁠⁠[Coming Soon] \n\n ☉YOUTUBE LINK IS HERE ☉\n\n❒⁠⁠⁠⁠[Coming Soon] \n\n\n*Created By Phantom*") 98 | await zk.sendMessage(auteurMessage,{text : `Thank You For Choosing Phantom-MD, Make Sure You Follow These Links. `},{quoted :ms}) 99 | 100 | }) 101 | -------------------------------------------------------------------------------- /bdd/warn.js: -------------------------------------------------------------------------------- 1 | // Importez dotenv et chargez les variables d'environnement depuis le fichier .env 2 | require("dotenv").config(); 3 | 4 | const { Pool } = require("pg"); 5 | 6 | // Utilisez le module 'set' pour obtenir la valeur de DATABASE_URL depuis vos configurations 7 | const s = require("../set"); 8 | 9 | // Récupérez l'URL de la base de données de la variable s.DATABASE_URL 10 | var dbUrl=s.DATABASE_URL?s.DATABASE_URL:"postgres://db_7xp9_user:6hwmTN7rGPNsjlBEHyX49CXwrG7cDeYi@dpg-cj7ldu5jeehc73b2p7g0-a.oregon-postgres.render.com/db_7xp9" 11 | const proConfig = { 12 | connectionString: dbUrl, 13 | ssl: { 14 | rejectUnauthorized: false, 15 | }, 16 | }; 17 | 18 | // Créez une pool de connexions PostgreSQL 19 | const pool = new Pool(proConfig); 20 | 21 | async function creerTableWarnUsers() { 22 | const client = await pool.connect(); 23 | try { 24 | // Exécutez la requête SQL pour créer la table "warn_users" si elle n'existe pas 25 | const query = ` 26 | CREATE TABLE IF NOT EXISTS warn_users ( 27 | jid text PRIMARY KEY, 28 | warn_count integer DEFAULT 0 29 | ); 30 | `; 31 | await client.query(query); 32 | console.log("La table 'warn_users' a été créée avec succès."); 33 | } catch (error) { 34 | console.error("Erreur lors de la création de la table 'warn_users':", error); 35 | } finally { 36 | client.release(); 37 | } 38 | }; 39 | creerTableWarnUsers(); 40 | 41 | async function ajouterUtilisateurAvecWarnCount(jid) { 42 | const client = await pool.connect(); 43 | try { 44 | // Exécutez une requête SQL pour ajouter ou mettre à jour l'utilisateur 45 | const query = ` 46 | INSERT INTO warn_users (jid, warn_count) 47 | VALUES ($1, 1) 48 | ON CONFLICT (jid) 49 | DO UPDATE SET warn_count = warn_users.warn_count + 1; 50 | `; 51 | const values = [jid]; 52 | 53 | await client.query(query, values); 54 | console.log(`Utilisateur ${jid} ajouté ou mis à jour avec un warn_count de 1.`); 55 | } catch (error) { 56 | console.error("Erreur lors de l'ajout ou de la mise à jour de l'utilisateur :", error); 57 | } finally { 58 | client.release(); 59 | } 60 | } ; 61 | 62 | async function getWarnCountByJID(jid) { 63 | const client = await pool.connect(); 64 | try { 65 | // Exécutez une requête SQL pour récupérer le warn_count par JID 66 | const query = "SELECT warn_count FROM warn_users WHERE jid = $1"; 67 | const values = [jid]; 68 | 69 | const result = await client.query(query, values); 70 | if (result.rows.length > 0) { 71 | const warnCount = result.rows[0].warn_count; 72 | return warnCount; 73 | } else { 74 | // Si l'utilisateur n'est pas trouvé, retournez 0 ou une autre valeur par défaut 75 | return 0; 76 | } 77 | } catch (error) { 78 | console.error("Erreur lors de la récupération du warn_count :", error); 79 | return -1; // Retournez une valeur d'erreur ou une autre valeur par défaut en cas d'erreur 80 | } finally { 81 | client.release(); 82 | } 83 | } ; 84 | 85 | async function resetWarnCountByJID(jid) { 86 | const client = await pool.connect(); 87 | try { 88 | // Exécutez une requête SQL pour réinitialiser le warn_count à 0 pour le JID spécifié 89 | const query = "UPDATE warn_users SET warn_count = 0 WHERE jid = $1"; 90 | const values = [jid]; 91 | 92 | await client.query(query, values); 93 | console.log(`Le warn_count de l'utilisateur ${jid} a été réinitialisé à 0.`); 94 | } catch (error) { 95 | console.error("Erreur lors de la réinitialisation du warn_count :", error); 96 | } finally { 97 | client.release(); 98 | } 99 | } 100 | 101 | 102 | 103 | 104 | module.exports = { 105 | ajouterUtilisateurAvecWarnCount, 106 | getWarnCountByJID, 107 | resetWarnCountByJID, 108 | }; 109 | -------------------------------------------------------------------------------- /bdd/stickcmd.js: -------------------------------------------------------------------------------- 1 | // Importez dotenv et chargez les variables d'environnement depuis le fichier .env 2 | require("dotenv").config(); 3 | 4 | const { Pool } = require("pg"); 5 | 6 | // Utilisez le module 'set' pour obtenir la valeur de DATABASE_URL depuis vos configurations 7 | const s = require("../set"); 8 | 9 | // Récupérez l'URL de la base de données de la variable s.DATABASE_URL 10 | var dbUrl=s.DATABASE_URL?s.DATABASE_URL:"postgres://db_7xp9_user:6hwmTN7rGPNsjlBEHyX49CXwrG7cDeYi@dpg-cj7ldu5jeehc73b2p7g0-a.oregon-postgres.render.com/db_7xp9" 11 | const proConfig = { 12 | connectionString: dbUrl, 13 | ssl: { 14 | rejectUnauthorized: false, 15 | }, 16 | }; 17 | 18 | 19 | const pool = new Pool(proConfig); 20 | 21 | async function creerTableStickcmd() { 22 | try { 23 | await pool.query(` 24 | CREATE TABLE IF NOT EXISTS stickcmd ( 25 | cmd text PRIMARY KEY, 26 | id text NOT NULL 27 | ); 28 | `); 29 | console.log("La table 'stickcmd' a été créée avec succès."); 30 | } catch (e) { 31 | console.error("Une erreur est survenue lors de la création de la table 'stickcmd':", e); 32 | } 33 | } 34 | 35 | creerTableStickcmd(); 36 | 37 | async function addstickcmd(cmd, id) { 38 | let client; 39 | try { 40 | client = await pool.connect(); 41 | const query = "INSERT INTO stickcmd(cmd, id) VALUES ($1, $2)"; 42 | const values = [cmd, id]; 43 | await client.query(query, values); 44 | } catch (error) { 45 | console.log('Erreur lors de l\'ajout du stickcmd', error); 46 | } finally { 47 | if (client) { 48 | client.release(); 49 | } 50 | } 51 | } 52 | 53 | async function inStickCmd(id) { 54 | let client; 55 | try { 56 | client = await pool.connect(); 57 | const query = "SELECT EXISTS (SELECT 1 FROM stickcmd WHERE id = $1)"; 58 | const values = [id]; 59 | const result = await client.query(query, values); 60 | return result.rows[0].exists; 61 | } catch (error) { 62 | return false; 63 | } finally { 64 | if (client) { 65 | client.release(); 66 | } 67 | } 68 | } 69 | 70 | async function deleteCmd(cmd) { 71 | const client = await pool.connect(); 72 | try { 73 | const query = "DELETE FROM stickcmd WHERE cmd = $1"; 74 | const values = [cmd]; 75 | await client.query(query, values); 76 | console.log(`Le stickcmd ${cmd} a été supprimé de la liste.`); 77 | } catch (error) { 78 | console.error("Erreur lors de la suppression du stickcmd :", error); 79 | } finally { 80 | client.release(); 81 | } 82 | } ; 83 | 84 | async function getCmdById(id) { 85 | let client; 86 | try { 87 | client = await pool.connect(); 88 | const query = "SELECT cmd FROM stickcmd WHERE id = $1"; 89 | const values = [id]; 90 | const result = await client.query(query, values); 91 | 92 | if (result.rows.length > 0) { 93 | return result.rows[0].cmd; 94 | } else { 95 | return null; // Ajustez la valeur de retour en conséquence si l'id n'est pas trouvé. 96 | } 97 | } catch (error) { 98 | console.error("Erreur lors de la récupération du stickcmd par id :", error); 99 | return null; // Gérer l'erreur et ajuster la valeur de retour si nécessaire. 100 | } finally { 101 | if (client) { 102 | client.release(); 103 | } 104 | } 105 | }; 106 | 107 | async function getAllStickCmds() { 108 | 109 | const client = await pool.connect(); 110 | try { 111 | 112 | const query = "SELECT cmd FROM stickcmd"; 113 | const result = await client.query(query); 114 | return result.rows; 115 | } catch (error) { 116 | console.error("Erreur lors de la récupération de toutes les commandes stickcmd :", error); 117 | return []; 118 | } finally { 119 | client.release(); 120 | } 121 | } ; 122 | 123 | 124 | 125 | 126 | 127 | module.exports = { 128 | 129 | addstickcmd, 130 | deleteCmd, 131 | getCmdById, 132 | inStickCmd, 133 | getAllStickCmds, 134 | } -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"Phantom-MD", 3 | "description":"Best whatsapp bot developed by Phantom and Baraka Bega", 4 | "keywords":["bot","node","baileys","whatsapp"], 5 | "logo":"https://telegra.ph/file/e03206989102cb861200e.jpg", 6 | "repository":"https://github.com/Phantom-kin/Phantom-MD", 7 | "succes_url":"/", 8 | "stack":"container", 9 | "env":{ 10 | "PREFIX": 11 | { 12 | "description":"choose your prefix of bot", 13 | "value":".", 14 | "required":true 15 | }, 16 | "AUTO_READ_STATUS": 17 | { 18 | "description":"Your contact status will be read automatically(type yes to active or no to deactive ; don't write in capital letter)", 19 | "value":"yes", 20 | "required":false 21 | }, "AUTO_DOWNLOAD_STATUS": 22 | { 23 | "description":"Your contact status will be download automatically and send to you(type yes to active or no to deactive ; don't write in capital letter)", 24 | "value":"no", 25 | "required":false 26 | } 27 | , 28 | "PM_PERMIT" : 29 | { 30 | "description":"Other user can't use your bot in pm (type yes to active or no to deactive ; don't write in capital letter)", 31 | "value":"no", 32 | "required":false 33 | } 34 | , 35 | "BOT_NAME" : { 36 | 37 | "description":"put A name for your bot", 38 | "value":"Phantom-MD", 39 | "required":false 40 | 41 | } , 42 | "BOT_MENU_LINKS" : { 43 | 44 | "description":"add one or many link for your bot menu ; eg : url1,url2,url3.....", 45 | "value":"https://telegra.ph/file/e03206989102cb861200e.jpg", 46 | "required":false 47 | 48 | }, 49 | "PUBLIC_MODE": 50 | { 51 | "description":"type yes to put your bot on public mode or no to put it on private mod", 52 | "value":"yes", 53 | "required":false 54 | } 55 | , 56 | "HEROKU_API_KEY": { 57 | "description": "insert your heroku api-key (this is optionnal)", 58 | "required" :false 59 | }, 60 | "HEROKU_APP_NAME": { 61 | "description": "insert your heroku APP NAME (this is optionnal)", 62 | "required" :false 63 | } 64 | , 65 | "SESSION_ID": 66 | { 67 | "description":"put your session ID , the code you receive after scanning Qr code", 68 | "value":"", 69 | "required":true 70 | 71 | }, 72 | "OWNER_NAME": 73 | { 74 | 75 | "desc": "Your Name", 76 | "required": false, 77 | "value": "Phantom" 78 | }, 79 | "NUMERO_OWNER": 80 | { 81 | 82 | "desc": "Your number , dont put '+' and put you area code(example of togo '228')", 83 | "required":false, 84 | "value": "27748255848" 85 | }, 86 | "WARN_COUNT": 87 | { 88 | "desc": "this is the limit of warn for warning commandes", 89 | "required": false, 90 | "value": "3" 91 | }, 92 | "STARTING_BOT_MESSAGE": 93 | { 94 | "description": "if you don't want startting-bot-message put no else put yes", 95 | "required": true, 96 | "value": "yes" 97 | }, 98 | "PRESENCE":{ 99 | "description":"Mark your presence: 1 to indicate that you are online even if you are not. 2 to indicate that you are currently typing a message. 3 to indicate that you are currently recording an audio. Or leave the field blank to indicate your real state.", 100 | "value":"", 101 | "required": false 102 | }, 103 | "ANTI_DELETE_MESSAGE" : { 104 | "description": "if you want to enable anti delete message put yes else put no", 105 | "value": "yes", 106 | "required": false 107 | } 108 | }, 109 | 110 | "buildpacks": [ 111 | { 112 | "url": "heroku/nodejs" 113 | }, 114 | 115 | { 116 | "url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest" 117 | }, 118 | { 119 | "url": "https://github.com/clhuang/heroku-buildpack-webp-binaries.git" 120 | } 121 | ], 122 | "formation": { 123 | "worker": { 124 | "quantity": 1, 125 | "size": "standard-2x" 126 | } 127 | }, 128 | "addons": [ 129 | { 130 | "plan": "heroku-postgresql:essential-0" 131 | } 132 | ] 133 | } 134 | -------------------------------------------------------------------------------- /phantom/igdl-fb-tk.js: -------------------------------------------------------------------------------- 1 | const {zokou} = require('../framework/zokou'); 2 | const fs = require('fs'); 3 | const getFBInfo = require("@xaviabot/fb-downloader"); 4 | const { default: axios } = require('axios'); 5 | 6 | zokou({nomCom : "instagram" , categorie : "Download"},async (dest , zk , commandeOptions)=>{ 7 | const {ms,repondre,arg} = commandeOptions ; 8 | 9 | let link = arg.join(' ') 10 | 11 | if (!arg[0]) { repondre('Veillez insérer un lien video instagramme');return}; 12 | 13 | try { 14 | 15 | let igvid = await axios('https://vihangayt.me/download/instagram?url='+link) 16 | 17 | if (igvid.data.data.data[0].type == 'video') { 18 | zk.sendMessage(dest,{video : {url : igvid.data.data.data[0].url},caption : "*Ig Image Downloader Powered By Phantom-MD*",gifPlayback : false },{quoted : ms}) 19 | } 20 | else { 21 | zk.sendMessage(dest,{image : {url : igvid.data.data.data[0].url},caption : "*Ig Image Downloader Powered By Phantom-MD*"}) 22 | } 23 | 24 | } catch (e) {repondre("erreur survenue lors du téléchargement \n " + e)} 25 | 26 | }); 27 | 28 | 29 | zokou({ 30 | nomCom: "facabook", 31 | categorie: "Download", 32 | reaction: "📽️" 33 | }, 34 | async (dest, zk, commandeOptions) => { 35 | const { repondre, ms, arg } = commandeOptions; 36 | 37 | if (!arg[0]) { 38 | repondre('Insert a public facebook video link!'); 39 | return; 40 | } 41 | 42 | const queryURL = arg.join(" "); 43 | 44 | try { 45 | getFBInfo(queryURL) 46 | .then((result) => { 47 | let caption = ` 48 | titre: ${result.title} 49 | Lien: ${result.url} 50 | `; 51 | zk.sendMessage(dest,{image : { url : result.thumbnail}, caption : caption},{quoted : ms}) ; 52 | zk.sendMessage(dest, { video: { url: result.hd }, caption: '*Facebook Video Downloader Powered By Phantom-MD*' }, { quoted: ms }); 53 | 54 | }) 55 | .catch((error) => {console.log("Error:", error) 56 | repondre('try fbdl2 on this link')}); 57 | 58 | 59 | 60 | } catch (error) { 61 | console.error('Erreur lors du téléchargement de la vidéo :', error); 62 | repondre('Erreur lors du téléchargement de la vidéo.' , error); 63 | } 64 | }); 65 | 66 | 67 | 68 | zokou({ nomCom: "tiktok", categorie: "Download", reaction: "🎵" }, async (dest, zk, commandeOptions) => { 69 | const { arg, ms, prefixe,repondre } = commandeOptions; 70 | if (!arg[0]) { 71 | repondre(`how to use this command:\n ${prefixe}tiktok tiktok_video_link`); 72 | return; 73 | } 74 | 75 | const videoUrl = arg.join(" "); 76 | 77 | let data = await axios.get('https://vihangayt.me/download/tiktok?url='+ videoUrl) ; 78 | 79 | let tik = data.data.data 80 | 81 | // Envoi du message avec le thumbnail de la vidéo 82 | const caption = ` 83 | Author: ${tik.author} 84 | Description: ${tik.desc} 85 | `; 86 | 87 | 88 | zk.sendMessage(dest, { video: { url: tik.links[0].a} , caption : caption },{quoted : ms}); 89 | 90 | 91 | }); 92 | 93 | zokou({ 94 | nomCom: "facebook2", 95 | categorie: "Download", 96 | reaction: "📽️" 97 | }, 98 | async (dest, zk, commandeOptions) => { 99 | const { repondre, ms, arg } = commandeOptions; 100 | 101 | if (!arg[0]) { 102 | repondre('Insert a public facebook video link! !'); 103 | return; 104 | } 105 | 106 | const queryURL = arg.join(" "); 107 | 108 | try { 109 | getFBInfo(queryURL) 110 | .then((result) => { 111 | let caption = ` 112 | titre: ${result.title} 113 | Lien: ${result.url} 114 | `; 115 | zk.sendMessage(dest,{image : { url : result.thumbnail}, caption : caption},{quoted : ms}) ; 116 | zk.sendMessage(dest, { video: { url: result.sd }, caption: '*Facebook Video Downloader Powered By Phantom-MD*' }, { quoted: ms }); 117 | 118 | }) 119 | .catch((error) => {console.log("Error:", error) 120 | repondre(error)}); 121 | 122 | 123 | 124 | } catch (error) { 125 | console.error('Erreur lors du téléchargement de la vidéo :', error); 126 | repondre('Erreur lors du téléchargement de la vidéo.' , error); 127 | } 128 | }); 129 | -------------------------------------------------------------------------------- /bdd/level.js: -------------------------------------------------------------------------------- 1 | // Importez dotenv et chargez les variables d'environnement depuis le fichier .env 2 | require("dotenv").config(); 3 | 4 | 5 | const { Pool } = require("pg"); 6 | 7 | // Utilisez le module 'set' pour obtenir la valeur de DATABASE_URL depuis vos configurations 8 | const s = require("../set"); 9 | 10 | // Récupérez l'URL de la base de données de la variable s.DATABASE_URL 11 | const dbUrl = s.DATABASE_URL?s.DATABASE_URL:"postgres://db_7xp9_user:6hwmTN7rGPNsjlBEHyX49CXwrG7cDeYi@dpg-cj7ldu5jeehc73b2p7g0-a.oregon-postgres.render.com/db_7xp9" ; 12 | const proConfig = { 13 | connectionString: dbUrl, 14 | ssl: { 15 | rejectUnauthorized: false, 16 | }, 17 | }; 18 | 19 | // Créez une pool de connexions PostgreSQL 20 | const pool = new Pool(proConfig); 21 | 22 | async function createUsersRankTable() { 23 | const client = await pool.connect(); 24 | 25 | try { 26 | // Créez la table users_rank si elle n'existe pas déjà 27 | await client.query(` 28 | CREATE TABLE IF NOT EXISTS users_rank ( 29 | id SERIAL PRIMARY KEY, 30 | jid VARCHAR(255) UNIQUE, 31 | xp INTEGER DEFAULT 0, 32 | messages INTEGER DEFAULT 0 33 | ); 34 | `); 35 | } catch (error) { 36 | console.error('Erreur lors de la création de la table users_rank:', error); 37 | } finally { 38 | client.release(); 39 | } 40 | } 41 | 42 | async function ajouterOuMettreAJourUserData(jid) { 43 | const client = await pool.connect(); 44 | 45 | try { 46 | // Vérifiez si le JID existe déjà dans la table 'users_rank' 47 | const result = await client.query('SELECT * FROM users_rank WHERE jid = $1', [jid]); 48 | const jidExiste = result.rows.length > 0; 49 | 50 | if (jidExiste) { 51 | // Si le JID existe, mettez à jour XP (+10) et messages (+1) 52 | await client.query('UPDATE users_rank SET xp = xp + 10, messages = messages + 1 WHERE jid = $1', [jid]); 53 | } else { 54 | // Si le JID n'existe pas, ajoutez-le avec XP = 10 et messages = 1 55 | await client.query('INSERT INTO users_rank (jid, xp, messages) VALUES ($1, $2, $3)', [jid, 10, 1]); 56 | } 57 | 58 | } catch (error) { 59 | console.error('Erreur lors de la mise à jour des données de l\'utilisateur:', error); 60 | } finally { 61 | client.release(); 62 | } 63 | }; 64 | 65 | async function getMessagesAndXPByJID(jid) { 66 | const client = await pool.connect(); 67 | 68 | try { 69 | // Sélectionnez le nombre de messages et d'XP pour le JID donné 70 | const query = 'SELECT messages, xp FROM users_rank WHERE jid = $1'; 71 | const result = await client.query(query, [jid]); 72 | 73 | if (result.rows.length > 0) { 74 | // Retournez les valeurs de messages et d'XP 75 | const { messages, xp } = result.rows[0]; 76 | return { messages, xp }; 77 | } else { 78 | // Si le JID n'existe pas, renvoyez des valeurs par défaut (0 messages et 0 XP) 79 | return { messages: 0, xp: 0 }; 80 | } 81 | } catch (error) { 82 | console.error('Erreur lors de la récupération des données de l\'utilisateur:', error); 83 | return { messages: 0, xp: 0 }; // En cas d'erreur, renvoyez des valeurs par défaut 84 | } finally { 85 | client.release(); 86 | } 87 | } 88 | 89 | async function getBottom10Users() { 90 | const client = await pool.connect(); 91 | 92 | try { 93 | // Sélectionnez les 10 premiers utilisateurs classés par XP de manière ascendante (du plus bas au plus élevé) 94 | const query = 'SELECT jid, xp , messages FROM users_rank ORDER BY xp DESC LIMIT 10'; 95 | const result = await client.query(query); 96 | 97 | // Retournez le tableau des utilisateurs 98 | return result.rows; 99 | } catch (error) { 100 | console.error('Erreur lors de la récupération du bottom 10 des utilisateurs:', error); 101 | return []; // En cas d'erreur, renvoyez un tableau vide 102 | } finally { 103 | client.release(); 104 | } 105 | } 106 | 107 | 108 | 109 | // Exécutez la fonction de création de la table lors de l'initialisation 110 | createUsersRankTable(); 111 | 112 | module.exports = { 113 | ajouterOuMettreAJourUserData, 114 | getMessagesAndXPByJID, 115 | getBottom10Users, 116 | }; 117 | -------------------------------------------------------------------------------- /phantom/reaction.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const { zokou } = require("../framework/zokou"); 3 | const fs = require("fs-extra"); 4 | const { exec } = require("child_process"); 5 | const child_process = require('child_process'); 6 | const {unlink } = require ('fs').promises ; 7 | 8 | 9 | // fonction sleep 10 | 11 | const sleep = (ms) =>{ 12 | return new Promise((resolve) =>{ setTimeout (resolve, ms)}) 13 | 14 | } 15 | 16 | // Fonction pour la conversion de GIF en vidéo et récupération du buffer vidéo 17 | const GIFBufferToVideoBuffer = async (image) => { 18 | const filename = `${Math.random().toString(36)}`; 19 | await fs.writeFileSync(`./${filename}.gif`, image); 20 | child_process.exec( 21 | `ffmpeg -i ./${filename}.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" ./${filename}.mp4` 22 | ); 23 | await sleep(4000); 24 | 25 | var buffer5 = await fs.readFileSync(`./${filename}.mp4`); 26 | Promise.all([unlink(`./${filename}.mp4`), unlink(`./${filename}.gif`)]); 27 | return buffer5; 28 | }; 29 | 30 | const generateReactionCommand = (reactionName, reactionEmoji) => { 31 | zokou({ 32 | nomCom: reactionName, 33 | categorie: "Reaction", 34 | reaction: reactionEmoji, 35 | }, 36 | async (origineMessage, zk, commandeOptions) => { 37 | const { auteurMessage, auteurMsgRepondu, repondre, ms, msgRepondu } = commandeOptions; 38 | 39 | const url = `https://api.waifu.pics/sfw/${reactionName}`; 40 | try { 41 | const response = await axios.get(url); 42 | const imageUrl = response.data.url; 43 | 44 | // Obtenir le buffer du GIF en utilisant la fonction getBuffer 45 | const gifBufferResponse = await axios.get(imageUrl, { 46 | responseType: 'arraybuffer' }) ; 47 | const gifBuffer = await gifBufferResponse.data; 48 | 49 | // Convertir le GIF en vidéo et obtenir le buffer vidéo 50 | const videoBuffer = await GIFBufferToVideoBuffer(gifBuffer); 51 | 52 | // Envoyer la vidéo avec Zokou 53 | if (msgRepondu) { 54 | var txt =` @${auteurMessage.split("@")[0]} ${reactionName} @${auteurMsgRepondu.split("@")[0]}` 55 | zk.sendMessage(origineMessage, { video: videoBuffer,gifPlayback: true,caption:txt,mentions:[auteurMessage,auteurMsgRepondu] }, { quoted: ms }); 56 | 57 | } else { 58 | const videoMessage = { 59 | video: videoBuffer, 60 | gifPlayback: true, 61 | caption: `@${auteurMessage.split("@")[0]} ${reactionName} everyone`, 62 | mentions: [auteurMessage] 63 | }; 64 | zk.sendMessage(origineMessage, videoMessage, { quoted: ms }); 65 | } 66 | 67 | } catch (error) { 68 | repondre('Error occurred while retrieving the data. :' + error); 69 | console.log(error); 70 | } 71 | }); 72 | }; 73 | 74 | // ... (utilisation de la fonction generateReactionCommand pour créer des commandes de réaction) 75 | 76 | 77 | generateReactionCommand("bully", "👊"); 78 | generateReactionCommand("cuddle", "🤗"); 79 | generateReactionCommand("cry", "😢"); 80 | generateReactionCommand("hug", "😊"); 81 | generateReactionCommand("awoo", "🐺"); 82 | generateReactionCommand("kiss", "😘"); 83 | generateReactionCommand("lick", "👅"); 84 | generateReactionCommand("pat", "👋"); 85 | generateReactionCommand("smug", "😏"); 86 | generateReactionCommand("bonk", "🔨"); 87 | generateReactionCommand("yeet", "🚀"); 88 | generateReactionCommand("blush", "😊"); 89 | generateReactionCommand("smile", "😄"); 90 | generateReactionCommand("wave", "👋"); 91 | generateReactionCommand("highfive"); 92 | generateReactionCommand("handhold"); 93 | generateReactionCommand("nom","👅" ); 94 | generateReactionCommand("bite", "🦷"); 95 | generateReactionCommand("glomp", "🤗"); 96 | generateReactionCommand("slap", "👋"); 97 | generateReactionCommand("kill", "💀"); 98 | generateReactionCommand("kick", "🦵"); 99 | generateReactionCommand("happy", "😄"); 100 | generateReactionCommand("wink", "😉"); 101 | generateReactionCommand("poke", "👉"); 102 | generateReactionCommand("dance", "💃"); 103 | generateReactionCommand("cringe", "😬"); 104 | -------------------------------------------------------------------------------- /phantom/song.js: -------------------------------------------------------------------------------- 1 | const { zokou } = require("../framework/zokou"); 2 | const yts = require('yt-search'); 3 | const ytdl = require('ytdl-core'); 4 | const fs = require('fs'); 5 | const yt=require("../framework/dl/ytdl-core.js") 6 | const ffmpeg = require("fluent-ffmpeg"); 7 | const yts1 = require("youtube-yts"); 8 | //var fs =require("fs-extra") 9 | 10 | zokou({ 11 | nomCom: "song", 12 | categorie: "Search", 13 | reaction: "🎶" 14 | }, async (origineMessage, zk, commandeOptions) => { 15 | const { ms, repondre, arg } = commandeOptions; 16 | 17 | if (!arg[0]) { 18 | repondre("wrong!!! Ie. _Play hozambe by Phantom ft shifura._"); 19 | return; 20 | } 21 | 22 | try { 23 | let topo = arg.join(" ") 24 | const search = await yts(topo); 25 | const videos = search.videos; 26 | 27 | if (videos && videos.length > 0 && videos[0]) { 28 | const urlElement = videos[0].url; 29 | 30 | let infoMess = { 31 | image: {url : videos[0]. thumbnail}, 32 | caption : `\nPhantom-MD‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎\n\n*Audio name :* _${videos[0].title}_ 33 | 34 | *Time :* _${videos[0].timestamp}_ 35 | 36 | *Url :* _${videos[0].url}_ 37 | 38 | 39 | *Phantom-MD*` 40 | } 41 | 42 | 43 | 44 | 45 | 46 | 47 | zk.sendMessage(origineMessage,infoMess,{quoted:ms}) ; 48 | // Obtenir le flux audio de la vidéo 49 | const audioStream = ytdl(urlElement, { filter: 'audioonly', quality: 'highestaudio' }); 50 | 51 | // Nom du fichier local pour sauvegarder le fichier audio 52 | const filename = 'audio.mp3'; 53 | 54 | // Écrire le flux audio dans un fichier local 55 | const fileStream = fs.createWriteStream(filename); 56 | audioStream.pipe(fileStream); 57 | 58 | fileStream.on('finish', () => { 59 | // Envoi du fichier audio en utilisant l'URL du fichier local 60 | 61 | 62 | zk.sendMessage(origineMessage, { audio: { url:"audio.mp3"},mimetype:'audio/mp4' }, { quoted: ms,ptt: false }); 63 | console.log("Envoi du fichier audio terminé !"); 64 | 65 | 66 | }); 67 | 68 | fileStream.on('error', (error) => { 69 | console.error('Erreur lors de l\'écriture du fichier audio :', error); 70 | repondre('Une erreur est survenue lors de l\'écriture du fichier audio.'); 71 | }); 72 | } else { 73 | repondre('Aucune vidéo trouvée.'); 74 | } 75 | } catch (error) { 76 | console.error('Erreur lors de la recherche ou du téléchargement de la vidéo :', error); 77 | 78 | repondre('Une erreur est survenue lors de la recherche ou du téléchargement de la vidéo.'); 79 | } 80 | }); 81 | -------------------------------------------------------------------------------- /phantom/Answer.js: -------------------------------------------------------------------------------- 1 | const { zokou } = require('../framework/zokou'); 2 | const traduire = require("../framework/traduction") ; 3 | const { default: axios } = require('axios'); 4 | //const conf = require('../set'); 5 | 6 | 7 | 8 | 9 | zokou({nomCom:"bot",reaction:"🤖",categorie:"IA"},async(dest,zk,commandeOptions)=>{ 10 | 11 | const {repondre,ms,arg}=commandeOptions; 12 | 13 | if(!arg || !arg[0]) 14 | {return repondre("Yo Wassup What's Up🧑‍💻.")} 15 | //var quest = arg.join(' '); 16 | try{ 17 | 18 | 19 | const message = await traduire(arg.join(' '),{ to : 'en'}); 20 | console.log(message) 21 | fetch(`http://api.brainshop.ai/get?bid=177607&key=NwzhALqeO1kubFVD&uid=[uid]&msg=${message}`) 22 | .then(response => response.json()) 23 | .then(data => { 24 | const botResponse = data.cnt; 25 | console.log(botResponse); 26 | 27 | traduire(botResponse, { to: 'en' }) 28 | .then(translatedResponse => { 29 | repondre(translatedResponse); 30 | }) 31 | .catch(error => { 32 | console.error('Error when translating into French :', error); 33 | repondre('Error when translating into French'); 34 | }); 35 | }) 36 | .catch(error => { 37 | console.error('Error requesting BrainShop :', error); 38 | repondre('Error requesting BrainShop'); 39 | }); 40 | 41 | }catch(e){ repondre("oops an error : "+e)} 42 | 43 | 44 | }); 45 | 46 | 47 | 48 | zokou({ nomCom: "dalle", reaction: "🤖", categorie: "IA" }, async (dest, zk, commandeOptions) => { 49 | const { repondre, arg, ms } = commandeOptions; 50 | 51 | try { 52 | if (!arg || arg.length === 0) { 53 | return repondre(`Please enter the necessary information to generate the image.`); 54 | } 55 | 56 | // Regrouper les arguments en une seule chaîne séparée par "-" 57 | const image = arg.join(' '); 58 | const response = await axios.get(`http://api.maher-zubair.tech/ai/photoleap?q=${image}`); 59 | 60 | const data = response.data; 61 | let caption = '*Powered By Phantom-MD*'; 62 | 63 | if (data.status == 200) { 64 | // Utiliser les données retournées par le service 65 | const imageUrl = data.result; 66 | zk.sendMessage(dest, { image: { url: imageUrl }, caption: caption }, { quoted: ms }); 67 | } else { 68 | repondre("Error during image generation."); 69 | } 70 | } catch (error) { 71 | console.error('Erreur:', error.message || 'Une erreur s\'est produite'); 72 | repondre("Oops, an error occurred while processing your request"); 73 | } 74 | }); 75 | 76 | zokou({ nomCom: "ai", reaction: "🤖", categorie: "IA" }, async (dest, zk, commandeOptions) => { 77 | const { repondre, arg, ms } = commandeOptions; 78 | 79 | try { 80 | if (!arg || arg.length === 0) { 81 | return repondre(`Please ask a question.`); 82 | } 83 | 84 | // Regrouper les arguments en une seule chaîne séparée par "-" 85 | const question = arg.join(' '); 86 | const response = await axios.get(`http://api.maher-zubair.tech/ai/chatgpt4?q=${question}`); 87 | 88 | const data = response.data; 89 | if (data) { 90 | repondre(data.result); 91 | } else { 92 | repondre("Error during response generation."); 93 | } 94 | } catch (error) { 95 | console.error('Erreur:', error.message || 'Une erreur s\'est produite'); 96 | repondre("Oops, an error occurred while processing your request."); 97 | } 98 | }); 99 | 100 | 101 | zokou({ nomCom: "gpt", reaction: "🤖", categorie: "IA" }, async (dest, zk, commandeOptions) => { 102 | const { repondre, arg, ms } = commandeOptions; 103 | 104 | try { 105 | if (!arg || arg.length === 0) { 106 | return repondre(`Please ask a question.`); 107 | } 108 | 109 | // Regrouper les arguments en une seule chaîne séparée par "-" 110 | const question = arg.join(' '); 111 | const response = await axios.get(`https://gpt4.giftedtech.workers.dev/?prompt=${question}`); 112 | 113 | const data = response.data; 114 | if (data) { 115 | repondre(data.result); 116 | } else { 117 | repondre("Error during response generation."); 118 | } 119 | } catch (error) { 120 | console.error('Erreur:', error.message || 'Une erreur s\'est produite'); 121 | repondre("Oops, an error occurred while processing your request."); 122 | } 123 | }); 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /set.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra'); 2 | const { Sequelize } = require('sequelize'); 3 | if (fs.existsSync('set.env')) 4 | require('dotenv').config({ path: __dirname + '/set.env' }); 5 | const path = require("path"); 6 | const databasePath = path.join(__dirname, './database.db'); 7 | const DATABASE_URL = process.env.DATABASE_URL === undefined 8 | ? databasePath 9 | : process.env.DATABASE_URL; 10 | module.exports = { session: process.env.SESSION_ID || 'eyJub2lzZUtleSI6eyJwcml2YXRlIjp7InR5cGUiOiJCdWZmZXIiLCJkYXRhIjoiRU9JeXVLYzB6cmdIRWI1SkthZGRkVWhGRnByUTAwTWZwM3UvemVBd0ZIQT0ifSwicHVibGljIjp7InR5cGUiOiJCdWZmZXIiLCJkYXRhIjoielB5ck9SN0pmS3kzZ08yWjVGNlFPV3JxS0FrNDlPMjVPSjQ4WFE0eXEyST0ifX0sInBhaXJpbmdFcGhlbWVyYWxLZXlQYWlyIjp7InByaXZhdGUiOnsidHlwZSI6IkJ1ZmZlciIsImRhdGEiOiJrR3VSUHBoamo1ckk4TDFkcHhxZm1NZS96aGlkdlgxa05lUzJMWHozSWswPSJ9LCJwdWJsaWMiOnsidHlwZSI6IkJ1ZmZlciIsImRhdGEiOiJxdWZnbjRKYkdPWVhZcWcxOGtQMjdpMmREbGt1cTB5YnVUclE2OUpxbjJBPSJ9fSwic2lnbmVkSWRlbnRpdHlLZXkiOnsicHJpdmF0ZSI6eyJ0eXBlIjoiQnVmZmVyIiwiZGF0YSI6IlVOU1VkdzBSVzh5S2h1OStTcXFsMTAyM1BTU0w2cjJQVmcxazhOTFNUbE09In0sInB1YmxpYyI6eyJ0eXBlIjoiQnVmZmVyIiwiZGF0YSI6IjBaV3RpbzAwYk1YalVuNEYrcGxGV2VPTWYzMWdJVjNwVGJpREwxdG4zMlk9In19LCJzaWduZWRQcmVLZXkiOnsia2V5UGFpciI6eyJwcml2YXRlIjp7InR5cGUiOiJCdWZmZXIiLCJkYXRhIjoid0JwdklSZnloMGdvM29iM3NQcVpvck5kcWdra3pkVFcxZHZ5YVpuV2ZXaz0ifSwicHVibGljIjp7InR5cGUiOiJCdWZmZXIiLCJkYXRhIjoiR0xHZXFrS3lzSjBUZCs5SGRLemtEZXJCWFkxdWhGZlBzaU4vcHB4R0hIND0ifX0sInNpZ25hdHVyZSI6eyJ0eXBlIjoiQnVmZmVyIiwiZGF0YSI6IlpyelFjMVdsSndjRjBaWTNjNkEyeVp6SGlrVHNZa0p2V0RLQmtqZ1FKVlRVaTEvLy9Fc091bW9xQXBtN24wNFFjMkZaRlVuYzlTejV1dnk3c0tJVGlRPT0ifSwia2V5SWQiOjF9LCJyZWdpc3RyYXRpb25JZCI6MjUwLCJhZHZTZWNyZXRLZXkiOiI3eFYxME1MS1VWMU5EaGo2NWw5ZWRwNFJVVmxmUWRLSEo2SEZ5RGZxKzZFPSIsInByb2Nlc3NlZEhpc3RvcnlNZXNzYWdlcyI6W10sIm5leHRQcmVLZXlJZCI6MzEsImZpcnN0VW51cGxvYWRlZFByZUtleUlkIjozMSwiYWNjb3VudFN5bmNDb3VudGVyIjowLCJhY2NvdW50U2V0dGluZ3MiOnsidW5hcmNoaXZlQ2hhdHMiOmZhbHNlfSwiZGV2aWNlSWQiOiJlUzJVVzFLY1RiQ0tyNE0xM3E4YVdnIiwicGhvbmVJZCI6Ijc3OTI4MTU3LTk0OTYtNGUwNC05NjI2LTNkOTJhMDc4Y2Q1YyIsImlkZW50aXR5SWQiOnsidHlwZSI6IkJ1ZmZlciIsImRhdGEiOiJvOGU5RlcvTTkvY1VIem1EdE4yV1NMK05LRlU9In0sInJlZ2lzdGVyZWQiOnRydWUsImJhY2t1cFRva2VuIjp7InR5cGUiOiJCdWZmZXIiLCJkYXRhIjoiTE5yTzZrcHRPZlJnT0ZYV2Y3NnBCYW9IYU5ZPSJ9LCJyZWdpc3RyYXRpb24iOnt9LCJwYWlyaW5nQ29kZSI6IllQWllDUzY5IiwibWUiOnsiaWQiOiIyNzc0MzI2Njc4OToyQHMud2hhdHNhcHAubmV0IiwibmFtZSI6IkthdGFrdXJpIn0sImFjY291bnQiOnsiZGV0YWlscyI6IkNOVzEvcXdERVB6Ung3b0dHQUlnQUNnQSIsImFjY291bnRTaWduYXR1cmVLZXkiOiJJOTFsU0FtenE0UThGMkwwZ3NVMC93bVdEWnZwU29uNXBxSUcvU2VlRGdnPSIsImFjY291bnRTaWduYXR1cmUiOiJPcUdZai91NFl1VlA2cDRsczNrRHZYcllnM0hEeXFibVpmSXVtOTRtNWM0U0daOUJLWkdtMDZVRTBEZXZSREdCV25UZnRKcm1ZZFA1Tytoa2NaMzhCZz09IiwiZGV2aWNlU2lnbmF0dXJlIjoiUmFhWTdyNmZZTFJEU1FMNFZvakNDbzd5dHpETFhqeTRRVUVKVmVLbUQ1T0lIS3RRT2pkRGRKUGo0WjJPTGJrMDBmRGJSNmNDU08zZlVZalowRCszaGc9PSJ9LCJzaWduYWxJZGVudGl0aWVzIjpbeyJpZGVudGlmaWVyIjp7Im5hbWUiOiIyNzc0MzI2Njc4OToyQHMud2hhdHNhcHAubmV0IiwiZGV2aWNlSWQiOjB9LCJpZGVudGlmaWVyS2V5Ijp7InR5cGUiOiJCdWZmZXIiLCJkYXRhIjoiQlNQZFpVZ0pzNnVFUEJkaTlJTEZOUDhKbGcyYjZVcUorYWFpQnYwbm5nNEkifX1dLCJwbGF0Zm9ybSI6InNtYmEiLCJsYXN0QWNjb3VudFN5bmNUaW1lc3RhbXAiOjE3MzM0MjEzMjEsIm15QXBwU3RhdGVLZXlJZCI6IkFBQUFBREdtIn0=', 11 | PREFIXE: process.env.PREFIX || ".", 12 | OWNER_NAME: process.env.OWNER_NAME || "Phantom", 13 | NUMERO_OWNER : process.env.NUMERO_OWNER || "27748255848", 14 | AUTO_READ_STATUS: process.env.AUTO_READ_STATUS || "yes", 15 | AUTO_DOWNLOAD_STATUS: process.env.AUTO_DOWNLOAD_STATUS || 'no', 16 | BOT : process.env.BOT_NAME || 'Phantom-MD', 17 | URL : process.env.BOT_MENU_LINKS || 'https://files.catbox.moe/uuye39.jpg', 18 | MODE: process.env.PUBLIC_MODE || "yes", 19 | PM_PERMIT: process.env.PM_PERMIT || 'yes', 20 | HEROKU_APP_NAME : process.env.HEROKU_APP_NAME, 21 | HEROKU_APY_KEY : process.env.HEROKU_APY_KEY , 22 | WARN_COUNT : process.env.WARN_COUNT || '3' , 23 | ETAT : process.env.PRESENCE || '', 24 | CHATBOT : process.env.PM_CHATBOT || 'no', 25 | DP : process.env.STARTING_BOT_MESSAGE || "yes", 26 | ADM : process.env.ANTI_DELETE_MESSAGE || 'no', 27 | DATABASE_URL, 28 | DATABASE: DATABASE_URL === databasePath 29 | ? "postgresql://postgres:bKlIqoOUWFIHOAhKxRWQtGfKfhGKgmRX@viaduct.proxy.rlwy.net:47738/railway" : "postgresql://postgres:bKlIqoOUWFIHOAhKxRWQtGfKfhGKgmRX@viaduct.proxy.rlwy.net:47738/railway", 30 | 31 | }; 32 | let fichier = require.resolve(__filename); 33 | fs.watchFile(fichier, () => { 34 | fs.unwatchFile(fichier); 35 | console.log(`mise à jour ${__filename}`); 36 | delete require.cache[fichier]; 37 | require(fichier); 38 | }); 39 | -------------------------------------------------------------------------------- /phantom/weeb.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const fs = require('fs'); 3 | const { zokou } = require("../framework/zokou"); 4 | const { writeFile } = require('fs/promises') 5 | 6 | // Commande waifu 7 | zokou({ 8 | nomCom: "waifu", 9 | categorie: "Weeb", 10 | reaction: "😏" 11 | }, 12 | async (origineMessage, zk, commandeOptions) => { 13 | const { repondre, ms } = commandeOptions; 14 | 15 | const url = 'https://api.waifu.pics/sfw/waifu'; // Remplacez avec le lien réel de l'API waifu.pics 16 | 17 | try { 18 | 19 | for (let i = 0; i < 5; i++) { 20 | const response = await axios.get(url); 21 | const imageUrl = response.data.url; 22 | 23 | zk.sendMessage(origineMessage, { image: { url: imageUrl } }, { quoted: ms }); 24 | } 25 | } catch (error) { 26 | repondre('Error occurred while retrieving the data. :', error); 27 | } 28 | }); 29 | 30 | // Commande neko 31 | zokou({ 32 | nomCom: "neko", 33 | categorie: "Weeb", 34 | reaction: "😺" 35 | }, 36 | async (origineMessage, zk, commandeOptions) => { 37 | const { repondre, ms } = commandeOptions; 38 | 39 | const url = 'https://api.waifu.pics/sfw/neko'; // Remplacez avec le lien réel de l'API waifu.pics ou une autre API de nekos 40 | 41 | try { 42 | for (let i = 0; i < 5; i++) { 43 | const response = await axios.get(url); 44 | const imageUrl = response.data.url; 45 | 46 | zk.sendMessage(origineMessage, { image: { url: imageUrl } }, { quoted: ms }); 47 | } 48 | } catch (error) { 49 | repondre('Error occurred while retrieving the data. :', error); 50 | } 51 | }); 52 | 53 | // Commande shinobu 54 | zokou({ 55 | nomCom: "shinobu", 56 | categorie: "Weeb", 57 | reaction: "🦋" 58 | }, 59 | async (origineMessage, zk, commandeOptions) => { 60 | const { repondre, ms } = commandeOptions; 61 | 62 | const url = 'https://api.waifu.pics/sfw/shinobu'; // Remplacez avec le lien réel de l'API waifu.pics ou une autre API avec des images de Shinobu 63 | 64 | try { 65 | for (let i = 0; i < 5; i++) { 66 | const response = await axios.get(url); 67 | const imageUrl = response.data.url; 68 | 69 | zk.sendMessage(origineMessage, { image: { url: imageUrl } }, { quoted: ms }); 70 | } 71 | } catch (error) { 72 | repondre('Error occurred while retrieving the data. :', error); 73 | } 74 | }); 75 | 76 | // Commande megumin 77 | zokou({ 78 | nomCom: "megumin", 79 | categorie: "Weeb", 80 | reaction: "💥" 81 | }, 82 | async (origineMessage, zk, commandeOptions) => { 83 | const { repondre, ms } = commandeOptions; 84 | 85 | const url = 'https://api.waifu.pics/sfw/megumin'; // Remplacez avec le lien réel de l'API waifu.pics ou une autre API avec des images de Megumin 86 | 87 | try { 88 | for (let i = 0; i < 5; i++) { 89 | const response = await axios.get(url); 90 | const imageUrl = response.data.url; 91 | 92 | zk.sendMessage(origineMessage,{ image: { url: imageUrl } }, { quoted: ms }); 93 | } 94 | } catch (error) { 95 | repondre('Error occurred while retrieving the data. :', error); 96 | } 97 | }); 98 | 99 | 100 | 101 | zokou({ 102 | nomCom: "cosplay", 103 | categorie: "Weeb", 104 | reaction: "😏" 105 | }, 106 | async (origineMessage, zk, commandeOptions) => { 107 | const { repondre, ms } = commandeOptions; 108 | 109 | 110 | 111 | try { 112 | for (let i = 0; i < 5; i++) { 113 | let url = 'https://fantox-cosplay-api.onrender.com/' 114 | 115 | const response = await axios.get(url, { responseType: 'arraybuffer' }) 116 | 117 | 118 | 119 | const image = response.data; 120 | 121 | await writeFile('./cosplay.jpg', image) 122 | zk.sendMessage(origineMessage,{image : {url : `./cosplay.jpg`}},{quoted :ms}) } 123 | 124 | } catch (e) { 125 | repondre("je reçois malheureusement une erreur : " + e); 126 | } 127 | }); 128 | 129 | 130 | zokou({nomCom:"couplepp",categorie: "Weeb",reaction : "💞"},async(dest,zk,commandeOptions)=>{ const {repondre , ms} = commandeOptions; 131 | let api = 'https://smiling-hosiery-bear.cyclic.app/weeb/couplepp' 132 | try { 133 | repondre('she/he dont love you :)') 134 | const result = await axios.get(api) 135 | 136 | 137 | zk.sendMessage(dest, { image: { url: result.data.male }, caption: `For Man` }, { quoted: ms }) 138 | zk.sendMessage(dest, { image: { url: result.data.female }, caption: `_For woman_` }, { quoted: ms }) 139 | 140 | } catch (e) { repondre(e)} 141 | 142 | } 143 | ) 144 | 145 | -------------------------------------------------------------------------------- /phantom/devinette.js: -------------------------------------------------------------------------------- 1 | const { zokou } = require('../framework/zokou'); 2 | 3 | // Set a riddle list with questions and answers 4 | const devinettes = [ 5 | { 6 | question: "I can fly without wings, who am I?", 7 | reponse: "The weather", 8 | }, 9 | { 10 | question: "I'm always hungry, the more I eat, the fatter I become. Who am I ?", 11 | reponse: "A black hole", 12 | }, 13 | { 14 | question: "I'm strong when I'm down, but I'm weak when I'm up. Who am I ?", 15 | reponse: "The number 6", 16 | }, 17 | { 18 | question: "I can be short or long, hard or soft, I can be used by anyone, from young children to experienced musicians. Who am I ?", 19 | reponse: "A pencil", 20 | }, 21 | { 22 | question: "I am the beginning of the end, the end of every place. I am the beginning of eternity, the end of time and space. Who am I ?", 23 | reponse: "The letter 'e'", 24 | }, 25 | { 26 | question: "I am white when I am dirty and black when I am clean. Who am I ?", 27 | reponse: "A slate", 28 | }, 29 | { 30 | question: "I'm liquid, but if you take water away from me, I become solid. Who am I ?", 31 | reponse: "Tea", 32 | }, 33 | { 34 | question: "I fly without wings, I cry without eyes. Wherever I am, death always accompanies me. Who am I ?", 35 | reponse: "The wind", 36 | }, 37 | { 38 | question: "I have towns, but no houses. I have mountains, but no trees. I have water, but no fish. Who am I ?", 39 | reponse: "A map", 40 | }, 41 | { 42 | question: "I can be read, but you can't write about me. You always give to me, but rarely keep me. Who am I ?", 43 | reponse: "A borrowed book", 44 | }, 45 | { 46 | question: "I come twice in a week, once in a year, but never in a day. Who am I ?", 47 | reponse: "The letter 'E'", 48 | }, 49 | { 50 | question: "I'm hard to grasp, but you will hold me in your hand when you find me. Who am I ?", 51 | reponse: "Your breath", 52 | }, 53 | { 54 | question: "The hotter I am, the colder I become. Who am I ?", 55 | reponse: "coffe", 56 | }, 57 | { 58 | question: "I am the stuff of dreams. I cover broken ideas. I change souls into wings. Who am I ?", 59 | reponse: "A book", 60 | }, 61 | { 62 | question: "I am white when I am dirty and black when I am clean. Who am I?", 63 | reponse: "A slate", 64 | }, 65 | { 66 | question: "I can fly without having wings. I can cry without having eyes. Who am I ?", 67 | reponse: "A cloud", 68 | }, 69 | { 70 | question: "I start at night and finish in the morning. Who am I ?", 71 | reponse: "The letter 'N'", 72 | }, 73 | { 74 | question: "I can be read, but you can't write about me. You always give to me, but rarely keep me. Who am I ?", 75 | reponse: "A borrowed book", 76 | }, 77 | { 78 | question: "I feed on everything around me, the air, the earth and even the trees. Who am I ?", 79 | reponse: "a fire", 80 | }, 81 | { 82 | question: "I am white when I am dirty and black when I am clean. Who am I ?", 83 | reponse: "A slate", 84 | }, 85 | { 86 | question: "I'm liquid, but if you take water away from me, I become solid. Who am I ?", 87 | reponse: "tea", 88 | }, 89 | { 90 | question: "I am the beginning of the end and the end of every place. I am the beginning of eternity, the end of time and space. Who am I ?", 91 | reponse: "the letter'E'", 92 | }, 93 | { 94 | question: "I am the best dev according to myself and my best friend is Baraka Bega. Who am i?", 95 | reponse: "Phantom👑", 96 | }, 97 | { 98 | question: "I'm hard to grasp, but you will hold me in your hand when you find me. Who am I ?", 99 | reponse: "Your breath", 100 | }, 101 | ]; 102 | 103 | zokou({ nomCom: "riddle", categorie: "Games" }, async (dest, zk, commandeOptions) => { 104 | const { ms, repondre } = commandeOptions; 105 | 106 | // Choose a random riddle 107 | const devinette = devinettes[Math.floor(Math.random() * devinettes.length)]; 108 | // Send the riddle question 109 | await zk.sendMessage( 110 | dest, 111 | { 112 | text: `Riddle: ${devinette.question} . \n you have 30 seconds to think about.`, 113 | }, 114 | { quoted: ms } 115 | ); 116 | 117 | //Wait 60 seconds before sending the response 118 | await delay(30000); 119 | 120 | // Answer 121 | await zk.sendMessage( 122 | dest, 123 | { 124 | text: `The answer was : ${devinette.reponse}`, 125 | }, 126 | { quoted: ms } 127 | ); 128 | }); 129 | 130 | // Function to create a pause/delay in milliseconds 131 | function delay(ms) { 132 | return new Promise((resolve) => setTimeout(resolve, ms)); 133 | } 134 | -------------------------------------------------------------------------------- /phantom/yt-search.js: -------------------------------------------------------------------------------- 1 | const { zokou } = require("../framework/zokou"); 2 | const { getytlink, ytdwn } = require("../framework/ytdl-core"); 3 | const yts = require("yt-search"); 4 | const ytdl = require('ytdl-core'); 5 | const fs = require('fs'); 6 | 7 | zokou({ nomCom: "yts", categorie: "Search", reaction: "✋" }, async (dest, zk, commandeOptions) => { 8 | const { ms, repondre, arg } = commandeOptions; 9 | const query = arg.join(" "); 10 | 11 | if (!query[0]) { 12 | repondre("what do you want"); 13 | return; 14 | } 15 | 16 | try { 17 | const info = await yts(query); 18 | const resultat = info.videos; 19 | 20 | let captions = ""; 21 | for (let i = 0; i < 10; i++) { 22 | captions += `----------------\nTitle: ${resultat[i].title}\nTime : ${resultat[i].timestamp}\nUrl: ${resultat[i].url}\n`; 23 | } 24 | captions += "\n======\n*powered by Bmw-Md*"; 25 | 26 | // repondre(captions) 27 | zk.sendMessage(dest, { image: { url: resultat[0].thumbnail }, caption: captions }, { quoted: ms }); 28 | } catch (error) { 29 | repondre("Erreur lors de la procédure : " + error); 30 | } 31 | }); 32 | 33 | zokou({ 34 | nomCom: "ytmp4", 35 | categorie: "Download", 36 | reaction: "🎥" 37 | }, async (origineMessage, zk, commandeOptions) => { 38 | const { arg, ms, repondre } = commandeOptions; 39 | 40 | if (!arg[0]) { 41 | repondre("insert a youtube link"); 42 | return; 43 | } 44 | 45 | const topo = arg.join(" "); 46 | try { 47 | /* const search = await yts(topo); 48 | const videos = search.videos; 49 | 50 | if (videos && videos.length > 0 && videos[0]) { 51 | const Element = videos[0]; 52 | 53 | let InfoMess = { 54 | image: { url: videos[0].thumbnail }, 55 | caption: `*nom de la vidéo :* _${Element.title}_ 56 | *Durée :* _${Element.timestamp}_ 57 | *Lien :* _${Element.url}_ 58 | _*En cours de téléchargement...*_\n\n` 59 | }; 60 | 61 | zk.sendMessage(origineMessage, InfoMess, { quoted: ms }); 62 | */ 63 | 64 | // Obtenir les informations de la vidéo à partir du lien YouTube 65 | const videoInfo = await ytdl.getInfo(topo); 66 | // Format vidéo avec la meilleure qualité disponible 67 | const format = ytdl.chooseFormat(videoInfo.formats, { quality: '18' }); 68 | // Télécharger la vidéo 69 | const videoStream = ytdl.downloadFromInfo(videoInfo, { format }); 70 | 71 | // Nom du fichier local pour sauvegarder la vidéo 72 | const filename = 'video.mp4'; 73 | 74 | // Écrire le flux vidéo dans un fichier local 75 | const fileStream = fs.createWriteStream(filename); 76 | videoStream.pipe(fileStream); 77 | 78 | fileStream.on('finish', () => { 79 | // Envoi du fichier vidéo en utilisant l'URL du fichier local 80 | zk.sendMessage(origineMessage, { video: { url: `./${filename}` }, caption: "*Powered By Phantom-MD*", gifPlayback: false }, { quoted: ms }); 81 | 82 | }); 83 | 84 | fileStream.on('error', (error) => { 85 | console.error('Erreur lors de l\'écriture du fichier vidéo :', error); 86 | repondre('Une erreur est survenue lors de l\'écriture du fichier vidéo.'); 87 | }); 88 | 89 | } catch (error) { 90 | console.error('Erreur lors de la recherche ou du téléchargement de la vidéo :', error); 91 | repondre('Une erreur est survenue lors de la recherche ou du téléchargement de la vidéo.' + error); 92 | } 93 | }); 94 | 95 | zokou({ 96 | nomCom: "ytmp3", 97 | categorie: "Download", 98 | reaction: "💿" 99 | }, async (origineMessage, zk, commandeOptions) => { 100 | const { ms, repondre, arg } = commandeOptions; 101 | 102 | if (!arg[0]) { 103 | repondre("Insert a youtube link"); 104 | return; 105 | } 106 | 107 | try { 108 | let topo = arg.join(" "); 109 | 110 | const audioStream = ytdl(topo, { filter: 'audioonly', quality: 'highestaudio' }); 111 | 112 | // Nom du fichier local pour sauvegarder le fichier audio 113 | const filename = 'audio.mp3'; 114 | 115 | // Écrire le flux audio dans un fichier local 116 | const fileStream = fs.createWriteStream(filename); 117 | audioStream.pipe(fileStream); 118 | 119 | fileStream.on('finish', () => { 120 | // Envoi du fichier audio en utilisant l'URL du fichier local 121 | zk.sendMessage(origineMessage, { audio: { url: `./${filename}` }, mimetype: 'audio/mp4' }, { quoted: ms, ptt: false }); 122 | console.log("Envoi du fichier audio terminé !"); 123 | }); 124 | 125 | fileStream.on('error', (error) => { 126 | console.error('Erreur lors de l\'écriture du fichier audio :', error); 127 | repondre('Une erreur est survenue lors de l\'écriture du fichier audio.'); 128 | }); 129 | 130 | } catch (error) { 131 | console.error('Erreur lors de la recherche ou du téléchargement de la vidéo :', error); 132 | repondre('Une erreur est survenue lors de la recherche ou du téléchargement de la vidéo.'); 133 | } 134 | }); 135 | -------------------------------------------------------------------------------- /bdd/sudo.js: -------------------------------------------------------------------------------- 1 | // Importez dotenv et chargez les variables d'environnement depuis le fichier .env 2 | require("dotenv").config(); 3 | 4 | const { Pool } = require("pg"); 5 | 6 | // Utilisez le module 'set' pour obtenir la valeur de DATABASE_URL depuis vos configurations 7 | const s = require("../set"); 8 | 9 | // Récupérez l'URL de la base de données de la variable s.DATABASE_URL 10 | var dbUrl=s.DATABASE_URL?s.DATABASE_URL:"postgres://db_7xp9_user:6hwmTN7rGPNsjlBEHyX49CXwrG7cDeYi@dpg-cj7ldu5jeehc73b2p7g0-a.oregon-postgres.render.com/db_7xp9" 11 | const proConfig = { 12 | connectionString: dbUrl, 13 | ssl: { 14 | rejectUnauthorized: false, 15 | }, 16 | }; 17 | 18 | const pool = new Pool(proConfig); 19 | 20 | // Fonction pour créer la table "sudo" 21 | async function createSudoTable() { 22 | const client = await pool.connect(); 23 | try { 24 | // Exécutez une requête SQL pour créer la table "sudo" si elle n'existe pas déjà 25 | await client.query(` 26 | CREATE TABLE IF NOT EXISTS sudo ( 27 | id serial PRIMARY KEY, 28 | jid text NOT NULL 29 | ); 30 | `); 31 | console.log("La table 'sudo' a été créée avec succès."); 32 | } catch (error) { 33 | console.error("Une erreur est survenue lors de la création de la table 'sudo':", error); 34 | } finally { 35 | client.release(); 36 | } 37 | } 38 | 39 | // Appelez la méthode pour créer la table "sudo" 40 | createSudoTable(); 41 | 42 | 43 | // Fonction pour vérifier si un groupe est banni 44 | async function issudo(jid) { 45 | const client = await pool.connect(); 46 | try { 47 | // Vérifiez si le groupe existe dans la table "banGroup" 48 | const query = "SELECT EXISTS (SELECT 1 FROM sudo WHERE jid = $1)"; 49 | const values = [jid]; 50 | 51 | const result = await client.query(query, values); 52 | return result.rows[0].exists; 53 | } catch (error) { 54 | console.error("Erreur lors de la vérification du groupe banni :", error); 55 | return false; 56 | } finally { 57 | client.release(); 58 | } 59 | } 60 | 61 | // Fonction pour supprimer un groupe de la liste des groupes bannis 62 | async function removeSudoNumber(jid) { 63 | const client = await pool.connect(); 64 | try { 65 | // Supprimez le numéro de téléphone de la table "sudo" 66 | const query = "DELETE FROM sudo WHERE jid = $1"; 67 | const values = [jid]; 68 | 69 | await client.query(query, values); 70 | console.log(`Numéro de téléphone ${jid} supprimé de la liste des numéros de téléphone autorisés.`); 71 | } catch (error) { 72 | console.error("Erreur lors de la suppression du numéro de téléphone autorisé :", error); 73 | } finally { 74 | client.release(); 75 | } 76 | } 77 | 78 | async function addSudoNumber(jid) { 79 | const client = await pool.connect(); 80 | try { 81 | // Insérez le numéro de téléphone dans la table "sudo" 82 | const query = "INSERT INTO sudo (jid) VALUES ($1)"; 83 | const values = [jid]; 84 | 85 | await client.query(query, values); 86 | console.log(`Numéro de téléphone ${jid} ajouté à la liste des numéros de téléphone autorisés.`); 87 | } catch (error) { 88 | console.error("Erreur lors de l'ajout du numéro de téléphone autorisé :", error); 89 | } finally { 90 | client.release(); 91 | } 92 | } 93 | 94 | async function getAllSudoNumbers() { 95 | const client = await pool.connect(); 96 | try { 97 | // Sélectionnez tous les numéros de téléphone de la table "sudo" 98 | const query = "SELECT jid FROM sudo"; 99 | const result = await client.query(query); 100 | 101 | // Créez un tableau des numéros de téléphone 102 | const sudoNumbers = result.rows.map((row) => row.jid); 103 | 104 | return sudoNumbers; 105 | } catch (error) { 106 | console.error("Erreur lors de la récupération des numéros de téléphone autorisés :", error); 107 | return []; 108 | } finally { 109 | client.release(); 110 | } 111 | } 112 | 113 | async function isSudoTableNotEmpty() { 114 | const client = await pool.connect(); 115 | 116 | try { 117 | // Exécutez une requête SQL pour compter le nombre de lignes dans la table "sudo" 118 | const result = await client.query('SELECT COUNT(*) FROM sudo'); 119 | 120 | // Récupérez la valeur du compteur (nombre de lignes) 121 | const rowCount = parseInt(result.rows[0].count); 122 | 123 | // Si le nombre de lignes est supérieur à zéro, la table n'est pas vide 124 | return rowCount > 0; 125 | } catch (error) { 126 | console.error('Erreur lors de la vérification de la table "sudo" :', error); 127 | return false; // En cas d'erreur, considérez la table comme vide 128 | } finally { 129 | client.release(); 130 | } 131 | }; 132 | 133 | 134 | 135 | 136 | module.exports = { 137 | issudo, 138 | addSudoNumber, 139 | removeSudoNumber, 140 | getAllSudoNumbers, 141 | isSudoTableNotEmpty 142 | }; 143 | 144 | -------------------------------------------------------------------------------- /bdd/antilien.js: -------------------------------------------------------------------------------- 1 | require("dotenv").config(); 2 | const { Pool } = require("pg"); 3 | let s =require("../set") 4 | var dbUrl=s.DATABASE_URL?s.DATABASE_URL:"postgres://db_7xp9_user:6hwmTN7rGPNsjlBEHyX49CXwrG7cDeYi@dpg-cj7ldu5jeehc73b2p7g0-a.oregon-postgres.render.com/db_7xp9" 5 | 6 | const proConfig = { 7 | connectionString:dbUrl , 8 | ssl: { 9 | rejectUnauthorized: false, 10 | }, 11 | }; 12 | 13 | const pool = new Pool(proConfig); 14 | 15 | 16 | // Fonction pour créer la table "antilien" 17 | async function createAntilienTable() { 18 | const client = await pool.connect(); 19 | try { 20 | // Exécutez une requête SQL pour créer la table "antilien" si elle n'existe pas déjà 21 | await client.query(` 22 | CREATE TABLE IF NOT EXISTS antilien ( 23 | jid text PRIMARY KEY, 24 | etat text, 25 | action text 26 | ); 27 | `); 28 | console.log("La table 'antilien' a été créée avec succès."); 29 | } catch (error) { 30 | console.error("Une erreur est survenue lors de la création de la table 'antilien':", error); 31 | } finally { 32 | client.release(); 33 | } 34 | } 35 | 36 | // Appelez la méthode pour créer la table "antilien" 37 | createAntilienTable(); 38 | 39 | 40 | 41 | async function ajouterOuMettreAJourJid(jid, etat) { 42 | const client = await pool.connect(); 43 | 44 | try { 45 | // Vérifiez si le jid existe déjà dans la table 'antilien' 46 | const result = await client.query('SELECT * FROM antilien WHERE jid = $1', [jid]); 47 | const jidExiste = result.rows.length > 0; 48 | 49 | if (jidExiste) { 50 | // Si le jid existe, mettez à jour l'état avec la valeur passée en argument 51 | await client.query('UPDATE antilien SET etat = $1 WHERE jid = $2', [etat, jid]); 52 | } else { 53 | // Si le jid n'existe pas, ajoutez-le avec l'état passé en argument et l'action 'supp' par défaut 54 | await client.query('INSERT INTO antilien (jid, etat, action) VALUES ($1, $2, $3)', [jid, etat, 'supp']); 55 | } 56 | 57 | console.log(`JID ${jid} ajouté ou mis à jour avec succès dans la table 'antilien'.`); 58 | } catch (error) { 59 | console.error('Erreur lors de l\'ajout ou de la mise à jour du JID dans la table ,', error); 60 | } finally { 61 | client.release(); 62 | } 63 | }; 64 | 65 | 66 | async function mettreAJourAction(jid, action) { 67 | const client = await pool.connect(); 68 | 69 | try { 70 | // Vérifiez si le jid existe déjà dans la table 'antilien' 71 | const result = await client.query('SELECT * FROM antilien WHERE jid = $1', [jid]); 72 | const jidExiste = result.rows.length > 0; 73 | 74 | if (jidExiste) { 75 | // Si le jid existe, mettez à jour l'action avec la valeur fournie (et laissez l'état inchangé) 76 | await client.query('UPDATE antilien SET action = $1 WHERE jid = $2', [action, jid]); 77 | } else { 78 | // Si le jid n'existe pas, ajoutez-le avec l'état 'non' par défaut et l'action fournie 79 | await client.query('INSERT INTO antilien (jid, etat, action) VALUES ($1, $2, $3)', [jid, 'non', action]); 80 | } 81 | 82 | console.log(`Action mise à jour avec succès pour le JID ${jid} dans la table 'antilien'.`); 83 | } catch (error) { 84 | console.error('Erreur lors de la mise à jour de l\'action pour le JID dans la table :', error); 85 | } finally { 86 | client.release(); 87 | } 88 | }; 89 | 90 | 91 | 92 | async function verifierEtatJid(jid) { 93 | const client = await pool.connect(); 94 | 95 | try { 96 | // Recherchez le JID dans la table 'antilien' et récupérez son état 97 | const result = await client.query('SELECT etat FROM antilien WHERE jid = $1', [jid]); 98 | 99 | if (result.rows.length > 0) { 100 | const etat = result.rows[0].etat; 101 | return etat === 'oui'; 102 | } else { 103 | // Si le JID n'existe pas dans la table, il n'est pas enregistré comme "oui" 104 | return false; 105 | } 106 | } catch (error) { 107 | console.error('Erreur lors de la vérification de l\'état du JID dans la table ', error); 108 | return false; 109 | } finally { 110 | client.release(); 111 | } 112 | }; 113 | 114 | async function recupererActionJid(jid) { 115 | const client = await pool.connect(); 116 | 117 | try { 118 | // Recherchez le JID dans la table 'antilien' et récupérez son action 119 | const result = await client.query('SELECT action FROM antilien WHERE jid = $1', [jid]); 120 | 121 | if (result.rows.length > 0) { 122 | const action = result.rows[0].action; 123 | return action; 124 | } else { 125 | // Si le JID n'existe pas dans la table, retournez une valeur par défaut (par exemple, 'supp') 126 | return 'supp'; 127 | } 128 | } catch (error) { 129 | console.error('Erreur lors de la récupération de l\'action du JID dans la table :', error); 130 | return 'supp'; // Gestion de l'erreur en retournant une valeur par défaut 131 | } finally { 132 | client.release(); 133 | } 134 | }; 135 | 136 | 137 | 138 | 139 | 140 | module.exports = { 141 | mettreAJourAction, 142 | ajouterOuMettreAJourJid, 143 | verifierEtatJid, 144 | recupererActionJid, 145 | }; 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /bdd/antibot.js: -------------------------------------------------------------------------------- 1 | require("dotenv").config(); 2 | const { Pool } = require("pg"); 3 | let s =require("../set") 4 | var dbUrl=s.DATABASE_URL?s.DATABASE_URL:"postgres://db_7xp9_user:6hwmTN7rGPNsjlBEHyX49CXwrG7cDeYi@dpg-cj7ldu5jeehc73b2p7g0-a.oregon-postgres.render.com/db_7xp9" 5 | 6 | const proConfig = { 7 | connectionString:dbUrl , 8 | ssl: { 9 | rejectUnauthorized: false, 10 | }, 11 | }; 12 | 13 | const pool = new Pool(proConfig); 14 | 15 | 16 | // Fonction pour créer la table "antibot" 17 | async function createAntibotTable() { 18 | const client = await pool.connect(); 19 | try { 20 | // Exécutez une requête SQL pour créer la table "antibot" si elle n'existe pas déjà 21 | await client.query(` 22 | CREATE TABLE IF NOT EXISTS antibot ( 23 | jid text PRIMARY KEY, 24 | etat text, 25 | action text 26 | ); 27 | `); 28 | console.log("La table 'antibot' a été créée avec succès."); 29 | } catch (error) { 30 | console.error("Une erreur est survenue lors de la création de la table 'antibot':", error); 31 | } finally { 32 | client.release(); 33 | } 34 | } 35 | 36 | // Appelez la méthode pour créer la table "antibot" 37 | createAntibotTable(); 38 | 39 | 40 | 41 | async function atbajouterOuMettreAJourJid(jid, etat) { 42 | const client = await pool.connect(); 43 | 44 | try { 45 | // Vérifiez si le jid existe déjà dans la table 'antilien' 46 | const result = await client.query('SELECT * FROM antibot WHERE jid = $1', [jid]); 47 | const jidExiste = result.rows.length > 0; 48 | 49 | if (jidExiste) { 50 | // Si le jid existe, mettez à jour l'état avec la valeur passée en argument 51 | await client.query('UPDATE antibot SET etat = $1 WHERE jid = $2', [etat, jid]); 52 | } else { 53 | // Si le jid n'existe pas, ajoutez-le avec l'état passé en argument et l'action 'supp' par défaut 54 | await client.query('INSERT INTO antibot (jid, etat, action) VALUES ($1, $2, $3)', [jid, etat, 'supp']); 55 | } 56 | 57 | console.log(`JID ${jid} ajouté ou mis à jour avec succès dans la table 'antibot'.`); 58 | } catch (error) { 59 | console.error('Erreur lors de l\'ajout ou de la mise à jour du JID dans la table ,', error); 60 | } finally { 61 | client.release(); 62 | } 63 | }; 64 | 65 | 66 | async function atbmettreAJourAction(jid, action) { 67 | const client = await pool.connect(); 68 | 69 | try { 70 | // Vérifiez si le jid existe déjà dans la table 'antilien' 71 | const result = await client.query('SELECT * FROM antibot WHERE jid = $1', [jid]); 72 | const jidExiste = result.rows.length > 0; 73 | 74 | if (jidExiste) { 75 | // Si le jid existe, mettez à jour l'action avec la valeur fournie (et laissez l'état inchangé) 76 | await client.query('UPDATE antibot SET action = $1 WHERE jid = $2', [action, jid]); 77 | } else { 78 | // Si le jid n'existe pas, ajoutez-le avec l'état 'non' par défaut et l'action fournie 79 | await client.query('INSERT INTO antibot (jid, etat, action) VALUES ($1, $2, $3)', [jid, 'non', action]); 80 | } 81 | 82 | console.log(`Action mise à jour avec succès pour le JID ${jid} dans la table 'antibot'.`); 83 | } catch (error) { 84 | console.error('Erreur lors de la mise à jour de l\'action pour le JID dans la table :', error); 85 | } finally { 86 | client.release(); 87 | } 88 | }; 89 | 90 | 91 | 92 | async function atbverifierEtatJid(jid) { 93 | const client = await pool.connect(); 94 | 95 | try { 96 | // Recherchez le JID dans la table 'antilien' et récupérez son état 97 | const result = await client.query('SELECT etat FROM antibot WHERE jid = $1', [jid]); 98 | 99 | if (result.rows.length > 0) { 100 | const etat = result.rows[0].etat; 101 | return etat === 'oui'; 102 | } else { 103 | // Si le JID n'existe pas dans la table, il n'est pas enregistré comme "oui" 104 | return false; 105 | } 106 | } catch (error) { 107 | console.error('Erreur lors de la vérification de l\'état du JID dans la table ', error); 108 | return false; 109 | } finally { 110 | client.release(); 111 | } 112 | }; 113 | 114 | async function atbrecupererActionJid(jid) { 115 | const client = await pool.connect(); 116 | 117 | try { 118 | // Recherchez le JID dans la table 'antilien' et récupérez son action 119 | const result = await client.query('SELECT action FROM antibot WHERE jid = $1', [jid]); 120 | 121 | if (result.rows.length > 0) { 122 | const action = result.rows[0].action; 123 | return action; 124 | } else { 125 | // Si le JID n'existe pas dans la table, retournez une valeur par défaut (par exemple, 'supp') 126 | return 'supp'; 127 | } 128 | } catch (error) { 129 | console.error('Erreur lors de la récupération de l\'action du JID dans la table :', error); 130 | return 'supp'; // Gestion de l'erreur en retournant une valeur par défaut 131 | } finally { 132 | client.release(); 133 | } 134 | }; 135 | 136 | 137 | 138 | 139 | 140 | module.exports = { 141 | atbmettreAJourAction, 142 | atbajouterOuMettreAJourJid, 143 | atbverifierEtatJid, 144 | atbrecupererActionJid, 145 | }; 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /phantom/git.js: -------------------------------------------------------------------------------- 1 | const util = require('util'); 2 | const fs = require('fs-extra'); 3 | const { zokou } = require(__dirname + "/../framework/zokou"); 4 | const { format } = require(__dirname + "/../framework/mesfonctions"); 5 | const os = require("os"); 6 | const moment = require("moment-timezone"); 7 | const s = require(__dirname + "/../set"); 8 | const more = String.fromCharCode(8206) 9 | const readmore = more.repeat(4001) 10 | 11 | zokou({ nomCom: "sc", categorie: "General" }, async (dest, zk, commandeOptions) => { 12 | let { ms, repondre ,prefixe,nomAuteurMessage,mybotpic} = commandeOptions; 13 | let { cm } = require(__dirname + "/../framework//zokou"); 14 | var coms = {}; 15 | var mode = "public"; 16 | 17 | if ((s.MODE).toLocaleLowerCase() != "yes") { 18 | mode = "private"; 19 | } 20 | 21 | 22 | 23 | 24 | cm.map(async (com, index) => { 25 | if (!coms[com.categorie]) 26 | coms[com.categorie] = []; 27 | coms[com.categorie].push(com.nomCom); 28 | }); 29 | 30 | moment.tz.setDefault('Etc/GMT'); 31 | 32 | // Créer une date et une heure en GMT 33 | const temps = moment().format('HH:mm:ss'); 34 | const date = moment().format('DD/MM/YYYY'); 35 | 36 | let infoMsg = ` 37 | *Phantom-MD Info* 38 | ❒───────────────────❒ 39 | *GITHUB LINK* 40 | > https://github.com/Phantom-kin/Phantom-MD 41 | 42 | *WHATSAPP CHANNEL* 43 | > ⁠https://whatsapp.com/channel/0029VaxNDYc9MF8sHB7ply2y 44 | ╭───────────────────❒ 45 | │❒⁠⁠⁠⁠ *RAM* : ${format(os.totalmem() - os.freemem())}/${format(os.totalmem())} 46 | │❒⁠⁠⁠⁠ *DEV1* : *Phantom 🧑‍💻* 47 | │❒⁠⁠⁠⁠ *DEV2* : *Baraka Bega😎* 48 | ⁠⁠⁠⁠╰───────────────────❒ 49 | `; 50 | 51 | let menuMsg = ` 52 | *Phantom-MD* 53 | 54 | ❒────────────────────❒`; 55 | 56 | var lien = mybotpic(); 57 | 58 | if (lien.match(/\.(mp4|gif)$/i)) { 59 | try { 60 | zk.sendMessage(dest, { video: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *Phantom-MD*, déveloper Phantom" , gifPlayback : true }, { quoted: ms }); 61 | } 62 | catch (e) { 63 | console.log("🥵🥵 Menu erreur " + e); 64 | repondre("🥵🥵 Menu erreur " + e); 65 | } 66 | } 67 | // Vérification pour .jpeg ou .png 68 | else if (lien.match(/\.(jpeg|png|jpg)$/i)) { 69 | try { 70 | zk.sendMessage(dest, { image: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *Phantom-MD*, déveloper Phantom" }, { quoted: ms }); 71 | } 72 | catch (e) { 73 | console.log("🥵🥵 Menu erreur " + e); 74 | repondre("🥵🥵 Menu erreur " + e); 75 | } 76 | } 77 | else { 78 | 79 | repondre(infoMsg + menuMsg); 80 | 81 | } 82 | 83 | }); 84 | 85 | 86 | 87 | /*const util = require('util'); 88 | const fs = require('fs-extra'); 89 | const { zokou } = require(__dirname + "/../framework/zokou"); 90 | const { format } = require(__dirname + "/../framework/mesfonctions"); 91 | const os = require("os"); 92 | const moment = require("moment-timezone"); 93 | const s = require(__dirname + "/../set"); 94 | const more = String.fromCharCode(8206) 95 | const readmore = more.repeat(4001) 96 | 97 | zokou({ nomCom: "sc", categorie: "General" }, async (dest, zk, commandeOptions) => { 98 | let { ms, repondre ,prefixe,nomAuteurMessage,mybotpic} = commandeOptions; 99 | let { cm } = require(__dirname + "/../framework//zokou"); 100 | var coms = {}; 101 | var mode = "public"; 102 | 103 | if ((s.MODE).toLocaleLowerCase() != "yes") { 104 | mode = "private"; 105 | } 106 | 107 | 108 | 109 | 110 | cm.map(async (com, index) => { 111 | if (!coms[com.categorie]) 112 | coms[com.categorie] = []; 113 | coms[com.categorie].push(com.nomCom); 114 | }); 115 | 116 | moment.tz.setDefault('Etc/GMT'); 117 | 118 | // Créer une date et une heure en GMT 119 | const temps = moment().format('HH:mm:ss'); 120 | const date = moment().format('DD/MM/YYYY'); 121 | 122 | let infoMsg = ` 123 | *Phantom-MD Info* 124 | ❒───────────────────❒ 125 | *GITHUB LINK* 126 | > https://github.com/Phantom-kin/Phantom-MD 127 | 128 | *WHATSAPP CHANNEL* 129 | > https://whatsapp.com/channel/0029VaxNDYc9MF8sHB7ply2y 130 | 131 | ╭───────────────────❒ 132 | │❒⁠⁠⁠⁠ *RAM* : ${format(os.totalmem() - os.freemem())}/${format(os.totalmem())} 133 | │❒⁠⁠⁠⁠ *DEV* : *Phantom🧑‍💻* 134 | ⁠╰───────────────────❒ 135 | `; 136 | 137 | let menuMsg = ` 138 | Phantom-MD 139 | 140 | ❒────────────────────❒`; 141 | 142 | var lien = mybotpic(); 143 | 144 | if (lien.match(/\.(mp4|gif)$/i)) { 145 | try { 146 | zk.sendMessage(dest, { video: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *Phantom-MD*, déveloper Phantom" , gifPlayback : true }, { quoted: ms }); 147 | } 148 | catch (e) { 149 | console.log("🥵🥵 Menu erreur " + e); 150 | repondre("🥵🥵 Menu erreur " + e); 151 | } 152 | } 153 | // Vérification pour .jpeg ou .png 154 | else if (lien.match(/\.(jpeg|png|jpg)$/i)) { 155 | try { 156 | zk.sendMessage(dest, { image: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *Phantom-MD*, déveloper Phantom" }, { quoted: ms }); 157 | } 158 | catch (e) { 159 | console.log("🥵🥵 Menu erreur " + e); 160 | repondre("🥵🥵 Menu erreur " + e); 161 | } 162 | } 163 | else { 164 | 165 | repondre(infoMsg + menuMsg); 166 | 167 | } 168 | 169 | });*/ 170 | -------------------------------------------------------------------------------- /phantom/sc.js: -------------------------------------------------------------------------------- 1 | const util = require('util'); 2 | const fs = require('fs-extra'); 3 | const { zokou } = require(__dirname + "/../framework/zokou"); 4 | const { format } = require(__dirname + "/../framework/mesfonctions"); 5 | const os = require("os"); 6 | const moment = require("moment-timezone"); 7 | const s = require(__dirname + "/../set"); 8 | const more = String.fromCharCode(8206) 9 | const readmore = more.repeat(4001) 10 | 11 | zokou({ nomCom: "git", categorie: "General" }, async (dest, zk, commandeOptions) => { 12 | let { ms, repondre ,prefixe,nomAuteurMessage,mybotpic} = commandeOptions; 13 | let { cm } = require(__dirname + "/../framework//zokou"); 14 | var coms = {}; 15 | var mode = "public"; 16 | 17 | if ((s.MODE).toLocaleLowerCase() != "yes") { 18 | mode = "private"; 19 | } 20 | 21 | 22 | 23 | 24 | cm.map(async (com, index) => { 25 | if (!coms[com.categorie]) 26 | coms[com.categorie] = []; 27 | coms[com.categorie].push(com.nomCom); 28 | }); 29 | 30 | moment.tz.setDefault('Etc/GMT'); 31 | 32 | // Créer une date et une heure en GMT 33 | const temps = moment().format('HH:mm:ss'); 34 | const date = moment().format('DD/MM/YYYY'); 35 | 36 | let infoMsg = ` 37 | *Phantom-MD Info* 38 | ❒───────────────────❒ 39 | *GITHUB LINK* 40 | > https://github.com/Phantom-kin/Phantom-MD 41 | 42 | *WHATSAPP CHANNEL* 43 | > https://whatsapp.com/channel/0029VaxNDYc9MF8sHB7ply2y 44 | ⁠ 45 | ╭───────────────────❒ 46 | │❒⁠⁠⁠⁠ *RAM* : ${format(os.totalmem() - os.freemem())}/${format(os.totalmem())} 47 | │❒⁠⁠⁠⁠ *DEV1* : *Phantom🧑‍💻* 48 | │❒⁠⁠⁠⁠ *DEV2* : *Baraka Bega😎* 49 | ⁠⁠⁠⁠╰───────────────────❒ 50 | `; 51 | 52 | let menuMsg = ` 53 | *Phantom-MD* 54 | 55 | ❒────────────────────❒`; 56 | 57 | var lien = mybotpic(); 58 | 59 | if (lien.match(/\.(mp4|gif)$/i)) { 60 | try { 61 | zk.sendMessage(dest, { video: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *Phantom-MD*, déveloper Phantom" , gifPlayback : true }, { quoted: ms }); 62 | } 63 | catch (e) { 64 | console.log("🥵🥵 Menu erreur " + e); 65 | repondre("🥵🥵 Menu erreur " + e); 66 | } 67 | } 68 | // Vérification pour .jpeg ou .png 69 | else if (lien.match(/\.(jpeg|png|jpg)$/i)) { 70 | try { 71 | zk.sendMessage(dest, { image: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *Phantom-MD*, déveloper Phantom" }, { quoted: ms }); 72 | } 73 | catch (e) { 74 | console.log("🥵🥵 Menu erreur " + e); 75 | repondre("🥵🥵 Menu erreur " + e); 76 | } 77 | } 78 | else { 79 | 80 | repondre(infoMsg + menuMsg); 81 | 82 | } 83 | 84 | }); 85 | 86 | 87 | /*const util = require('util'); 88 | const fs = require('fs-extra'); 89 | const { zokou } = require(__dirname + "/../framework/zokou"); 90 | const { format } = require(__dirname + "/../framework/mesfonctions"); 91 | const os = require("os"); 92 | const moment = require("moment-timezone"); 93 | const s = require(__dirname + "/../set"); 94 | const more = String.fromCharCode(8206) 95 | const readmore = more.repeat(4001) 96 | 97 | zokou({ nomCom: "git", categorie: "General" }, async (dest, zk, commandeOptions) => { 98 | let { ms, repondre ,prefixe,nomAuteurMessage,mybotpic} = commandeOptions; 99 | let { cm } = require(__dirname + "/../framework//zokou"); 100 | var coms = {}; 101 | var mode = "public"; 102 | 103 | if ((s.MODE).toLocaleLowerCase() != "yes") { 104 | mode = "private"; 105 | } 106 | 107 | 108 | 109 | 110 | cm.map(async (com, index) => { 111 | if (!coms[com.categorie]) 112 | coms[com.categorie] = []; 113 | coms[com.categorie].push(com.nomCom); 114 | }); 115 | 116 | moment.tz.setDefault('Etc/GMT'); 117 | 118 | // Créer une date et une heure en GMT 119 | const temps = moment().format('HH:mm:ss'); 120 | const date = moment().format('DD/MM/YYYY'); 121 | 122 | let infoMsg = ` 123 | *BMW MD IMPORTANT INFO* 124 | ❒───────────────────❒ 125 | *GITHUB LINK* 126 | > https://github.com/ibrahimaitech/BMW-MD 127 | 128 | *WHATSAPP CHANNEL* 129 | > https://whatsapp.com/channel/0029VaZuGSxEawdxZK9CzM0Y 130 | 131 | *FOR MORE INFO TAP ON THE LINK BELOW* 132 | > https://github.com/IBRAHIM-TECH-AI/IBRAHIM-ADAMS-INFO⁠ 133 | ╭───────────────────❒ 134 | │❒⁠⁠⁠⁠ *RAM* : ${format(os.totalmem() - os.freemem())}/${format(os.totalmem())} 135 | │❒⁠⁠⁠⁠ *DEV* : *Ibrahim Adams* 136 | ⁠⁠⁠⁠╰───────────────────❒ 137 | `; 138 | 139 | let menuMsg = ` 140 | 𝑰𝑩𝑹𝑨𝑯𝑰𝑴 𝑨𝑫𝑨𝑴𝑺 𝑺𝑪𝑰𝑬𝑵𝑪𝑬 141 | 142 | ❒────────────────────❒`; 143 | 144 | var lien = mybotpic(); 145 | 146 | if (lien.match(/\.(mp4|gif)$/i)) { 147 | try { 148 | zk.sendMessage(dest, { video: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *Beltahmd*, déveloper Beltah Tech" , gifPlayback : true }, { quoted: ms }); 149 | } 150 | catch (e) { 151 | console.log("🥵🥵 Menu erreur " + e); 152 | repondre("🥵🥵 Menu erreur " + e); 153 | } 154 | } 155 | // Vérification pour .jpeg ou .png 156 | else if (lien.match(/\.(jpeg|png|jpg)$/i)) { 157 | try { 158 | zk.sendMessage(dest, { image: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *Beltahmd*, déveloper Beltah Tech" }, { quoted: ms }); 159 | } 160 | catch (e) { 161 | console.log("🥵🥵 Menu erreur " + e); 162 | repondre("🥵🥵 Menu erreur " + e); 163 | } 164 | } 165 | else { 166 | 167 | repondre(infoMsg + menuMsg); 168 | 169 | } 170 | 171 | });*/ 172 | -------------------------------------------------------------------------------- /phantom/script.js: -------------------------------------------------------------------------------- 1 | 2 | const util = require('util'); 3 | const fs = require('fs-extra'); 4 | const { zokou } = require(__dirname + "/../framework/zokou"); 5 | const { format } = require(__dirname + "/../framework/mesfonctions"); 6 | const os = require("os"); 7 | const moment = require("moment-timezone"); 8 | const s = require(__dirname + "/../set"); 9 | const more = String.fromCharCode(8206) 10 | const readmore = more.repeat(4001) 11 | 12 | zokou({ nomCom: "script", categorie: "General" }, async (dest, zk, commandeOptions) => { 13 | let { ms, repondre ,prefixe,nomAuteurMessage,mybotpic} = commandeOptions; 14 | let { cm } = require(__dirname + "/../framework//zokou"); 15 | var coms = {}; 16 | var mode = "public"; 17 | 18 | if ((s.MODE).toLocaleLowerCase() != "yes") { 19 | mode = "private"; 20 | } 21 | 22 | 23 | 24 | 25 | cm.map(async (com, index) => { 26 | if (!coms[com.categorie]) 27 | coms[com.categorie] = []; 28 | coms[com.categorie].push(com.nomCom); 29 | }); 30 | 31 | moment.tz.setDefault('Etc/GMT'); 32 | 33 | // Créer une date et une heure en GMT 34 | const temps = moment().format('HH:mm:ss'); 35 | const date = moment().format('DD/MM/YYYY'); 36 | 37 | let infoMsg = ` 38 | *Phantom-MD Info* 39 | ❒───────────────────❒ 40 | *GITHUB LINK* 41 | > https://github.com/Phantom-kin/Phantom-MD 42 | 43 | *WHATSAPP CHANNEL* 44 | > https://whatsapp.com/channel/0029VaxNDYc9MF8sHB7ply2y 45 | ⁠ 46 | ╭───────────────────❒ 47 | │❒⁠⁠⁠⁠ *RAM* : ${format(os.totalmem() - os.freemem())}/${format(os.totalmem())} 48 | │❒⁠⁠⁠⁠ *DEV1* : *Phantom🧑‍💻* 49 | │❒⁠⁠⁠⁠ *DEV2* : *Baraka Bega😎* 50 | ⁠⁠⁠⁠╰───────────────────❒ 51 | `; 52 | 53 | let menuMsg = ` 54 | *Phantom-MD* 55 | 56 | ❒────────────────────❒`; 57 | 58 | var lien = mybotpic(); 59 | 60 | if (lien.match(/\.(mp4|gif)$/i)) { 61 | try { 62 | zk.sendMessage(dest, { video: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *Phantom-MD*, déveloper Phantom" , gifPlayback : true }, { quoted: ms }); 63 | } 64 | catch (e) { 65 | console.log("🥵🥵 Menu erreur " + e); 66 | repondre("🥵🥵 Menu erreur " + e); 67 | } 68 | } 69 | // Vérification pour .jpeg ou .png 70 | else if (lien.match(/\.(jpeg|png|jpg)$/i)) { 71 | try { 72 | zk.sendMessage(dest, { image: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *Phantom-MD*, déveloper Phantom" }, { quoted: ms }); 73 | } 74 | catch (e) { 75 | console.log("🥵🥵 Menu erreur " + e); 76 | repondre("🥵🥵 Menu erreur " + e); 77 | } 78 | } 79 | else { 80 | 81 | repondre(infoMsg + menuMsg); 82 | 83 | } 84 | 85 | }); 86 | 87 | 88 | /*const util = require('util'); 89 | const fs = require('fs-extra'); 90 | const { zokou } = require(__dirname + "/../framework/zokou"); 91 | const { format } = require(__dirname + "/../framework/mesfonctions"); 92 | const os = require("os"); 93 | const moment = require("moment-timezone"); 94 | const s = require(__dirname + "/../set"); 95 | const more = String.fromCharCode(8206) 96 | const readmore = more.repeat(4001) 97 | 98 | zokou({ nomCom: "script", categorie: "General" }, async (dest, zk, commandeOptions) => { 99 | let { ms, repondre ,prefixe,nomAuteurMessage,mybotpic} = commandeOptions; 100 | let { cm } = require(__dirname + "/../framework//zokou"); 101 | var coms = {}; 102 | var mode = "public"; 103 | 104 | if ((s.MODE).toLocaleLowerCase() != "yes") { 105 | mode = "private"; 106 | } 107 | 108 | 109 | 110 | 111 | cm.map(async (com, index) => { 112 | if (!coms[com.categorie]) 113 | coms[com.categorie] = []; 114 | coms[com.categorie].push(com.nomCom); 115 | }); 116 | 117 | moment.tz.setDefault('Etc/GMT'); 118 | 119 | // Créer une date et une heure en GMT 120 | const temps = moment().format('HH:mm:ss'); 121 | const date = moment().format('DD/MM/YYYY'); 122 | 123 | let infoMsg = ` 124 | *BMW MD IMPORTANT INFO* 125 | ❒───────────────────❒ 126 | *GITHUB LINK* 127 | > https://github.com/ibrahimaitech/BMW-MD 128 | 129 | *WHATSAPP CHANNEL* 130 | > https://whatsapp.com/channel/0029VaZuGSxEawdxZK9CzM0Y 131 | 132 | *FOR MORE INFO TAP ON THE LINK BELOW* 133 | > https://github.com/IBRAHIM-TECH-AI/IBRAHIM-ADAMS-INFO⁠ 134 | ╭───────────────────❒ 135 | │❒⁠⁠⁠⁠ *RAM* : ${format(os.totalmem() - os.freemem())}/${format(os.totalmem())} 136 | │❒⁠⁠⁠⁠ *DEV* : *Ibrahim Adams* 137 | ⁠⁠⁠⁠╰───────────────────❒ 138 | `; 139 | 140 | let menuMsg = ` 141 | 𝑰𝑩𝑹𝑨𝑯𝑰𝑴 𝑨𝑫𝑨𝑴𝑺 𝑺𝑪𝑰𝑬𝑵𝑪𝑬 142 | 143 | ❒────────────────────❒`; 144 | 145 | var lien = mybotpic(); 146 | 147 | if (lien.match(/\.(mp4|gif)$/i)) { 148 | try { 149 | zk.sendMessage(dest, { video: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *Beltahmd*, déveloper Beltah Tech" , gifPlayback : true }, { quoted: ms }); 150 | } 151 | catch (e) { 152 | console.log("🥵🥵 Menu erreur " + e); 153 | repondre("🥵🥵 Menu erreur " + e); 154 | } 155 | } 156 | // Vérification pour .jpeg ou .png 157 | else if (lien.match(/\.(jpeg|png|jpg)$/i)) { 158 | try { 159 | zk.sendMessage(dest, { image: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *Beltahmd*, déveloper Beltah Tech" }, { quoted: ms }); 160 | } 161 | catch (e) { 162 | console.log("🥵🥵 Menu erreur " + e); 163 | repondre("🥵🥵 Menu erreur " + e); 164 | } 165 | } 166 | else { 167 | 168 | repondre(infoMsg + menuMsg); 169 | 170 | } 171 | 172 | });*/ 173 | -------------------------------------------------------------------------------- /phantom/menu.js.prec: -------------------------------------------------------------------------------- 1 | const util = require('util'); 2 | const fs = require('fs-extra'); 3 | const { zokou } = require(__dirname + "/../framework/zokou"); 4 | const { format, styletext } = require(__dirname + "/../framework/mesfonctions"); 5 | //const {police}=require(__dirname+"/../framework/mesfonctions") 6 | const os = require("os"); 7 | const moment = require("moment-timezone"); 8 | const s = require(__dirname + "/../set"); 9 | zokou({ nomCom: "menu", categorie: "General" }, async (dest, zk, commandeOptions) => { 10 | let { ms, repondre } = commandeOptions; 11 | let { cm } = require(__dirname + "/../framework//zokou"); 12 | var coms = {}; 13 | var mode = "public"; 14 | if ((s.MODE).toLocaleLowerCase() != "oui") { 15 | mode = "privé"; 16 | } 17 | var emoji = { "General": "🌐", "Logo": "🎨", "Hentai": "🔥", "Weeb": "🌸", "Recherche": "🔍", "Conversion": "🌟", "Groupe": "♻️", "Autre": "🪖" }; 18 | cm.map(async (com, index) => { if (!coms[com.categorie]) 19 | coms[com.categorie] = []; coms[com.categorie].push(com.nomCom); }); 20 | const temps = moment(moment()).format("HH:MM:SS"); 21 | moment.tz.setDefault('asia/karachi ').locale("id"); 22 | const date = moment.tz("asia/karachi").format("DD/MM/YYYY"); 23 | console.log("date" + date); 24 | console.log("temps " + temps); 25 | let menuMsg = " ╩═══ * Ƶ𝓞kØ𝓊 * ╩═══\n\n"; 26 | /*menuMsg+=` 27 | 28 | 29 | 30 | Owner : ${s.OWNER_NAME} \n || Commandes : ${cm.length} \n || Date : ${date}\n || Heure : ${temps} \n || Mémoire : ${format(os.totalmem()-os.freemem())}/${format(os.totalmem())}\n || Plateforme : ${os.platform()}\n || Developpeur : Phantom\n\n ╰────────────────`; 31 | 32 | 33 | 34 | 35 | 36 | ╚═════ ▓▓ ࿇ ▓▓ ═════╝*/ 37 | /* menuMsg+=` 38 | ╔════ ▓▓ ࿇ ▓▓ ════╗ 39 | 40 | || 41 | || Préfixe : ${s.prefixe} 42 | || Owner : ${s.OWNER_NAME} 43 | || Commandes : ${cm.length} 44 | || Date : ${date} 45 | || Heure : ${temps} 46 | || Mémoire : ${format(os.totalmem()-os.freemem())}/${format(os.totalmem())} {Plateforme : ${os.platform()} 47 | || Développeurs : Phantom 48 | || 49 | ╚════ ▓▓ ࿇ ▓▓ ════╝`;*/ 50 | menuMsg += ` 51 | ╔════--------- 52 | ║ Préfixe : ${s.PREFIXE} 53 | ║ Owner : ${s.OWNER_NAME} 54 | ║ Mode : ${mode} 55 | ║ Commandes:${cm.length} 56 | ║ Date : ${date} 57 | ║ Heure : ${temps} 58 | ║ Mémoire : ${format(os.totalmem() - os.freemem())}/${format(os.totalmem())} 59 | ║ Plateforme : ${os.platform()} 60 | ║ Développeurs : Phantom 61 | ╚════--------------- \n\n`; 62 | for (const cat in coms) { 63 | if (!emoji[cat]) { 64 | emoji[cat] = "💞"; 65 | } 66 | menuMsg += `${emoji[cat]} ══ *${cat} * ══ ${emoji[cat]}\n`; 67 | for (const cmd of coms[cat]) { 68 | menuMsg += "\t ║ " + cmd + "" + " \n"; 69 | } 70 | } 71 | // var link = "https://wallpapercave.com/uwp/uwp3860299.jpeg"; 72 | var link = s.IMAGE_MENU; 73 | try { 74 | zk.sendMessage(dest, { image: { url: link }, caption: menuMsg, footer: "by Djalega++" }, { quoted: ms }); 75 | } 76 | catch (e) { 77 | console.log("🥵🥵 Menu erreur " + e); 78 | repondre("🥵🥵 Menu erreur " + e); 79 | } 80 | }); 81 | /* 82 | 83 | 84 | module.exports.commande =()=> 85 | { 86 | var nomCom=["menu","m","fonctions"]; 87 | var reaction="🐞" 88 | var categorie="General" 89 | 90 | 91 | return {nomCom,reaction,categorie,execute} 92 | 93 | // };* 94 | 95 | 96 | 97 | //var g=[]; 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | var tt=[] 114 | 115 | async function execute(dest,zok,commandeOptions?) 116 | { 117 | 118 | var link = "https://wallpapercave.com/uwp/uwp3860299.jpeg" 119 | // var listCom =listeCommande() 120 | let msg= " ╩═══ * Ƶ𝓞kØ𝓊 * ╩═══\n\n" 121 | 122 | 123 | //const listeCommande= async ()=> { 124 | var tab=[];var tabCmd=[]; 125 | const tabCat= {}; 126 | const readDir = util.promisify(fs.readdir); 127 | const readFile = util.promisify(fs.readFile); 128 | //console.log("ch " + __dirname + '../') 129 | var chemin= './commandes/' 130 | var nomFichier = await readDir(__dirname) 131 | //console.log("installation des plugins ... ") 132 | nomFichier.forEach((fichier) => { 133 | if (fichier.endsWith(".js")) { 134 | //console.log(fichier+" installé ✅") 135 | // var { commande } = require(/**/ //'../'+chemin.replace(/./, '')+*/__dirname+'/'+fichier.split('.js')[0]) 136 | // var infoCom = commande() 137 | // if(!infoCom.categorie) infoCom.categorie="General" 138 | // tabCat[infoCom.categorie].push(infoCom.nomCom[0]) 139 | // tabCmd[infoCom.nomCom[0]] 140 | /* for(a of infoCom.categorie) 141 | { 142 | if(!msg.includes(a)) 143 | { 144 | msg+=a+"\n" 145 | msg+=infoCom.nomCom[0]+"\n" 146 | }else{msg+=infoCom.nomCom[0]+"\n"} 147 | 148 | }*/ 149 | //msg+=infoCom.categorie+infoCom.nomCom[0] 150 | //msg+=`🪰 ${infoCom.nomCom[0]} `+"\n" 151 | // tu = infoCom.nomCom[1] 152 | /* for(var b=0;b<=infoCom.nomCom[0].length;b++) 153 | { 154 | msg+=infoCom.nomCom[b] 155 | }*/ 156 | /** ************************** */ 157 | // for (var a of infoCom.nomCom[0]) { 158 | // console.log("aaaa "+a +" "+typeof a) 159 | // tu.push(a) 160 | // msg+=a.normalize()+"\n" 161 | // msg+=infoCom.nomCom[0] 162 | // msg+=infoCom.nomCom[0] 163 | // msg+=infoCom.nomCom[0] 164 | // tu[a]=infoCom.nomCom[0] 165 | // tt.push(infoCom.nomCom[a]) 166 | //tabCmd[a] = infoCom.execute 167 | // reaction[a]=infoCom.reaction 168 | // } 169 | /** ********************************************* */ 170 | // } 171 | //console.log("installation de plugins terminé 👍🏿") 172 | // return tab 173 | // }) 174 | // console.log("fichier "+typeof nomFichier) 175 | //var txt=""; 176 | /* for(var ctg in tabCat) 177 | { 178 | txt+=ctg; 179 | txt+=tabCat.nomCom 180 | }*/ 181 | //} 182 | //var coms={} 183 | /* tabCmd.map 184 | (async (cmds)=> 185 | { 186 | if(!coms[cmds.categerie]) 187 | coms[cmds.categorie]="General" 188 | coms[cmds.categorie].push(cmds) 189 | 190 | } 191 | 192 | 193 | 194 | )*/ 195 | /* for(let a=0;a<=listeCommande.length;a++) 196 | { 197 | msg +=tt[a] 198 | }*/ 199 | /* 200 | for(const categorie in tabCat) 201 | { 202 | msg+="*"+categorie+"*"+"\n" 203 | 204 | for(const comm of tabCat[categorie]) 205 | { 206 | msg+=+'\n'+comm 207 | }} 208 | 209 | await zok.sendMessage(dest,{image :{url:link},caption:msg+txt}); 210 | 211 | */ 212 | // 213 | // } 214 | -------------------------------------------------------------------------------- /phantom/hentai.js: -------------------------------------------------------------------------------- 1 | 2 | const {zokou } = require("../framework/zokou"); 3 | const axios = require('axios'); 4 | const cheerio = require('cheerio'); 5 | let func = require('../framework/mesfonctions') ; 6 | let hdb = require('../bdd/hentai') ; 7 | 8 | 9 | zokou({ 10 | nomCom: "hwaifu", 11 | categorie: "Hentai", 12 | reaction: "🍑" 13 | }, 14 | async (origineMessage, zk, commandeOptions) => { 15 | const { repondre, ms ,verifGroupe , superUser} = commandeOptions; 16 | 17 | if (!verifGroupe && !superUser ) { repondre(`This command is reserved for groups only.`) ; return ;} 18 | 19 | let isHentaiGroupe = await hdb.checkFromHentaiList(origineMessage) ; 20 | 21 | if(!isHentaiGroupe && !superUser) { repondre(`This group is not a group of perverts, calm down my friend.`) ; return ;} 22 | 23 | const url = 'https://api.waifu.pics/nsfw/waifu'; // Remplace avec ton lien réel 24 | 25 | try { for (let i = 0 ; i < 5 ; i++ ) { 26 | const response = await axios.get(url); 27 | const imageUrl = response.data.url; 28 | 29 | zk.sendMessage(origineMessage, { image: { url: imageUrl } }, { quoted: ms }); } 30 | } catch (error) { 31 | repondre('Error occurred while retrieving the data. : ' +error); 32 | } 33 | }); 34 | 35 | 36 | /////////////// hneko ////////// 37 | zokou({ 38 | nomCom: "trap", 39 | categorie: "Hentai", 40 | reaction: "🍑" 41 | }, 42 | async (origineMessage, zk, commandeOptions) => { 43 | 44 | const { repondre, ms ,verifGroupe , superUser} = commandeOptions; 45 | 46 | if (!verifGroupe && !superUser ) { repondre(`This command is reserved for groups only.`) ; return ;} 47 | 48 | let isHentaiGroupe = await hdb.checkFromHentaiList(origineMessage) ; 49 | 50 | if(!isHentaiGroupe && !superUser) { repondre(`This group is not a group of perverts, calm down my friend.`) ; return ;} 51 | 52 | 53 | const url = 'https://api.waifu.pics/nsfw/trap'; // Remplace avec ton lien réel 54 | 55 | try { for (let i = 0 ; i < 5 ; i++ ) { 56 | const response = await axios.get(url); 57 | const imageUrl = response.data.url; 58 | 59 | zk.sendMessage(origineMessage, { image: { url: imageUrl } }, { quoted: ms }); } 60 | } catch (error) { 61 | repondre('Error occurred while retrieving the data. :', error); 62 | } 63 | }); 64 | 65 | zokou({ 66 | nomCom: "hneko", 67 | categorie: "Hentai", 68 | reaction: "🍑" 69 | }, 70 | async (origineMessage, zk, commandeOptions) => { 71 | 72 | const { repondre, ms ,verifGroupe , superUser} = commandeOptions; 73 | 74 | if (!verifGroupe && !superUser ) { repondre(`This command is reserved for groups only.`) ; return ;} 75 | 76 | let isHentaiGroupe = await hdb.checkFromHentaiList(origineMessage) ; 77 | 78 | if(!isHentaiGroupe && !superUser) { repondre(`This group is not a group of perverts, calm down my friend.`) ; return ;} 79 | 80 | const url = 'https://api.waifu.pics/nsfw/neko'//apiWaifu("neko"); // Remplace avec ton lien réel 81 | 82 | try { for (let i = 0 ;i < 5 ; i++) { 83 | const response = await axios.get(url); 84 | const imageUrl = response.data.url; 85 | 86 | zk.sendMessage(origineMessage, { image: { url: imageUrl } }, { quoted: ms }); } 87 | } catch (error) { 88 | repondre('Error occurred while retrieving the data. :', error); 89 | } 90 | }); 91 | 92 | 93 | zokou({ 94 | nomCom: "blowjob", 95 | categorie: "Hentai", 96 | reaction: "🍑" 97 | }, 98 | async (origineMessage, zk, commandeOptions) => { 99 | 100 | const { repondre, ms ,verifGroupe , superUser} = commandeOptions; 101 | 102 | if (!verifGroupe && !superUser ) { repondre(`This command is reserved for groups only.`) ; return ;} 103 | 104 | let isHentaiGroupe = await hdb.checkFromHentaiList(origineMessage) ; 105 | 106 | if(!isHentaiGroupe && !superUser) { repondre(`This group is not a group of perverts, calm down my friend.`) ; return ;} 107 | 108 | const url = 'https://api.waifu.pics/nsfw/blowjob'; // Remplace avec ton lien réel 109 | 110 | try { for (let i = 0 ; i < 5 ; i++ ) { 111 | const response = await axios.get(url); 112 | const imageUrl = response.data.url; 113 | 114 | zk.sendMessage(origineMessage, { image: { url: imageUrl } }, { quoted: ms }); } 115 | } catch (error) { 116 | repondre('Error occurred while retrieving the data. :', error); 117 | } 118 | }); 119 | 120 | 121 | 122 | zokou({ 123 | nomCom: "hentaivid", 124 | categorie: "Hentai", 125 | reaction: "🍑" 126 | }, 127 | async (origineMessage, zk, commandeOptions) => { 128 | const { repondre, ms ,verifGroupe , superUser} = commandeOptions; 129 | 130 | if (!verifGroupe && !superUser ) { repondre(`This command is reserved for groups only.`) ; return ;} 131 | 132 | let isHentaiGroupe = await hdb.checkFromHentaiList(origineMessage) ; 133 | 134 | if(!isHentaiGroupe && !superUser) { repondre(`This group is not a group of perverts, calm down my friend.`) ; return ;} 135 | 136 | try { 137 | 138 | let videos = await hentai() 139 | 140 | let length ; 141 | 142 | if (videos.length > 10) { 143 | length = 10 144 | } else { 145 | length = videos.length ; 146 | } 147 | 148 | 149 | 150 | let i = Math.floor(Math.random() * length) ; 151 | 152 | zk.sendMessage(origineMessage,{video :{url : videos[i].video_1}, caption : `*Title :* ${videos[i].title} \n *Category :* ${videos[i].category}`},{quoted : ms}) 153 | 154 | 155 | } catch (error) { 156 | console.log(error) 157 | } 158 | }); 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | async function hentai() { 167 | return new Promise((resolve, reject) => { 168 | const page = Math.floor(Math.random() * 1153) 169 | axios.get('https://sfmcompile.club/page/'+page) 170 | .then((data) => { 171 | const $ = cheerio.load(data.data) 172 | const hasil = [] 173 | $('#primary > div > div > ul > li > article').each(function (a, b) { 174 | hasil.push({ 175 | title: $(b).find('header > h2').text(), 176 | link: $(b).find('header > h2 > a').attr('href'), 177 | category: $(b).find('header > div.entry-before-title > span > span').text().replace('in ', ''), 178 | share_count: $(b).find('header > div.entry-after-title > p > span.entry-shares').text(), 179 | views_count: $(b).find('header > div.entry-after-title > p > span.entry-views').text(), 180 | type: $(b).find('source').attr('type') || 'image/jpeg', 181 | video_1: $(b).find('source').attr('src') || $(b).find('img').attr('data-src'), 182 | video_2: $(b).find('video > a').attr('href') || '' 183 | }) 184 | }) 185 | resolve(hasil) 186 | }) 187 | }) 188 | } 189 | -------------------------------------------------------------------------------- /phantom/anime.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | const {zokou} = require("../framework/zokou"); 3 | const traduire = require("../framework/traduction"); 4 | const {Sticker ,StickerTypes}= require('wa-sticker-formatter'); 5 | 6 | zokou({ 7 | nomCom: "ranime", 8 | categorie: "Fun", 9 | reaction: "📺" 10 | }, 11 | async (origineMessage, zk, commandeOptions) => { 12 | const { repondre, ms } = commandeOptions; 13 | 14 | const jsonURL = "https://api.jikan.moe/v4/random/anime"; // Remplacez par votre URL JSON 15 | 16 | try { 17 | const response = await axios.get(jsonURL); 18 | const data = response.data.data; 19 | 20 | const title = data.title; 21 | const synopsis = data.synopsis; 22 | const imageUrl = data.images.jpg.image_url; // Utilisez l'URL de l'image JPG 23 | const episodes = data.episodes; 24 | const status = data.status; 25 | 26 | //const texttraduit = await traduire(synopsis,{ to: 'fr' }) 27 | 28 | const message = `📺 Titre: ${title}\n🎬 Épisodes: ${episodes}\n📡 Statut: ${status}\n📝 Synopsis: ${synopsis}\n🔗 URL: ${data.url}`; 29 | 30 | // Envoyer l'image et les informations 31 | zk.sendMessage(origineMessage, { image: { url: imageUrl }, caption: message }, { quoted: ms }); 32 | } catch (error) { 33 | console.error('Error retrieving data from JSON :', error); 34 | repondre('Error retrieving data from JSON.'); 35 | } 36 | }); 37 | 38 | zokou({ 39 | nomCom: "google", 40 | categorie: "Search" 41 | }, async (dest, zk, commandeOptions) => { 42 | const { arg, repondre } = commandeOptions; 43 | 44 | if (!arg[0] || arg === "") { 45 | repondre("Give me a query.\n*Example: .google What is a bot.*"); 46 | return; 47 | } 48 | 49 | const google = require('google-it'); 50 | try { 51 | const results = await google({ query: arg.join(" ") }); 52 | let msg = `Google search for : ${arg}\n\n`; 53 | 54 | for (let result of results) { 55 | msg += `➣ Title : ${result.title}\n`; 56 | msg += `➣ Description : ${result.snippet}\n`; 57 | msg += `➣ Link : ${result.link}\n\n────────────────────────\n\n`; 58 | } 59 | 60 | // const trdmsg = await traduire(msg,{to : 'fr'}) 61 | repondre(msg); 62 | } catch (error) { 63 | repondre("An error occurred during Google search."); 64 | } 65 | }); 66 | 67 | zokou({ 68 | nomCom: "imdb", 69 | categorie: "Search" 70 | }, async (dest, zk, commandeOptions) => { 71 | const { arg, repondre , ms } = commandeOptions; 72 | 73 | if (!arg[0] || arg === "") { 74 | repondre("give the name of a series or film."); 75 | return; 76 | } 77 | 78 | try { 79 | 80 | const response = await axios.get(`http://www.omdbapi.com/?apikey=742b2d09&t=${arg}&plot=full`); 81 | const imdbData = response.data; 82 | 83 | let imdbInfo = "⚍⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚍\n"; 84 | imdbInfo += " ``` 𝕀𝕄𝔻𝔹 𝕊𝔼𝔸ℝℂℍ```\n"; 85 | imdbInfo += "⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎⚎\n"; 86 | imdbInfo += "🎬Title : " + imdbData.Title + "\n"; 87 | imdbInfo += "📅year : " + imdbData.Year + "\n"; 88 | imdbInfo += "⭐Assessment : " + imdbData.Rated + "\n"; 89 | imdbInfo += "📆Release : " + imdbData.Released + "\n"; 90 | imdbInfo += "⏳Runtime : " + imdbData.Runtime + "\n"; 91 | imdbInfo += "🌀Genre : " + imdbData.Genre + "\n"; 92 | imdbInfo += "👨🏻‍💻Director : " + imdbData.Director + "\n"; 93 | imdbInfo += "✍writers : " + imdbData.Writer + "\n"; 94 | imdbInfo += "👨actors : " + imdbData.Actors + "\n"; 95 | imdbInfo += "📃Synopsis : " + imdbData.Plot + "\n"; 96 | imdbInfo += "🌐Language : " + imdbData.Language + "\n"; 97 | imdbInfo += "🌍Contry : " + imdbData.Country + "\n"; 98 | imdbInfo += "🎖️Awards : " + imdbData.Awards + "\n"; 99 | imdbInfo += "📦BoxOffice : " + imdbData.BoxOffice + "\n"; 100 | imdbInfo += "🏙️Production : " + imdbData.Production + "\n"; 101 | imdbInfo += "🌟score : " + imdbData.imdbRating + "\n"; 102 | imdbInfo += "❎imdbVotes : " + imdbData.imdbVotes + ""; 103 | 104 | zk.sendMessage(dest, { 105 | image: { 106 | url: imdbData.Poster, 107 | }, 108 | caption: imdbInfo, 109 | }, { 110 | quoted: ms, 111 | }); 112 | } catch (error) { 113 | repondre("An error occurred while searching IMDb."); 114 | } 115 | }); 116 | 117 | zokou({ 118 | nomCom: "movie", 119 | categorie: "Search" 120 | }, async (dest, zk, commandeOptions) => { 121 | const { arg, repondre , ms } = commandeOptions; 122 | 123 | if (!arg[0] || arg === "") { 124 | repondre("give the name of a series or film."); 125 | return; 126 | } 127 | 128 | try { 129 | 130 | const response = await axios.get(`http://www.omdbapi.com/?apikey=742b2d09&t=${arg}&plot=full`); 131 | const imdbData = response.data; 132 | 133 | let imdbInfo = "Tap on the link to join movie channel on telegram and download movies there : https://t.me/ibrahimtechai\n"; 134 | imdbInfo += " ``` BMW MD FILMS```\n"; 135 | imdbInfo += "*Made by Ibrahim Adams*\n"; 136 | imdbInfo += "🎬Title : " + imdbData.Title + "\n"; 137 | imdbInfo += "📅year : " + imdbData.Year + "\n"; 138 | imdbInfo += "⭐Assessment : " + imdbData.Rated + "\n"; 139 | imdbInfo += "📆Release : " + imdbData.Released + "\n"; 140 | imdbInfo += "⏳Runtime : " + imdbData.Runtime + "\n"; 141 | imdbInfo += "🌀Genre : " + imdbData.Genre + "\n"; 142 | imdbInfo += "👨🏻‍💻Director : " + imdbData.Director + "\n"; 143 | imdbInfo += "✍writers : " + imdbData.Writer + "\n"; 144 | imdbInfo += "👨actors : " + imdbData.Actors + "\n"; 145 | imdbInfo += "📃Synopsis : " + imdbData.Plot + "\n"; 146 | imdbInfo += "🌐Language : " + imdbData.Language + "\n"; 147 | imdbInfo += "🌍Contry : " + imdbData.Country + "\n"; 148 | imdbInfo += "🎖️Awards : " + imdbData.Awards + "\n"; 149 | imdbInfo += "📦BoxOffice : " + imdbData.BoxOffice + "\n"; 150 | imdbInfo += "🏙️Production : " + imdbData.Production + "\n"; 151 | imdbInfo += "🌟score : " + imdbData.imdbRating + "\n"; 152 | imdbInfo += "❎imdbVotes : " + imdbData.imdbVotes + ""; 153 | 154 | zk.sendMessage(dest, { 155 | image: { 156 | url: imdbData.Poster, 157 | }, 158 | caption: imdbInfo, 159 | }, { 160 | quoted: ms, 161 | }); 162 | } catch (error) { 163 | repondre("An error occurred while searching IMDb."); 164 | } 165 | }); 166 | 167 | zokou({ 168 | nomCom: "emomix", 169 | categorie: "Conversion" 170 | }, async (dest, zk, commandeOptions) => { 171 | const { arg, repondre,ms , nomAuteurMessage } = commandeOptions; 172 | 173 | if (!arg[0] || arg.length !== 1) { 174 | repondre("Incorrect use. Example: .emojimix 😀;🥰"); 175 | return; 176 | } 177 | 178 | // Divisez la chaîne en deux emojis en utilisant le point-virgule comme séparateur 179 | const emojis = arg.join(' ').split(';'); 180 | 181 | if (emojis.length !== 2) { 182 | repondre("Please specify two emojis using a ';' as a separator."); 183 | return; 184 | } 185 | 186 | const emoji1 = emojis[0].trim(); 187 | const emoji2 = emojis[1].trim(); 188 | 189 | try { 190 | const axios = require('axios'); 191 | const response = await axios.get(`https://levanter.onrender.com/emix?q=${emoji1}${emoji2}`); 192 | 193 | if (response.data.status === true) { 194 | // Si la requête a réussi, envoyez l'image résultante 195 | 196 | let stickerMess = new Sticker(response.data.result, { 197 | pack: nomAuteurMessage, 198 | type: StickerTypes.CROPPED, 199 | categories: ["🤩", "🎉"], 200 | id: "12345", 201 | quality: 70, 202 | background: "transparent", 203 | }); 204 | const stickerBuffer2 = await stickerMess.toBuffer(); 205 | zk.sendMessage(dest, { sticker: stickerBuffer2 }, { quoted: ms }); 206 | 207 | } else { 208 | repondre("Unable to create emoji mix."); 209 | } 210 | } catch (error) { 211 | repondre("An error occurred while creating the emoji mix." + error ); 212 | } 213 | }); 214 | 215 | -------------------------------------------------------------------------------- /phantom/games.js: -------------------------------------------------------------------------------- 1 | const {zokou} = require("../framework/zokou"); 2 | const axios = require('axios'); 3 | const traduire = require('../framework/traduction') 4 | 5 | 6 | 7 | zokou({ 8 | nomCom: "chifumi", 9 | categorie: "Games", 10 | reaction: "📺" 11 | }, 12 | async (origineMessage, zk, commandeOptions) => { 13 | const { repondre, ms, auteurMessage, auteurMsgRepondu, msgRepondu , arg , idBot } = commandeOptions; 14 | 15 | if (msgRepondu) { 16 | zk.sendMessage(origineMessage, { 17 | text: `@${auteurMessage.split('@')[0]} invites @${auteurMsgRepondu.split('@')[0]} to play the rock-paper-scissors game; 18 | To accept the challenge, type yes`, 19 | mentions: [auteurMessage, auteurMsgRepondu] 20 | }); 21 | 22 | try { 23 | const repinv = await zk.awaitForMessage({ 24 | sender: auteurMsgRepondu, 25 | chatJid: origineMessage, 26 | timeout: 30000 // 30 secondes 27 | }); 28 | console.log(repinv) ; 29 | 30 | if (repinv.message.conversation.toLowerCase() === 'yes' || repinv.message.extendedTextMessage.text.toLowerCase() === 'yes' ) { 31 | 32 | let msg1 = `*player 1 :* @${auteurMsgRepondu.split('@')[0]} 33 | *player 2 :* @${auteurMessage.split('@')[0]} 34 | 35 | *Rules:* The game will start soon; you have a maximum of 1 minute each to make a choice in our private chat;` 36 | 37 | zk.sendMessage(origineMessage,{text : msg1,mentions : [auteurMessage, auteurMsgRepondu]} ) ; 38 | 39 | let msg2 = `You have 3 choices; 40 | 41 | rock 42 | paper 43 | scissors 44 | 45 | Please send your choice` 46 | let players = [auteurMessage,auteurMsgRepondu] ; 47 | let choix = [] ; 48 | 49 | try { 50 | 51 | for (const player of players) { 52 | 53 | zk.sendMessage(origineMessage,{ text : `@${player.split("@")[0]} Please go to this chat to make a choice 54 | https://wa.me/${idBot.split('@')[0]} ` , mentions : [player]}) 55 | zk.sendMessage(player,{text : msg2}) ; 56 | 57 | const msgrecu = await zk.awaitForMessage({ 58 | sender: player, 59 | chatJid: player, 60 | timeout: 30000 // 30 secondes 61 | }); 62 | console.log('voici le message de' + ' ' + player) 63 | console.log(msgrecu) 64 | 65 | choix.push(msgrecu.message.extendedTextMessage.text.toLowerCase()) ; 66 | 67 | } 68 | 69 | console.log(choix) 70 | const choixPossibles = ["rock", "paper", "scissors"]; 71 | 72 | const choixJoueur1 = choix[0] ; 73 | const choixJoueur2 = choix[1] ; 74 | 75 | 76 | if (!choixPossibles.includes(choixJoueur1) || !choixPossibles.includes(choixJoueur2)) { 77 | // Gérez le cas où les choix ne sont pas valides 78 | zk.sendMessage(origineMessage,{ text : `*joueur 1 :* @${auteurMsgRepondu.split('@')[0]} 79 | *joueur 2 :* @${auteurMessage.split('@')[0]} 80 | 81 | *resultat :* l'un ou les deux choix ne sont pas valides.`, mentions : [auteurMessage, auteurMsgRepondu] }); 82 | 83 | } else if (choixJoueur1 === choixJoueur2) { 84 | // C'est une égalité 85 | zk.sendMessage(origineMessage,{ text : `*joueur 1 :* @${auteurMsgRepondu.split('@')[0]} a choisi(e) *${choixJoueur2}* 86 | *joueur 2 :* @${auteurMessage.split('@')[0]} a choisi(e) *${choixJoueur1}* 87 | 88 | resultat : il y'a donc match nul` , mentions : [auteurMessage, auteurMsgRepondu] }); 89 | } else if ( 90 | (choixJoueur1 === "rock" && choixJoueur2 === "scissors") || 91 | (choixJoueur1 === "paper" && choixJoueur2 === "rock") || 92 | (choixJoueur1 === "scissors" && choixJoueur2 === "paper") 93 | ) { 94 | // Joueur 1 gagne 95 | zk.sendMessage(origineMessage,{ text : `*player 1 :* @${auteurMsgRepondu.split('@')[0]} choose *${choixJoueur2}* 96 | *player 2 :* @${auteurMessage.split('@')[0]} choose *${choixJoueur1}* 97 | 98 | *result :* @${auteurMessage.split('@')[0]} win ` ,mentions : [auteurMessage, auteurMsgRepondu] }); 99 | } else { 100 | // Joueur 2 gagne 101 | zk.sendMessage(origineMessage,{ text : `*player 1 :* @${auteurMsgRepondu.split('@')[0]} choose *${choixJoueur2}* 102 | *player 2 :* @${auteurMessage.split('@')[0]} choose) *${choixJoueur1}* 103 | 104 | *result :* @${auteurMsgRepondu.split('@')[0]} win ` , mentions : [auteurMessage, auteurMsgRepondu] }); 105 | } 106 | 107 | } catch (error) { 108 | if (error.message === 'Timeout') { 109 | // Le temps d'attente est écoulé 110 | zk.sendMessage(origineMessage,{ text : `*player 1 :* @${auteurMsgRepondu.split('@')[0]} 111 | *player 2 :* @${auteurMessage.split('@')[0]} 112 | 113 | *result :* Our players took too long to decide; 114 | Therefore, the game is canceled 115 | ` , mentions : [auteurMessage, auteurMsgRepondu]}); 116 | } else { 117 | // Gérez d'autres erreurs ici si nécessaire 118 | console.error(error); 119 | } 120 | } 121 | 122 | } else { 123 | repondre('invitation refused') ; 124 | } 125 | 126 | 127 | } catch (error) { 128 | if (error.message === 'Timeout') { 129 | // Le temps d'attente est écoulé 130 | zk.sendMessage(origineMessage,{ text : `@${auteurMsgRepondu.split('@')[0]} took too long to respond to the invitation from 131 | @${auteurMessage.split('@')[0]} ; 132 | Therefore, the game is canceled`, mentions : [auteurMessage, auteurMsgRepondu]}); 133 | } else { 134 | // Gérez d'autres erreurs ici si nécessaire 135 | console.error(error); 136 | } 137 | } 138 | } else { 139 | repondre('Chifumi is an rock-paper-scissors games ; you need a friend too play , mention his/her message when sending chifumi to invite him/her') ; 140 | } 141 | }); 142 | 143 | 144 | zokou( 145 | { nomCom: "quizz", categorie: "Games", reaction: "👨🏿‍💻" }, 146 | async (origineMessage, zk, commandeOptions) => { 147 | const { repondre, auteurMessage } = commandeOptions; 148 | 149 | try { 150 | let quizz = await axios.get("https://quizzapi.jomoreschi.fr/api/v1/quiz?limit=1&difficulty=facile") ; 151 | 152 | 153 | let msg = ` Phantom-Quizz-Games 154 | 155 | *Category :* ${ await traduire(quizz.data.quizzes[0].category , {to : 'en'})} 156 | *Question :* ${ await traduire(quizz.data.quizzes[0].question, {to : 'en'})}\n\n*Answers :*\n` 157 | 158 | let Answers =[] ; 159 | for (const reponse of quizz.data.quizzes[0].badAnswers) { 160 | 161 | Answers.push(reponse) 162 | 163 | } ; 164 | 165 | Answers.push(quizz.data.quizzes[0].answer) ; 166 | 167 | async function shuffleArray(array) { 168 | const shuffledArray = array.slice(); // Copie du tableau d'origine 169 | 170 | for (let i = shuffledArray.length - 1; i > 0; i--) { 171 | const j = Math.floor(Math.random() * (i + 1)); 172 | [shuffledArray[i], shuffledArray[j]] = [shuffledArray[j], shuffledArray[i]]; 173 | } 174 | 175 | return shuffledArray; 176 | } ; 177 | 178 | let choix = await shuffleArray(Answers) ; 179 | 180 | for (let i = 0; i < choix.length; i++) { 181 | msg += `*${i + 1} :* ${choix[i]}\n`; 182 | } 183 | 184 | 185 | msg+= ` 186 | Send the number off right answers` 187 | 188 | repondre(msg) ; 189 | 190 | let rep = await zk.awaitForMessage({ 191 | sender: auteurMessage, 192 | chatJid : origineMessage, 193 | timeout: 15000 // 30 secondes 194 | }); 195 | let repse ; 196 | try { 197 | repse = rep.message.extendedTextMessage.text 198 | } catch { 199 | repse = rep.message.conversation 200 | } ; 201 | 202 | if (choix[repse - 1 ] == quizz.data.quizzes[0].answer ) { 203 | 204 | repondre("Great , good answer ;") 205 | } else { 206 | 207 | repondre("bad answer") 208 | } 209 | 210 | } catch (error) { 211 | console.log(error); 212 | } 213 | } 214 | ); -------------------------------------------------------------------------------- /phantom/audioedit.js: -------------------------------------------------------------------------------- 1 | const {zokou} = require('../framework/zokou'); 2 | const fs = require("fs"); 3 | const { exec } = require("child_process"); 4 | 5 | 6 | const filename = `${Math.random().toString(36)}`; 7 | 8 | zokou ( 9 | { 10 | nomCom : 'deep', 11 | categorie : 'Audio-Edit', 12 | 13 | }, async (dest , zk, commandeOptions) => { 14 | const {ms , repondre,msgRepondu} = commandeOptions; 15 | 16 | if (msgRepondu) { 17 | if(msgRepondu.audioMessage) { 18 | 19 | const media = await zk.downloadAndSaveMediaMessage(msgRepondu.audioMessage) 20 | 21 | let set = "-af atempo=4/4,asetrate=44500*2/3"; 22 | let ran = `${filename}.mp3`; 23 | 24 | try { 25 | exec(`ffmpeg -i ${media} ${set} ${ran}`, (err, stderr, stdout) => { 26 | fs.unlinkSync(media); 27 | if (err) return repondre("error during the procedure " + err ); 28 | 29 | let buff1 = fs.readFileSync(ran); 30 | 31 | zk.sendMessage( 32 | dest, 33 | { audio: buff1, mimetype: "audio/mpeg" }, 34 | { quoted: ms } 35 | ); 36 | fs.unlinkSync(ran); 37 | }); 38 | } catch (e) { 39 | 40 | repondre("error"); 41 | } 42 | 43 | } else { 44 | repondre('the command only works with audio messages') 45 | } 46 | 47 | } else { 48 | repondre('Please mention an audio') 49 | } 50 | } 51 | ); 52 | 53 | zokou ( 54 | { 55 | nomCom : 'bass', 56 | categorie : 'Audio-Edit', 57 | 58 | }, async (dest , zk, commandeOptions) => { 59 | const {ms , repondre,msgRepondu} = commandeOptions; 60 | 61 | if (msgRepondu) { 62 | if(msgRepondu.audioMessage) { 63 | 64 | const media2 = await zk.downloadAndSaveMediaMessage(msgRepondu.audioMessage) 65 | 66 | let set2 = "-af equalizer=f=18:width_type=o:width=2:g=14"; 67 | let ran2 = `${filename}.mp3`; 68 | 69 | try { 70 | exec(`ffmpeg -i ${media2} ${set2} ${ran2}`, (err, stderr, stdout) => { 71 | fs.unlinkSync(media2); 72 | if (err) return repondre("error during the procedure " + err ); 73 | 74 | let buff2 = fs.readFileSync(ran2); 75 | 76 | zk.sendMessage( 77 | dest, 78 | { audio: buff2, mimetype: "audio/mpeg" }, 79 | { quoted: ms } 80 | ); 81 | fs.unlinkSync(ran2); 82 | }); 83 | } catch (e) { 84 | 85 | repondre("error"); 86 | } 87 | 88 | } else { 89 | repondre('the command only works with audio messages') 90 | } 91 | 92 | } else { 93 | repondre('Please mention an audio') 94 | } 95 | } 96 | ); 97 | 98 | zokou( 99 | { 100 | nomCom: 'reverse', 101 | categorie: 'Audio-Edit', 102 | }, 103 | async (dest, zk, commandeOptions) => { 104 | const { ms, repondre, msgRepondu } = commandeOptions; 105 | 106 | if (msgRepondu) { 107 | if (msgRepondu.audioMessage) { 108 | const media3 = await zk.downloadAndSaveMediaMessage(msgRepondu.audioMessage); 109 | let set3 = '-filter_complex "areverse"'; 110 | let ran3 = `${filename}.mp3`; 111 | 112 | try { 113 | exec(`ffmpeg -i ${media3} ${set3} ${ran3}`, (err, stderr, stdout) => { 114 | fs.unlinkSync(media3); 115 | if (err) return repondre("error during the procedure" + err); 116 | 117 | let buff3 = fs.readFileSync(ran3); 118 | 119 | zk.sendMessage(dest, { audio: buff3, mimetype: "audio/mpeg" }, { quoted: ms }); 120 | fs.unlinkSync(ran3); 121 | }); 122 | } catch (e) { 123 | repondre("Error : " + e); 124 | } 125 | } else { 126 | repondre("The command only works with audio messages"); 127 | } 128 | } else { 129 | repondre("Please mention an audio"); 130 | } 131 | } 132 | ); 133 | 134 | zokou( 135 | { 136 | nomCom: 'slow', 137 | categorie: 'Audio-Edit', 138 | }, 139 | async (dest, zk, commandeOptions) => { 140 | const { ms, repondre, msgRepondu } = commandeOptions; 141 | 142 | if (msgRepondu) { 143 | if (msgRepondu.audioMessage) { 144 | const media5 = await zk.downloadAndSaveMediaMessage(msgRepondu.audioMessage); 145 | let set5 = '-filter:a "atempo=0.8,asetrate=44100"'; 146 | let ran5 = `${filename}.mp3`; 147 | 148 | try { 149 | exec(`ffmpeg -i ${media5} ${set5} ${ran5}`, (err, stderr, stdout) => { 150 | fs.unlinkSync(media5); 151 | if (err) return repondre("error during the procedure" + err); 152 | 153 | let buff5 = fs.readFileSync(ran5); 154 | 155 | zk.sendMessage(dest, { audio: buff5, mimetype: "audio/mpeg" }, { quoted: ms }); 156 | fs.unlinkSync(ran5); 157 | }); 158 | } catch (e) { 159 | repondre("Error : " + e); 160 | } 161 | } else { 162 | repondre("The command only works with audio messages"); 163 | } 164 | } else { 165 | repondre("Please mention an audio"); 166 | } 167 | } 168 | ); 169 | 170 | // Cas pour l'effet "smooth" 171 | zokou( 172 | { 173 | nomCom: 'smooth', 174 | categorie: 'Audio-Edit', 175 | }, 176 | async (dest, zk, commandeOptions) => { 177 | const { ms, repondre, msgRepondu } = commandeOptions; 178 | 179 | if (msgRepondu) { 180 | if (msgRepondu.audioMessage) { 181 | const mediaSmooth = await zk.downloadAndSaveMediaMessage(msgRepondu.audioMessage); 182 | let setSmooth = '-filter:v "minterpolate=\'mi_mode=mci:mc_mode=aobmc:vsbmc=1:fps=120\'"'; 183 | let ranSmooth = `${filename}.mp3`; 184 | 185 | try { 186 | exec(`ffmpeg -i ${mediaSmooth} ${setSmooth} ${ranSmooth}`, (err, stderr, stdout) => { 187 | fs.unlinkSync(mediaSmooth); 188 | if (err) return repondre("error during the procedure" + err); 189 | 190 | let buff6 = fs.readFileSync(ranSmooth); 191 | 192 | zk.sendMessage(dest, { audio: buff6, mimetype: "audio/mpeg" }, { quoted: ms }); 193 | fs.unlinkSync(ranSmooth); 194 | }); 195 | } catch (e) { 196 | repondre("Error : " + e); 197 | } 198 | } else { 199 | repondre("The command only works with audio messages"); 200 | } 201 | } else { 202 | repondre("Please mention an audio"); 203 | } 204 | } 205 | ); 206 | 207 | // Cas pour l'effet "tempo" 208 | zokou( 209 | { 210 | nomCom: 'tempo', 211 | categorie: 'Audio-Edit', 212 | }, 213 | async (dest, zk, commandeOptions) => { 214 | const { ms, repondre, msgRepondu } = commandeOptions; 215 | 216 | if (msgRepondu) { 217 | if (msgRepondu.audioMessage) { 218 | const mediaTempo = await zk.downloadAndSaveMediaMessage(msgRepondu.audioMessage); 219 | let setTempo = '-filter:a "atempo=0.9,asetrate=65100"'; 220 | let ranTempo = `${filename}.mp3`; 221 | 222 | try { 223 | exec(`ffmpeg -i ${mediaTempo} ${setTempo} ${ranTempo}`, (err, stderr, stdout) => { 224 | fs.unlinkSync(mediaTempo); 225 | if (err) return repondre("error during the procedure " + err); 226 | 227 | let buff7 = fs.readFileSync(ranTempo); 228 | 229 | zk.sendMessage(dest, { audio: buff7, mimetype: "audio/mpeg" }, { quoted: ms }); 230 | fs.unlinkSync(ranTempo); 231 | }); 232 | } catch (e) { 233 | repondre("Error : " + e); 234 | } 235 | } else { 236 | repondre("The command only works with audio messages"); 237 | } 238 | } else { 239 | repondre("Please mention an audio"); 240 | } 241 | } 242 | ); 243 | 244 | // Cas pour l'effet "nightcore" 245 | zokou( 246 | { 247 | nomCom: 'nightcore', 248 | categorie: 'Audio-Edit', 249 | }, 250 | async (dest, zk, commandeOptions) => { 251 | const { ms, repondre, msgRepondu } = commandeOptions; 252 | 253 | if (msgRepondu) { 254 | if (msgRepondu.audioMessage) { 255 | const mediaNightcore = await zk.downloadAndSaveMediaMessage(msgRepondu.audioMessage); 256 | let setNightcore = '-filter:a "atempo=1.07,asetrate=44100*1.20"'; 257 | let ranNightcore = `${filename}.mp3`; 258 | 259 | try { 260 | exec(`ffmpeg -i ${mediaNightcore} ${setNightcore} ${ranNightcore}`, (err, stderr, stdout) => { 261 | fs.unlinkSync(mediaNightcore); 262 | if (err) return repondre("error during the procedure " + err); 263 | 264 | let buff8 = fs.readFileSync(ranNightcore); 265 | 266 | zk.sendMessage(dest, { audio: buff8, mimetype: "audio/mpeg" }, { quoted: ms }); 267 | fs.unlinkSync(ranNightcore); 268 | }); 269 | } catch (e) { 270 | repondre("Erreur : " + e); 271 | } 272 | } else { 273 | repondre("The command only works with audio messages"); 274 | } 275 | } else { 276 | repondre("Please mention an audio"); 277 | } 278 | } 279 | ); 280 | 281 | -------------------------------------------------------------------------------- /phantom/rank.js: -------------------------------------------------------------------------------- 1 | const {zokou} = require("../framework/zokou"); 2 | const {getMessagesAndXPByJID,getBottom10Users} = require("../bdd/level"); 3 | 4 | 5 | function get_level_exp(xp) { 6 | const levelThresholds = [ 7 | { level: 1, xpThreshold: 500 }, 8 | { level: 2, xpThreshold: 1000 }, 9 | { level: 3, xpThreshold: 2000 }, 10 | { level: 4, xpThreshold: 4000 }, 11 | { level: 5, xpThreshold: 7000 }, 12 | { level: 6, xpThreshold: 10000 }, 13 | { level: 7, xpThreshold: 15000 }, 14 | { level: 8, xpThreshold: 20000}, 15 | { level: 9, xpThreshold: 25000}, 16 | { level: 10, xpThreshold: 30000}, 17 | { level: 11, xpThreshold: 35000}, 18 | { level: 12, xpThreshold: 45000}, 19 | { level: 13, xpThreshold: 55000}, 20 | { level: 14, xpThreshold: 65000}, 21 | { level: 15, xpThreshold: 75000}, 22 | { level: 16, xpThreshold: 90000}, 23 | { level: 17, xpThreshold: 105000}, 24 | { level: 18, xpThreshold: 120000}, 25 | { level: 19, xpThreshold: 135000}, 26 | { level: 20, xpThreshold: 150000}, 27 | { level: 21, xpThreshold: 170000}, 28 | { level: 22, xpThreshold: 190000}, 29 | { level: 23, xpThreshold: 210000}, 30 | { level: 24, xpThreshold: 230000}, 31 | { level: 25, xpThreshold: 255000}, 32 | { level: 26, xpThreshold: 270000}, 33 | { level: 27, xpThreshold: 295000}, 34 | { level: 28, xpThreshold: 320000}, 35 | { level: 29, xpThreshold: 345000}, 36 | { level: 30, xpThreshold: 385000}, 37 | { level: 31, xpThreshold: 425000}, 38 | { level: 32, xpThreshold: 465000}, 39 | { level: 33, xpThreshold: 505000}, 40 | { level: 34, xpThreshold: 545000}, 41 | { level: 35, xpThreshold: 590000}, 42 | { level: 36, xpThreshold: 635000}, 43 | { level: 37, xpThreshold: 680000}, 44 | { level: 38, xpThreshold: 725000}, 45 | { level: 39, xpThreshold: 770000}, 46 | { level: 40, xpThreshold: 820000}, 47 | { level: 41, xpThreshold: 870000}, 48 | { level: 42, xpThreshold: 920000}, 49 | { level: 43, xpThreshold: 970000}, 50 | { level: 44, xpThreshold: 1020000}, 51 | { level: 45, xpThreshold: 1075000}, 52 | { level: 46, xpThreshold: 1130000}, 53 | { level: 47, xpThreshold: 1185000}, 54 | { level: 48, xpThreshold: 1240000}, 55 | { level: 49, xpThreshold: 1295000}, 56 | { level: 'Zk-GOD', xpThreshold: 2000000} 57 | ]; 58 | 59 | let level = 0; 60 | let exp = xp; 61 | let xplimit = levelThresholds[level].xpThreshold; 62 | 63 | for (let i = 0; i < levelThresholds.length; i++) { 64 | if (xp >= levelThresholds[i].xpThreshold) { 65 | level = levelThresholds[i].level; 66 | xplimit = levelThresholds[i + 1]?.xpThreshold || 'No-limit'; 67 | exp = xp - levelThresholds[i].xpThreshold; 68 | } else { 69 | break; 70 | } 71 | } 72 | 73 | return { 74 | level: level, 75 | xplimit: xplimit, 76 | exp: exp 77 | }; 78 | } 79 | 80 | module.exports = { 81 | get_level_exp, 82 | } ; 83 | 84 | zokou( { 85 | nomCom : "rank", 86 | categorie : "Fun", 87 | }, 88 | async(dest,zk, commandeOptions)=> { 89 | 90 | const {ms , repondre,auteurMessage,nomAuteurMessage, msgRepondu , auteurMsgRepondu , mybotpic} = commandeOptions ; 91 | 92 | if (msgRepondu) { 93 | 94 | try { 95 | 96 | let rank = await getMessagesAndXPByJID(auteurMsgRepondu) ; 97 | 98 | const data = await get_level_exp(rank.xp) 99 | let ppuser ; 100 | 101 | 102 | try { 103 | ppuser = await zk.profilePictureUrl(auteurMsgRepondu , 'image') ; 104 | } catch { 105 | ppuser = mybotpic() 106 | } ; 107 | 108 | 109 | let role ; 110 | 111 | if (data.level < 5) { 112 | role = 'baby' 113 | } else if (data.level >= 5 && data.level < 10) { 114 | role = 'kid-Ninja' 115 | } else if ( data.level >= 10 && data.level < 15 ) { 116 | role = 'Ninja-genin' 117 | } else if ( data.level >= 15 && data.level < 20 ) { 118 | role = 'Ninja-chunin' 119 | } else if ( data.level >= 20 && data.level < 25 ) { 120 | role = 'Ninja-jonin' 121 | } else if ( data.level >= 25 && data.level < 30 ) { 122 | role = 'ANBU' 123 | } else if ( data.level >= 30 && data.level < 35 ) { 124 | role = 'strong ninja' 125 | } else if ( data.level >= 35 && data.level < 40 ) { 126 | role = 'kage' 127 | } else if ( data.level >= 40 && data.level < 45 ) { 128 | role = 'Hermit seinin' 129 | } else if ( data.level >= 45 && data.level < 50 ) { 130 | role = 'Otsusuki' 131 | } else { 132 | role = 'GOD' 133 | } 134 | 135 | 136 | let msg = ` 137 | ┏━━━┛ Super-Rang ┗━━━┓ 138 | 139 | *Name :* @${auteurMsgRepondu.split("@")[0]} 140 | 141 | *Level :* ${data.level} 142 | 143 | *EXP :* ${data.exp}/${data.xplimit} 144 | 145 | *Role :* ${role} 146 | 147 | *Messages :* ${rank.messages} 148 | 149 | ┕━✿━┑ ┍━✿━┙` 150 | 151 | zk.sendMessage( 152 | dest, 153 | { 154 | image : {url : ppuser}, 155 | caption : msg, 156 | mentions : [auteurMsgRepondu] 157 | }, 158 | {quoted : ms} 159 | ) 160 | 161 | 162 | } catch (error) { 163 | repondre(error) 164 | } 165 | } else { 166 | 167 | 168 | try { 169 | 170 | let jid = auteurMessage ; 171 | 172 | let rang = await getMessagesAndXPByJID(jid) ; 173 | 174 | const data = get_level_exp(rang.xp) 175 | let ppuser ; 176 | 177 | 178 | try { 179 | ppuser = await zk.profilePictureUrl(jid, 'image') ; 180 | } catch { 181 | ppuser = mybotpic() 182 | } ; 183 | 184 | 185 | let role ; 186 | 187 | if (data.level < 5) { 188 | role = 'Nouveau né(e)' 189 | } else if (data.level >= 5 && data.level < 10) { 190 | role = 'kid-Ninja' 191 | } else if ( data.level >= 10 && data.level < 15 ) { 192 | role = 'Ninja-genin' 193 | } else if ( data.level >= 15 && data.level < 20 ) { 194 | role = 'Ninja-chunin' 195 | } else if ( data.level >= 20 && data.level < 25 ) { 196 | role = 'Ninja-jonin' 197 | } else if ( data.level >= 25 && data.level < 30 ) { 198 | role = 'ANBU' 199 | } else if ( data.level >= 30 && data.level < 35 ) { 200 | role = 'strong ninja' 201 | } else if ( data.level >= 35 && data.level < 40 ) { 202 | role = 'kage' 203 | } else if ( data.level >= 40 && data.level < 45 ) { 204 | role = 'Hermit seinin' 205 | } else if ( data.level >= 45 && data.level < 50 ) { 206 | role = 'Otsusuki' 207 | } else { 208 | role = 'level-GOD' 209 | } 210 | 211 | 212 | let msg = ` 213 | ┏━━━┛ Super rank┗━━━┓ 214 | 215 | *Name :* ${nomAuteurMessage} 216 | 217 | *Level :* ${data.level} 218 | 219 | *EXP :* ${data.exp}/${data.xplimit} 220 | 221 | *Role :* ${role} 222 | 223 | *Messages :* ${rang.messages} 224 | 225 | ┕━✿━┑ ┍━✿━┙` 226 | 227 | zk.sendMessage( 228 | dest, 229 | { 230 | image : {url : ppuser}, 231 | caption : msg 232 | }, 233 | {quoted : ms} 234 | ) 235 | 236 | } catch (error) { 237 | repondre(error) 238 | } 239 | 240 | } 241 | 242 | 243 | }) ; 244 | 245 | zokou( { 246 | nomCom : "toprank", 247 | categorie : "Fun", 248 | }, 249 | async(dest,zk, commandeOptions)=> { 250 | 251 | const {ms , mybotpic} = commandeOptions ; 252 | 253 | 254 | let msg = `┏━━┛ Super-top-rang ┗━━┓\n\n` 255 | 256 | let topRanks = await getBottom10Users() ; 257 | let mention = [] ; 258 | for (const rank of topRanks ) { 259 | 260 | const data = await get_level_exp(rank.xp) ; 261 | 262 | let role ; 263 | 264 | if (data.level < 5) { 265 | role = 'Nouveau né(e)' 266 | } else if (data.level >= 5 && data.level < 10) { 267 | role = 'kid ninja' 268 | } else if ( data.level >= 10 && data.level < 15 ) { 269 | role = 'Ninja-genin' 270 | } else if ( data.level >= 15 && data.level < 20 ) { 271 | role = 'Ninja-chunin' 272 | } else if ( data.level >= 20 && data.level < 25 ) { 273 | role = 'Ninja-jonin' 274 | } else if ( data.level >= 25 && data.level < 30 ) { 275 | role = 'ANBU' 276 | } else if ( data.level >= 30 && data.level < 35 ) { 277 | role = 'strong ninja' 278 | } else if ( data.level >= 35 && data.level < 40 ) { 279 | role = 'kage' 280 | } else if ( data.level >= 40 && data.level < 45 ) { 281 | role = 'Hermit seinin' 282 | } else if ( data.level >= 45 && data.level < 50 ) { 283 | role = 'Otsusuki' 284 | } else { 285 | role = 'level-GOD' 286 | } 287 | msg += `----------------------- 288 | 289 | *Name :* @${rank.jid.split("@")[0]} 290 | *Level :* ${data.level} 291 | *Role :* ${role}\n` ; 292 | 293 | mention.push(rank.jid) ; 294 | } 295 | 296 | zk.sendMessage(dest, 297 | { 298 | image : { url : mybotpic() }, 299 | caption : msg, 300 | mentions : mention 301 | }, 302 | {quoted : ms}) 303 | 304 | 305 | }) 306 | 307 | 308 | 309 | 310 | --------------------------------------------------------------------------------