forked from BrunoSobrino/TheMystic-Bot-MD
-
Notifications
You must be signed in to change notification settings - Fork 1
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
9 changed files
with
810 additions
and
130 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 |
---|---|---|
|
@@ -16,56 +16,22 @@ global.isBaileysFail = false | |
global.defaultLenguaje = 'es'; | ||
|
||
global.owner = [ | ||
['5219992095479', '👑 Mystic - Creador 👑', true], | ||
['51940617554', '💫 Mystic - Collaborator 2 💫', true], | ||
['51996089079', '💫 Mystic - Collaborator 3 💫', true], | ||
['5218442286089', '💫 Mystic - Collaborator 4 💫', true], | ||
['50246028932', '💫 Mystic - Collaborator 5 💫', true], | ||
['5212412377467', '💫 Mystic - Collaborator 6 💫', true], | ||
['5215517489568', '💫 Mystic - Rey Endymion 💫', false], | ||
['59895555511', '💫 Mystic - Collaborator 8 💫', true], | ||
['573012482597', '💫 Mystic - OfcDiego', true], | ||
['59175655964', '💫 Mystic - By Alba070503 💫', true], | ||
['5493794297363', '💫 Mystic - Gabriel Ofc', true], | ||
['393518398856', '💫 Mystic - Tester Fabri115💫', true], | ||
['212781160203', '💫 Mystic - Saad 💫', true], | ||
['5217778573223', '💫 Mystic - Sarethh 💫', true], | ||
['593968585283'], | ||
['5492266466080'], | ||
['5218442114446'], | ||
['59894808483'], | ||
['593980586516'], | ||
['595975740803'], | ||
['5492266613038'], | ||
['50497150165'], | ||
['51906662557'], | ||
['573183650526'], | ||
['5217441298510'], | ||
['5217294888993'], | ||
['595992611272'], | ||
['5219992843892'], | ||
['5493795319019'], | ||
['573147616444'], | ||
['5219991402134'], | ||
['5219996125657'], | ||
['5492215034412'], | ||
['584125778026'], | ||
['5492964650915'], | ||
['5218444937407'] | ||
['595972184435', '👑 Mystic - Creador 👑', true], | ||
['595991190555'] | ||
]; | ||
|
||
global.suittag = ['5219993404349']; | ||
global.prems = ['51995386439']; | ||
global.suittag = ['595972184435']; | ||
global.prems = ['595972184435']; | ||
|
||
// API | ||
global.BASE_API_DELIRIUS = "https://deliriussapi-oficial.vercel.app"; | ||
|
||
global.packname = 'Sticker'; | ||
global.author = 'The Mystic - Bot'; | ||
global.wm = 'The Mystic - Bot'; | ||
global.titulowm = 'The Mystic - Bot'; | ||
global.titulowm2 = `The Mystic - Bot` | ||
global.igfg = 'The Mystic - Bot'; | ||
global.packname = ''; | ||
global.author = 'MysticMOD'; | ||
global.wm = 'MysticMOD'; | ||
global.titulowm = 'MysticMOD'; | ||
global.titulowm2 = `MysticMOD` | ||
global.igfg = 'MysticMOD'; | ||
global.wait = '*_[ ⏳ ] Cargando..._*'; | ||
|
||
/*global.imagen1 = fs.createReadStream('./src/assets/images/menu/languages/es/menu.png'); | ||
|
@@ -91,16 +57,16 @@ global.mes = d.toLocaleDateString('es', {month: 'long'}); | |
global.año = d.toLocaleDateString('es', {year: 'numeric'}); | ||
global.tiempo = d.toLocaleString('en-US', {hour: 'numeric', minute: 'numeric', second: 'numeric', hour12: true}); | ||
//* **************************** | ||
global.wm2 = `${dia} ${fecha}\nThe Mystic - Bot`; | ||
global.gt = 'The Mystic - Bot'; | ||
global.mysticbot = 'The Mystic - Bot'; | ||
global.channel = 'https://whatsapp.com/channel/0029Vaein6eInlqIsCXpDs3y'; | ||
global.md = 'https://github.com/BrunoSobrino/TheMystic-Bot-MD'; | ||
global.mysticbot = 'https://github.com/BrunoSobrino/TheMystic-Bot-MD'; | ||
global.wm2 = `${dia} ${fecha}\nMysticMOD`; | ||
global.gt = 'MysticMOD'; | ||
global.mysticbot = 'MysticMOD'; | ||
global.channel = ''; | ||
global.md = 'https://github.com/weskerty/TheMysticMOD'; | ||
global.mysticbot = 'https://github.com/weskerty/TheMysticMOD'; | ||
global.waitt = '*_[ ⏳ ] Cargando..._*'; | ||
global.waittt = '*_[ ⏳ ] Cargando..._*'; | ||
global.waitttt = '*_[ ⏳ ] Cargando..._*'; | ||
global.nomorown = '5219993404349'; | ||
global.nomorown = '595972184435'; | ||
global.pdoc = ['application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/msword', 'application/pdf', 'text/rtf']; | ||
global.cmenut = '❖––––––『'; | ||
global.cmenub = '┊✦ '; | ||
|
@@ -115,10 +81,10 @@ global.htki = '*⭑•̩̩͙⊱•••• ☪*'; | |
global.htka = '*☪ ••••̩̩͙⊰•⭑*'; | ||
global.comienzo = '• • ◕◕════'; | ||
global.fin = '════◕◕ • •'; | ||
global.botdate = `*[ 📅 ] Fecha:* ${moment.tz('America/Mexico_City').format('DD/MM/YY')}`; | ||
global.bottime = `*[ ⏳ ] Hora:* ${moment.tz('America/Mexico_City').format('HH:mm:ss')}`; | ||
global.botdate = `*[ 📅 ] Fecha:* ${moment.tz('America/Asuncion').format('DD/MM/YY')}`; | ||
global.bottime = `*[ ⏳ ] Hora:* ${moment.tz('America/Asuncion').format('HH:mm:ss')}`; | ||
global.fgif = {key: {participant: '[email protected]'}, message: {'videoMessage': {'title': wm, 'h': `Hmm`, 'seconds': '999999999', 'gifPlayback': 'true', 'caption': bottime, 'jpegThumbnail': fs.readFileSync('./src/assets/images/menu/languages/es/menu.png')}}}; | ||
global.multiplier = 99; | ||
global.multiplier = 50; | ||
global.flaaa = [ | ||
'https://flamingtext.com/net-fu/proxy_form.cgi?&imageoutput=true&script=water-logo&script=water-logo&fontsize=90&doScale=true&scaleWidth=800&scaleHeight=500&fontsize=100&fillTextColor=%23000&shadowGlowColor=%23000&backgroundColor=%23000&text=', | ||
'https://flamingtext.com/net-fu/proxy_form.cgi?&imageoutput=true&script=crafts-logo&fontsize=90&doScale=true&scaleWidth=800&scaleHeight=500&text=', | ||
|
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
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,31 @@ | ||
import { exec } from 'child_process'; | ||
|
||
function runCommand(command, description) { | ||
return new Promise((resolve, reject) => { | ||
console.log(`Ejecutando: ${description}...`); | ||
|
||
exec(command, (error, stdout, stderr) => { | ||
if (error) { | ||
console.error(`Error al ejecutar ${description}:`, error); | ||
reject(error); | ||
return; | ||
} | ||
if (stderr) { | ||
console.error(`Stderr al ejecutar ${description}:`, stderr); | ||
} | ||
console.log(`Resultado de ${description}:`, stdout); | ||
resolve(stdout); | ||
}); | ||
}); | ||
} | ||
|
||
// Agregar mas lineas para mas paquetes | ||
async function installPythonDependencies() { | ||
try { | ||
await runCommand('pip install -U --pre "yt-dlp[default]"', 'Instalando YT-DLP'); | ||
} catch (error) { | ||
console.error('Error Instalando Modulos Opcionales, Algunos Plugins No Funcionaran.', error); | ||
} | ||
} | ||
|
||
installPythonDependencies(); |
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,142 @@ | ||
// MR. De la Comunidad para la Comunidad. Prohibida su Venta. | ||
// El Software se proporciona bajo los términos de la Licencia MIT, excepto que usted no puede: | ||
// 1. Vender, revender o arrendar el Software. | ||
// 2. Cobrar a otros por el acceso, la distribución o cualquier otro uso comercial del Software. | ||
// 3. Usar el Software como parte de un producto comercial o una oferta de servicio. | ||
|
||
import os from 'os'; | ||
import { exec } from 'child_process'; | ||
|
||
function formatUptime(uptime) { | ||
const seconds = Math.floor(uptime % 60); | ||
const minutes = Math.floor((uptime / 60) % 60); | ||
const hours = Math.floor((uptime / 3600) % 24); | ||
return `${hours} horas, ${minutes} minutos, ${seconds} segundos`; | ||
} | ||
|
||
function getVersions(callback) { | ||
exec('node -v', (err, nodeVersion) => { | ||
if (err) nodeVersion = '✖️'; | ||
exec('npm -v', (err, npmVersion) => { | ||
if (err) npmVersion = '✖️'; | ||
exec('ffmpeg -version', (err, ffmpegVersion) => { | ||
if (err) ffmpegVersion = '✖️'; | ||
exec('python --version || python3 --version || py --version', (err, pythonVersion) => { | ||
if (err) pythonVersion = '✖️'; | ||
exec('pip --version || pip3 --version', (err, pipVersion) => { | ||
if (err) pipVersion = '✖️'; | ||
exec('choco -v', (err, chocoVersion) => { | ||
if (err) chocoVersion = '✖️'; | ||
callback({ nodeVersion, npmVersion, ffmpegVersion, pythonVersion, pipVersion, chocoVersion }); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
} | ||
|
||
function getStorageInfo(callback) { | ||
if (os.platform() === 'win32') { | ||
exec('wmic logicaldisk get size,freespace,caption', (err, stdout) => { | ||
if (err) return callback('✖️'); | ||
const lines = stdout.trim().split('\n').slice(1); | ||
const storageInfo = lines.map(line => { | ||
const [drive, free, total] = line.trim().split(/\s+/); | ||
return `🖥️ ${drive}: ${(total / (1024 ** 3)).toFixed(2)} GB total, ${(free / (1024 ** 3)).toFixed(2)} GB libres`; | ||
}).join('\n'); | ||
callback(storageInfo); | ||
}); | ||
} else { | ||
exec('df -h --output=source,size,avail,target', (err, stdout) => { | ||
if (err) return callback('✖️'); | ||
const lines = stdout.trim().split('\n').slice(1); | ||
const storageInfo = lines.map(line => { | ||
const [device, total, free, mount] = line.trim().split(/\s+/); | ||
return `🖥️ ${mount}: ${total} total, ${free} libres en ${device}`; | ||
}).join('\n'); | ||
callback(storageInfo); | ||
}); | ||
} | ||
} | ||
|
||
function getLinuxInfo(callback) { | ||
exec('cat /etc/os-release', (err, osInfo) => { | ||
if (err) osInfo = '✖️'; | ||
callback(osInfo.trim()); | ||
}); | ||
} | ||
|
||
function getBatteryInfo(callback) { | ||
if (os.platform() === 'linux' || os.platform() === 'darwin') { | ||
exec('upower -i $(upower -e | grep BAT)', (err, batteryInfo) => { | ||
if (err) return callback('✖️'); | ||
callback(batteryInfo); | ||
}); | ||
} else if (os.platform() === 'win32') { | ||
exec('WMIC Path Win32_Battery Get EstimatedChargeRemaining', (err, batteryInfo) => { | ||
if (err) return callback('✖️'); | ||
callback(`🔋 ${batteryInfo.trim()}%`); | ||
}); | ||
} else { | ||
callback('✖️'); | ||
} | ||
} | ||
|
||
async function systemInfoPlugin(m, extra) { | ||
try { | ||
const systemInfo = { | ||
platform: os.platform(), | ||
cpuArch: os.arch(), | ||
cpus: os.cpus().length, | ||
totalMemory: (os.totalmem() / (1024 ** 3)).toFixed(2) + ' GB', // Total RAM en GB | ||
freeMemory: (os.freemem() / (1024 ** 3)).toFixed(2) + ' GB', // RAM libre en GB | ||
uptime: formatUptime(os.uptime()), // Tiempo de actividad | ||
osVersion: os.release(), // Versión del SO | ||
loadAverage: os.loadavg().map(load => load.toFixed(2)).join(', ') // Carga promedio | ||
}; | ||
|
||
getVersions((versions) => { | ||
getBatteryInfo((batteryStatus) => { | ||
getStorageInfo((storageInfo) => { | ||
getLinuxInfo((linuxInfo) => { | ||
let infoMessage = `> *📊 Información del Sistema*\n\n`; | ||
infoMessage += `- 🌐 *Plataforma*: _${systemInfo.platform}_\n`; | ||
infoMessage += `- 💻 *Arquitectura CPU*: ${systemInfo.cpuArch}\n`; | ||
infoMessage += `- 🧠 *Núcleos CPU*: ${systemInfo.cpus}\n`; | ||
infoMessage += `- 🗄️ *Memoria Total*: ${systemInfo.totalMemory}\n`; | ||
infoMessage += `- 🗃️ *Memoria Libre*: ${systemInfo.freeMemory}\n`; | ||
infoMessage += `- ⏱️ *Tiempo de Actividad*: ${systemInfo.uptime}\n`; | ||
infoMessage += `- 📀 *Versión del SO*: ${systemInfo.osVersion}\n`; | ||
infoMessage += `- 📊 *Carga Promedio (1, 5, 15 min)*: ${systemInfo.loadAverage}\n`; | ||
infoMessage += `- 🔋 *Energia*: ${batteryStatus}\n\n`; | ||
|
||
infoMessage += `> *💾 Almacenamiento*\n`; | ||
infoMessage += `${storageInfo}\n\n`; | ||
|
||
infoMessage += `> *🛠️ Version Herramientas*\n\n`; | ||
infoMessage += `- ☕ *Node.js*: ${versions.nodeVersion.trim()}\n`; | ||
infoMessage += `- 📦 *NPM*: ${versions.npmVersion.trim()}\n`; | ||
infoMessage += `- 🎥 *FFmpeg*: ${versions.ffmpegVersion.split('\n')[0]}\n`; // Solo primera linea | ||
infoMessage += `- 🐍 *Python*: ${versions.pythonVersion.trim()}\n`; | ||
infoMessage += `- 📦 *PIP*: ${versions.pipVersion.trim()}\n`; | ||
infoMessage += `- 🍫 *Chocolatey*: ${versions.chocoVersion.trim()}\n\n`; | ||
|
||
if (os.platform() === 'linux') { | ||
infoMessage += `> *🐧 Distribución Linux*\n${linuxInfo}\n`; | ||
} | ||
|
||
extra.conn.sendMessage(m.chat, { text: infoMessage }); | ||
}); | ||
}); | ||
}); | ||
}); | ||
} catch (error) { | ||
console.error('Falla Plugin sysinfo:', error); | ||
await extra.conn.sendMessage(m.chat, { text: 'ERROR' }); | ||
} | ||
} | ||
|
||
systemInfoPlugin.command = ['sysinfo', 'host']; | ||
|
||
export default systemInfoPlugin; |
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 |
---|---|---|
@@ -1,39 +1,40 @@ | ||
|
||
|
||
|
||
|
||
export function before(m) { | ||
const datas = global | ||
const idioma = datas.db.data.users[m.sender].language || global.defaultLenguaje | ||
const _translate = JSON.parse(fs.readFileSync(`./src/languages/${idioma}.json`)) | ||
const tradutor = _translate.plugins.afk__afk | ||
const datas = global; | ||
const idioma = datas.db.data.users[m.sender].language || global.defaultLenguaje; | ||
const _translate = JSON.parse(fs.readFileSync(`./src/languages/${idioma}.json`)); | ||
const tradutor = _translate.plugins.afk__afk; | ||
|
||
const user = global.db.data.users[m.sender]; | ||
if (user.afk > -1) { | ||
m.reply(` ${tradutor.texto2[0]} ${user.afkReason ? `${tradutor.texto2[1]}` + user.afkReason : ''}* | ||
*${tradutor.texto2[2]} ${(new Date - user.afk).toTimeString()}* | ||
`.trim()); | ||
m.reply(`${tradutor.texto2[0]} ${user.afkReason ? `${tradutor.texto2[1]}` + user.afkReason : ''}* | ||
*${tradutor.texto2[2]} ${(new Date() - user.afk).toTimeString()}*`.trim()); | ||
user.afk = -1; | ||
user.afkReason = ''; | ||
} | ||
|
||
const jids = [...new Set([...(m.mentionedJid || []), ...(m.quoted ? [m.quoted.sender] : [])])]; | ||
|
||
for (const jid of jids) { | ||
const user = global.db.data.users[jid]; | ||
if (!user) { | ||
const mentionedUser = global.db.data.users[jid]; | ||
if (!mentionedUser) { | ||
continue; | ||
} | ||
const afkTime = user.afk; | ||
const afkTime = mentionedUser.afk; | ||
if (!afkTime || afkTime < 0) { | ||
continue; | ||
} | ||
const reason = user.afkReason || ''; | ||
const reason = mentionedUser.afkReason || ''; | ||
|
||
m.reply(`${tradutor.texto1[0]} | ||
*—◉ ${tradutor.texto1[1]}* | ||
*—◉ ${reason ? `${tradutor.texto1[2]}` + reason : `${tradutor.texto1[3]}`}* | ||
*—◉ ${tradutor.texto1[4]} ${(new Date - afkTime).toTimeString()}* | ||
`.trim()); | ||
*—◉ ${tradutor.texto1[1]}* | ||
*—◉ ${reason ? `${tradutor.texto1[2]}` + reason : `${tradutor.texto1[3]}`}* | ||
*—◉ ${tradutor.texto1[4]} ${(new Date() - afkTime).toTimeString()}*`.trim()); | ||
|
||
if (m.mentionedJid.includes(jid) || (m.quoted && m.quoted.sender === jid)) { | ||
m.delete(); | ||
} | ||
} | ||
return true; | ||
} |
Oops, something went wrong.