-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
184 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
const util = require('util'); | ||
|
||
const fs = require('fs-extra'); | ||
|
||
const { zokou } = require(__dirname + "/../framework/zokou"); | ||
|
||
const { format } = require(__dirname + "/../framework/mesfonctions"); | ||
|
||
const os = require("os"); | ||
|
||
const moment = require("moment-timezone"); | ||
|
||
const s = require(__dirname + "/../set"); | ||
|
||
|
||
|
||
zokou({ nomCom: "menu", categorie: "Menu" }, async (dest, zk, commandeOptions) => { | ||
|
||
let { ms, repondre ,prefixe,nomAuteurMessage,mybotpic} = commandeOptions; | ||
|
||
let { cm } = require(__dirname + "/../framework//zokou"); | ||
|
||
var coms = {}; | ||
|
||
var mode = "public"; | ||
|
||
|
||
|
||
if ((s.MODE).toLocaleLowerCase() != "yes") { | ||
|
||
mode = "private"; | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
cm.map(async (com, index) => { | ||
|
||
if (!coms[com.categorie]) | ||
|
||
coms[com.categorie] = []; | ||
|
||
coms[com.categorie].push(com.nomCom); | ||
|
||
}); | ||
|
||
|
||
|
||
moment.tz.setDefault(s.TZ); | ||
|
||
|
||
|
||
// Créer une date et une heure en GMT | ||
|
||
const temps = moment().format('HH:mm:ss'); | ||
|
||
const date = moment().format('DD/MM/YYYY'); | ||
|
||
|
||
|
||
let infoMsg = ` | ||
╭──━━━━══════━━━━❂ | ||
┃ ━━⦿ *YESSER MD* ⦿━━ | ||
┃ ✯𝕄𝕠𝕕𝕖: ${mode} | ||
┃ ✯𝕌𝕤𝕖𝕣 : ${s.OWNER_NAME} | ||
┃ ✯𝕃𝕚𝕓𝕣𝕒𝕣𝕪 : Baileys | ||
┃ ✯ℙ𝕣𝕖𝕗𝕚𝕩 : ${s.PREFIXE} | ||
┃ ✯𝔻𝕒𝕥𝕖 : ${date} | ||
┃ ✯𝕋𝕚𝕞𝕖 : ${temps} | ||
┃ ✯𝕋𝕠𝕠𝕝𝕤 : ${cm.length} | ||
┃ ✯ℝ𝕒𝕞 : ${format(os.totalmem() - os.freemem())}/${format(os.totalmem())} | ||
┃ ✯ℍ𝕠𝕤𝕥 : ${os.platform()} | ||
┃ ⦿━━━━═════━━━━⦿ | ||
╰──━━━━══════━━━━❂\n\n`; | ||
|
||
|
||
|
||
|
||
let menuMsg = ` | ||
┏━━══════━━┓ | ||
┃⦿ _*YESSER TEACH*_ | ||
┗━━══════━━┛\n | ||
`; | ||
|
||
|
||
|
||
for (const cat in coms) { | ||
|
||
menuMsg += `╭─━━═━❍ _*${cat}*_ ❍━═━━─⊷`; | ||
|
||
for (const cmd of coms[cat]) { | ||
|
||
menuMsg += ` | ||
┃❂ ${cmd}`; | ||
|
||
} | ||
|
||
menuMsg += ` | ||
╰─━━━━══════━━━━⦿\n` | ||
|
||
} | ||
|
||
|
||
|
||
menuMsg += ` | ||
╭──━━══════━━━━┓ | ||
┃⦿ _*YESSER MD 𝟚𝟘𝟚𝟜*_ | ||
┃⦿ _*𝕖𝕟𝕛𝕠𝕪 𝕝𝕚𝕗𝕖*_ | ||
╰──━━══════━━━┳┛ | ||
╭──━━══════━━━┻┓ | ||
┃⦿ _*𝕡𝕠𝕨𝕖𝕣𝕖𝕕 𝕓𝕪 𖣘YESSER TECH𖣘*_ | ||
╰──━━══════━━━━┛\n | ||
`; | ||
|
||
|
||
|
||
var lien = mybotpic(); | ||
|
||
|
||
|
||
if (lien.match(/\.(mp4|gif)$/i)) { | ||
|
||
try { | ||
|
||
zk.sendMessage(dest, { video: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *TKM-BOT*, déveloper Cod3uchiha" , gifPlayback : true }, { quoted: ms }); | ||
|
||
} | ||
|
||
catch (e) { | ||
|
||
console.log("🥵🥵 Menu error " + e); | ||
|
||
repondre("🥵🥵 Menu error " + e); | ||
|
||
} | ||
|
||
} | ||
|
||
// Vérification pour .jpeg ou .png | ||
|
||
else if (lien.match(/\.(jpeg|png|jpg)$/i)) { | ||
|
||
try { | ||
|
||
zk.sendMessage(dest, { image: { url: lien }, caption:infoMsg + menuMsg, footer: "Je suis *TKM-bot*, déveloper cod3uchiha" }, { quoted: ms }); | ||
|
||
} | ||
|
||
catch (e) { | ||
|
||
console.log("🥵🥵 Menu error " + e); | ||
|
||
repondre("🥵🥵 Menu error " + e); | ||
|
||
} | ||
|
||
} | ||
|
||
else { | ||
|
||
|
||
|
||
repondre(infoMsg + menuMsg); | ||
|
||
|
||
|
||
} | ||
|
||
|
||
|
||
}); |