xwa-api
Version:
GARFIELD 6.0 BY NOIZE.
76 lines (61 loc) • 3.91 kB
JavaScript
/*COPYRIGHT (C) 2022 CODED BY NOIZE */
const Garfield = require('../events');
const {MessageType} = require('@adiwajshing/baileys');
const {spawnSync} = require('child_process');
const Config = require('../config');
const chalk = require('chalk');
const Axios = require('axios');
const Language = require('../language');
const Lang = Language.getString('system_stats');
if (Config.WORKTYPE == 'private') {
Garfield.addXnodes({pattern: 'alive', fromMe: true, desc: Lang.ALIVE_DESC}, (async (message, match) => {
if (Config.ALIVEMSG == 'default') {
await message.client.sendMessage(message.jid,'```Tanrı Türk\'ü Korusun. 🐺 Asena Hizmetinde!```\n\n*Version:* ```'+Config.VERSION+'```\n*Branch:* ```'+Config.BRANCH+'```\n*Telegram Group:* https://t.me/AsenaSupport\n*Telegram Channel:* https://t.me/asenaremaster\n*Plugin Channel:* ' + Config.CHANNEL , MessageType.text);
}
else {
const pow = '*Powered by WhatsAsena*'
const payload = Config.ALIVEMSG
const status = await message.client.getStatus()
const ppUrl = await message.client.getProfilePicture()
const resim = await Axios.get(ppUrl, {responseType: 'arraybuffer'})
if (!payload.includes('{pp}')) {
await message.client.sendMessage(message.jid,payload.replace('{version}', Config.VERSION).replace('{info}', `${status.status}`).replace('{plugin}', Config.CHANNEL) + '\n' + pow, MessageType.text);
}
else if (payload.includes('{pp}')) {
await message.sendMessage(Buffer(resim.data), MessageType.image, { caption: payload.replace('{version}', Config.VERSION).replace('{pp}', '').replace('{info}', `${status.status}`).replace('{plugin}', Config.CHANNEL) + '\n' + pow });
}
}
}));
Garfield.addXnodes({pattern: 'sysd', fromMe: true, desc: Lang.SYSD_DESC}, (async (message, match) => {
const child = spawnSync('neofetch', ['--stdout']).stdout.toString('utf-8')
await message.sendMessage(
'```' + child + '```', MessageType.text
);
}));
}
else if (Config.WORKTYPE == 'public') {
Garfield.addXnodes({pattern: 'alive', fromMe: false, desc: Lang.ALIVE_DESC}, (async (message, match) => {
if (Config.ALIVEMSG == 'default') {
await message.client.sendMessage(message.jid,'```Tanrı Türk\'ü Korusun. 🐺 Asena Hizmetinde!```\n\n*Version:* ```'+Config.VERSION+'```\n*Branch:* ```'+Config.BRANCH+'```\n*Telegram Group:* https://t.me/AsenaSupport\n*Telegram Channel:* https://t.me/asenaremaster\n*Plugin Channel:* ' + Config.CHANNEL, MessageType.text);
}
else {
const pow = '*GARFIELD BY NOIZE PROJECTS*'
const payload = Config.ALIVEMSG
const status = await message.client.getStatus()
const ppUrl = await message.client.getProfilePicture()
const resim = await Axios.get(ppUrl, {responseType: 'arraybuffer'})
if (!payload.includes('{pp}')) {
await message.client.sendMessage(message.jid,payload.replace('{version}', Config.VERSION).replace('{info}', `${status.status}`).replace('{plugin}', Config.CHANNEL) + '\n' + pow, MessageType.text);
}
else if (payload.includes('{pp}')) {
await message.sendMessage(Buffer(resim.data), MessageType.image, { caption: payload.replace('{version}', Config.VERSION).replace('{pp}', '').replace('{info}', `${status.status}`).replace('{plugin}', Config.CHANNEL) + '\n' + pow });
}
}
}));
Garfield.addXnodes({pattern: 'sysd', fromMe: false, desc: Lang.SYSD_DESC}, (async (message, match) => {
const child = spawnSync('neofetch', ['--stdout']).stdout.toString('utf-8')
await message.sendMessage(
'```' + child + '```', MessageType.text
);
}));
}