From aad678facee5969b3650a82b1685e6d7e156606b Mon Sep 17 00:00:00 2001 From: skidy89 Date: Sat, 12 Oct 2024 21:24:46 -0600 Subject: [PATCH] fkontak fix --- handler.js | 18 +- plugins/_detectEvents.js | 19 +- plugins/menu-animes.js | 26 +- plugins/menu-audios.js | 28 +- plugins/menu-caja_fuerte.js | 5 +- plugins/menu-labiblia.js | 27 +- plugins/menus-menu.js | 29 +- plugins/owner-broadcast.js | 32 +- plugins/rpg-cofre.js | 17 +- plugins/rpg-daily.js | 10 +- protoDB/database/db.proto | 90 ++ protoDB/database/index.d.ts | 906 +++++++++++ protoDB/database/index.js | 2807 +++++++++++++++++++++++++++++++++++ protoDB/database/readme.md | 15 + 14 files changed, 3865 insertions(+), 164 deletions(-) create mode 100644 protoDB/database/db.proto create mode 100644 protoDB/database/index.d.ts create mode 100644 protoDB/database/index.js create mode 100644 protoDB/database/readme.md diff --git a/handler.js b/handler.js index ac17663b42..888f98771a 100644 --- a/handler.js +++ b/handler.js @@ -8,8 +8,18 @@ import fs from 'fs'; import chalk from 'chalk'; import mddd5 from 'md5'; import ws from 'ws'; +import { randomBytes } from 'crypto'; let mconn; - +/** + * Generates a unique tag for a message + * @param {string} [tag] - The tag to use, if not provided a random one will be generated + * @returns {string} - The generated tag + * this fix the fkontak bug with the tag in watsapp web + */ +export const generateMessageTag = (tag) => { + const r = tag ? tag : 'MYSTIC' + randomBytes(12).toString('hex').toUpperCase().toString(); + return r +} /** * @type {import("baileys")} */ @@ -46,6 +56,7 @@ export async function handler(chatUpdate) { if (!m) { return; } + global.fkontak = { "key": { "participant":"0@s.whatsapp.net", "remoteJid": "status@broadcast", "fromMe": false, "id": generateMessageTag() }, "message": { "contactMessage": { "vcard": `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD` }} } global.mconn = m mconn = m m.exp = 0; @@ -1099,8 +1110,7 @@ export async function participantsUpdate({ id, participants, action }) { if (userPrefix && chat.antiArab && botTt.restrict && isBotAdminNn && action === 'add') { const responseb = await m.conn.groupParticipantsUpdate(id, [user], 'remove'); if (responseb[0].status === '404') return; - const fkontak2 = { 'key': { 'participants': '0@s.whatsapp.net', 'remoteJid': 'status@broadcast', 'fromMe': false, 'id': 'Halo' }, 'message': { 'contactMessage': { 'vcard': `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${user.split('@')[0]}:${user.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD` } }, 'participant': '0@s.whatsapp.net' }; - await m?.conn?.sendMessage(id, { text: `*[❗] @${user.split('@')[0]} ᴇɴ ᴇsᴛᴇ ɢʀᴜᴘᴏ ɴᴏ sᴇ ᴘᴇʀᴍɪᴛᴇɴ ɴᴜᴍᴇʀᴏs ᴀʀᴀʙᴇs ᴏ ʀᴀʀᴏs, ᴘᴏʀ ʟᴏ ϙᴜᴇ sᴇ ᴛᴇ sᴀᴄᴀʀᴀ ᴅᴇʟ ɢʀᴜᴘᴏ*`, mentions: [user] }, { quoted: fkontak2 }); + await m?.conn?.sendMessage(id, { text: `*[❗] @${user.split('@')[0]} ᴇɴ ᴇsᴛᴇ ɢʀᴜᴘᴏ ɴᴏ sᴇ ᴘᴇʀᴍɪᴛᴇɴ ɴᴜᴍᴇʀᴏs ᴀʀᴀʙᴇs ᴏ ʀᴀʀᴏs, ᴘᴏʀ ʟᴏ ϙᴜᴇ sᴇ ᴛᴇ sᴀᴄᴀʀᴀ ᴅᴇʟ ɢʀᴜᴘᴏ*`, mentions: [user] }, { quoted: global.fkontak }); return; } await m?.conn?.sendFile(id, apii.data, 'pp.jpg', text, null, false, { mentions: [user] }); @@ -1239,4 +1249,4 @@ watchFile(file, async () => { userr.subreloadHandler(false) } } -}); +}); \ No newline at end of file diff --git a/plugins/_detectEvents.js b/plugins/_detectEvents.js index 07bd087f96..f3b61edd03 100644 --- a/plugins/_detectEvents.js +++ b/plugins/_detectEvents.js @@ -4,8 +4,8 @@ /* Bot: https://github.com/Gatito-kw/nekobot-md */ -import {WAMessageStubType} from "baileys"; import fetch from 'node-fetch'; +import { generateMessageTag } from "../handler"; // Para configurar o idioma, na raiz do projeto altere o arquivo config.json // Para configurar el idioma, en la raíz del proyecto, modifique el archivo config.json. @@ -25,14 +25,13 @@ export async function before(m, {conn, participants}) { const chat = global.db.data.chats[m.chat]; const mentionsString = [m.sender, m.messageStubParameters[0], ...groupAdmins.map((v) => v.id)]; const mentionsContentM = [m.sender, m.messageStubParameters[0]]; - const fkontak2 = {'key': {'participants': '0@s.whatsapp.net', 'remoteJid': 'status@broadcast', 'fromMe': false, 'id': 'Halo'}, 'message': {'contactMessage': {'vcard': `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`}}, 'participant': '0@s.whatsapp.net'}; - + if (chat.detect2 && m.messageStubType == 29) { let txt1 = tradutor.texto1; txt1 += `${tradutor.texto1_1} ${groupName}\n`; txt1 += `${tradutor.tetxo1_2} @${m.messageStubParameters[0].split`@`[0]}\n`; txt1 += `${tradutor.tetxo1_3} @${m.sender.split`@`[0]}`; - await conn.sendMessage(m.chat, {image: img, caption: txt1, mentions: mentionsString}, {quoted: fkontak2}); + await conn.sendMessage(m.chat, {image: img, caption: txt1, mentions: mentionsString}, {quoted: global.fkontak}); } if (chat.detect2 && m.messageStubType == 30) { @@ -40,7 +39,7 @@ export async function before(m, {conn, participants}) { txt2 += `${tradutor.texto2_1} ${groupName}\n`; txt2 += `${tradutor.texto2_2} @${m.messageStubParameters[0].split`@`[0]}\n`; txt2 += `${tradutor.texto2_3} @${m.sender.split`@`[0]}`; - await conn.sendMessage(m.chat, {image: img, caption: txt2, mentions: mentionsString}, {quoted: fkontak2}); + await conn.sendMessage(m.chat, {image: img, caption: txt2, mentions: mentionsString}, {quoted: global.fkontak}); } if (chat.detect2 && m.messageStubType == 27) { @@ -52,7 +51,7 @@ export async function before(m, {conn, participants}) { } else { txt3 += `${tradutor.texto3_4} @${m.messageStubParameters[0].split`@`[0]}\n`; } - await conn.sendMessage(m.chat, {image: img, caption: txt3, mentions: mentionsContentM}, {quoted: fkontak2}); + await conn.sendMessage(m.chat, {image: img, caption: txt3, mentions: mentionsContentM}, {quoted: global.fkontak}); } if (chat.detect2 && m.messageStubType == 28) { @@ -64,7 +63,7 @@ export async function before(m, {conn, participants}) { } else { txt4 += `${tradutor.texto4_4} @${m.messageStubParameters[0].split`@`[0]}\n`; } - await conn.sendMessage(m.chat, {image: {url: pp}, caption: txt4, mentions: mentionsContentM}, {quoted: fkontak2}); + await conn.sendMessage(m.chat, {image: {url: pp}, caption: txt4, mentions: mentionsContentM}, {quoted: global.fkontak}); } if (chat.detect2 && m.messageStubType == 32) { @@ -82,7 +81,7 @@ export async function before(m, {conn, participants}) { } else { txt5 += `${tradutor.texto5_5} @${m.messageStubParameters[0].split`@`[0]}\n`; } - await conn.sendMessage(m.chat, {image: {url: pp}, caption: txt5, mentions: mentionsContentM}, {quoted: fkontak2}); + await conn.sendMessage(m.chat, {image: {url: pp}, caption: txt5, mentions: mentionsContentM}, {quoted: global.fkontak}); } if (chat.detect2 && m.messageStubType == 26) { @@ -96,13 +95,13 @@ export async function before(m, {conn, participants}) { txt6 += `${tradutor.texto6_1} ${groupName}\n`; txt6 += `${tradutor.texto6_2} ${'```' + accion + '```'}\n`; txt6 += `${tradutor.texto6_3} @${m.sender.split`@`[0]}`; - await conn.sendMessage(m.chat, {image: {url: pp}, caption: txt6, mentions: mentionsContentM}, {quoted: fkontak2}); + await conn.sendMessage(m.chat, {image: {url: pp}, caption: txt6, mentions: mentionsContentM}, {quoted: global.fkontak}); } if (chat.detect2 && m.messageStubType == 21) { let txt7 = tradutor.texto7; txt7 += `${tradutor.texto7_1} ${'```' + groupName + '```'}\n`; txt7 += `${tradutor.texto7_2} @${m.sender.split`@`[0]}`; - await conn.sendMessage(m.chat, {image: {url: pp}, caption: txt7, mentions: mentionsContentM}, {quoted: fkontak2}); + await conn.sendMessage(m.chat, {image: {url: pp}, caption: txt7, mentions: mentionsContentM}, {quoted: global.fkontak}); } } /* Cierre del comando */ diff --git a/plugins/menu-animes.js b/plugins/menu-animes.js index 63d8d6fb35..5b602d5d52 100644 --- a/plugins/menu-animes.js +++ b/plugins/menu-animes.js @@ -1,7 +1,8 @@ import fetch from 'node-fetch'; +import { generateMessageTag } from '../handler'; -const handler = async (m, {conn, usedPrefix, usedPrefix: _p, __dirname, text, isPrems}) => { +const handler = async (m, {conn, usedPrefix, usedPrefix: _p}) => { const datas = global const idioma = datas.db.data.users[m.sender].language || global.defaultLenguaje const _translate = JSON.parse(fs.readFileSync(`./src/languages/${idioma}.json`)) @@ -9,22 +10,7 @@ const handler = async (m, {conn, usedPrefix, usedPrefix: _p, __dirname, text, is try { const pp = imagen2; - // let vn = './src/assets/audio/01J673Y3TGCFF1D548242AX68Q.mp3' - const d = new Date(new Date + 3600000); - const locale = 'es'; - const week = d.toLocaleDateString(locale, {weekday: 'long'}); - const date = d.toLocaleDateString(locale, {day: 'numeric', month: 'long', year: 'numeric'}); - const _uptime = process.uptime() * 1000; - const uptime = clockString(_uptime); - const user = global.db.data.users[m.sender]; - const {money, joincount} = global.db.data.users[m.sender]; - const {exp, limit, level, role} = global.db.data.users[m.sender]; - const rtotalreg = Object.values(global.db.data.users).filter((user) => user.registered == true).length; - const more = String.fromCharCode(8206); - const readMore = more.repeat(850); const taguser = '@' + m.sender.split('@s.whatsapp.net')[0]; - const doc = ['pdf', 'zip', 'vnd.openxmlformats-officedocument.presentationml.presentation', 'vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'vnd.openxmlformats-officedocument.wordprocessingml.document']; - const document = doc[Math.floor(Math.random() * doc.length)]; const str = `╭═══〘 ✯✯✯✯✯✯✯✯✯ 〙══╮ ║ ◉— *𝐓𝐡𝐞 𝐌𝐲𝐬𝐭𝐢𝐜 - 𝐁𝐨𝐭* —◉ ║≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡║ @@ -76,13 +62,9 @@ const handler = async (m, {conn, usedPrefix, usedPrefix: _p, __dirname, text, is ┣ ඬ⃟ 🧿 _${usedPrefix}cosplay_ ┗━━━━━━━━━━━━━━━━┛`.trim(); if (m.isGroup) { - // await conn.sendFile(m.chat, vn, './src/assets/audio/01J673Y3TGCFF1D548242AX68Q.mp3', null, m, true, { type: 'audioMessage', ptt: true}) - const fkontak2 = {'key': {'participants': '0@s.whatsapp.net', 'remoteJid': 'status@broadcast', 'fromMe': false, 'id': 'Halo'}, 'message': {'contactMessage': {'vcard': `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`}}, 'participant': '0@s.whatsapp.net'}; - conn.sendMessage(m.chat, {image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net')}, {quoted: fkontak2}); + conn.sendMessage(m.chat, {image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net')}, {quoted: global.fkontak}); } else { - // await conn.sendFile(m.chat, vn, './src/assets/audio/01J673Y3TGCFF1D548242AX68Q.mp3', null, m, true, { type: 'audioMessage', ptt: true}) - const fkontak2 = {'key': {'participants': '0@s.whatsapp.net', 'remoteJid': 'status@broadcast', 'fromMe': false, 'id': 'Halo'}, 'message': {'contactMessage': {'vcard': `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`}}, 'participant': '0@s.whatsapp.net'}; - conn.sendMessage(m.chat, {image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net')}, {quoted: fkontak2}); + conn.sendMessage(m.chat, {image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net')}, {quoted: global.fkontak}); } } catch { conn.reply(m.chat, tradutor.texto1[3], m); diff --git a/plugins/menu-audios.js b/plugins/menu-audios.js index eb6f33a461..a15c9739c0 100644 --- a/plugins/menu-audios.js +++ b/plugins/menu-audios.js @@ -1,9 +1,9 @@ -import fetch from 'node-fetch'; +import { generateMessageTag } from '../handler'; -const handler = async (m, {conn, usedPrefix, usedPrefix: _p, __dirname, text, isPrems}) => { +const handler = async (m, {conn, usedPrefix: _p}) => { const datas = global const idioma = datas.db.data.users[m.sender].language || global.defaultLenguaje const _translate = JSON.parse(fs.readFileSync(`./src/languages/${idioma}.json`)) @@ -11,23 +11,7 @@ const handler = async (m, {conn, usedPrefix, usedPrefix: _p, __dirname, text, is try { const pp = imagen4; - // let vn = './src/assets/audio/01J673Y3TGCFF1D548242AX68Q.mp3' - const img = './src/assets/images/menu/languages/es/menu.png'; - const d = new Date(new Date + 3600000); - const locale = 'es'; - const week = d.toLocaleDateString(locale, {weekday: 'long'}); - const date = d.toLocaleDateString(locale, {day: 'numeric', month: 'long', year: 'numeric'}); - const _uptime = process.uptime() * 1000; - const uptime = clockString(_uptime); - const user = global.db.data.users[m.sender]; - const {money, joincount} = global.db.data.users[m.sender]; - const {exp, limit, level, role} = global.db.data.users[m.sender]; - const rtotalreg = Object.values(global.db.data.users).filter((user) => user.registered == true).length; - const more = String.fromCharCode(8206); - const readMore = more.repeat(850); const taguser = '@' + m.sender.split('@s.whatsapp.net')[0]; - const doc = ['pdf', 'zip', 'vnd.openxmlformats-officedocument.presentationml.presentation', 'vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'vnd.openxmlformats-officedocument.wordprocessingml.document']; - const document = doc[Math.floor(Math.random() * doc.length)]; const str = `╭═══〘 ✯✯✯✯✯✯✯✯✯ 〙══╮ ║ ◉— *𝐓𝐡𝐞 𝐌𝐲𝐬𝐭𝐢𝐜 - 𝐁𝐨𝐭* —◉ ║≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡║ @@ -85,13 +69,9 @@ const handler = async (m, {conn, usedPrefix, usedPrefix: _p, __dirname, text, is ┣ ඬ⃟🔊 _a_ ┗━━━━━━━━━━━━━━━━┛`.trim(); if (m.isGroup) { - // await conn.sendFile(m.chat, vn, './src/assets/audio/01J673Y3TGCFF1D548242AX68Q.mp3', null, m, true, { type: 'audioMessage', ptt: true}) - const fkontak2 = {'key': {'participants': '0@s.whatsapp.net', 'remoteJid': 'status@broadcast', 'fromMe': false, 'id': 'Halo'}, 'message': {'contactMessage': {'vcard': `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`}}, 'participant': '0@s.whatsapp.net'}; - conn.sendMessage(m.chat, {image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net')}, {quoted: fkontak2}); + conn.sendMessage(m.chat, {image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net')}, {quoted: global.fkontak}); } else { - // await conn.sendFile(m.chat, vn, './src/assets/audio/01J673Y3TGCFF1D548242AX68Q.mp3', null, m, true, { type: 'audioMessage', ptt: true}) - const fkontak2 = {'key': {'participants': '0@s.whatsapp.net', 'remoteJid': 'status@broadcast', 'fromMe': false, 'id': 'Halo'}, 'message': {'contactMessage': {'vcard': `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`}}, 'participant': '0@s.whatsapp.net'}; - conn.sendMessage(m.chat, {image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net')}, {quoted: fkontak2}); + conn.sendMessage(m.chat, {image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net')}, {quoted: global.fkontak}); } } catch { conn.reply(m.chat, tradutor.texto2, m); diff --git a/plugins/menu-caja_fuerte.js b/plugins/menu-caja_fuerte.js index ec8aca45dd..0ba9b1852d 100644 --- a/plugins/menu-caja_fuerte.js +++ b/plugins/menu-caja_fuerte.js @@ -1,3 +1,4 @@ +import { generateMessageTag } from "../handler"; const handler = async (m, {conn, usedPrefix}) => { const datas = global @@ -9,7 +10,6 @@ const handler = async (m, {conn, usedPrefix}) => { try { } catch (e) { } finally { - const name = await conn.getName(m.sender); const taguser = '@' + m.sender.split('@s.whatsapp.net')[0]; const str = ` *ミ💖 ${tradutor.texto1[0]} ${taguser} 💖彡* @@ -56,8 +56,7 @@ ${tradutor.texto1[6]} if (m.isGroup) { conn.sendMessage(m.chat, {image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net')}, {quoted: m}); } else { - const fkontak2 = {'key': {'participants': '0@s.whatsapp.net', 'remoteJid': 'status@broadcast', 'fromMe': false, 'id': 'Halo'}, 'message': {'contactMessage': {'vcard': `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`}}, 'participant': '0@s.whatsapp.net'}; - conn.sendMessage(m.chat, {image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net')}, {quoted: fkontak2}); + conn.sendMessage(m.chat, {image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net')}, {quoted: global.fkontak}); } // conn.sendButton(m.chat, str, wm, pp, [['𝙼𝙴𝙽𝚄 𝙿𝚁𝙸𝙽𝙲𝙸𝙿𝙰𝙻', '/menu']], m, { mentions: [m.sender] }) } diff --git a/plugins/menu-labiblia.js b/plugins/menu-labiblia.js index 929e4c9c23..905efb5c6b 100644 --- a/plugins/menu-labiblia.js +++ b/plugins/menu-labiblia.js @@ -10,21 +10,8 @@ if (!db.data.chats[m.chat].modohorny && m.isGroup) throw `${tradutor.texto1[0]} try { const pp = imagen5; const vn = './src/assets/audio/01J673V13NHPW7FA028ZPYC18Q.mp3'; - const d = new Date(new Date + 3600000); - const locale = 'es'; - const week = d.toLocaleDateString(locale, {weekday: 'long'}); - const date = d.toLocaleDateString(locale, {day: 'numeric', month: 'long', year: 'numeric'}); - const _uptime = process.uptime() * 1000; - const uptime = clockString(_uptime); - const user = global.db.data.users[m.sender]; - const {money, joincount} = global.db.data.users[m.sender]; - const {exp, limit, level, role} = global.db.data.users[m.sender]; - const rtotalreg = Object.values(global.db.data.users).filter((user) => user.registered == true).length; - const more = String.fromCharCode(8206); - const readMore = more.repeat(850); const taguser = '@' + m.sender.split('@s.whatsapp.net')[0]; - const doc = ['pdf', 'zip', 'vnd.openxmlformats-officedocument.presentationml.presentation', 'vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'vnd.openxmlformats-officedocument.wordprocessingml.document']; - const document = doc[Math.floor(Math.random() * doc.length)]; + const str = `╭═══〘 ✯✯✯✯✯✯✯✯✯ 〙══╮ ║ ◉— *𝐓𝐡𝐞 𝐌𝐲𝐬𝐭𝐢𝐜 - 𝐁𝐨𝐭* —◉ ║≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡║ @@ -71,8 +58,7 @@ if (!db.data.chats[m.chat].modohorny && m.isGroup) throw `${tradutor.texto1[0]} await conn.sendMessage(m.chat, {image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net')}, {quoted: m}); await conn.sendFile(m.chat, vn, './src/assets/audio/01J673V13NHPW7FA028ZPYC18Q.mp3', null, m, true, {type: 'audioMessage', ptt: true}); } else { - const fkontak2 = {'key': {'participants': '0@s.whatsapp.net', 'remoteJid': 'status@broadcast', 'fromMe': false, 'id': 'Halo'}, 'message': {'contactMessage': {'vcard': `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`}}, 'participant': '0@s.whatsapp.net'}; - await conn.sendMessage(m.chat, {image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net')}, {quoted: fkontak2}); + await conn.sendMessage(m.chat, {image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net')}, {quoted: global.fkontak}); await conn.sendFile(m.chat, vn, './src/assets/audio/01J673V13NHPW7FA028ZPYC18Q.mp3', null, m, true, {type: 'audioMessage', ptt: true}); } } catch { @@ -82,11 +68,4 @@ if (!db.data.chats[m.chat].modohorny && m.isGroup) throw `${tradutor.texto1[0]} handler.command = /^(menulabiblia|labiblia|Labiblia)$/i; handler.exp = 50; handler.fail = null; -export default handler; - -function clockString(ms) { - const h = isNaN(ms) ? '--' : Math.floor(ms / 3600000); - const m = isNaN(ms) ? '--' : Math.floor(ms / 60000) % 60; - const s = isNaN(ms) ? '--' : Math.floor(ms / 1000) % 60; - return [h, m, s].map((v) => v.toString().padStart(2, 0)).join(':'); -} +export default handler; \ No newline at end of file diff --git a/plugins/menus-menu.js b/plugins/menus-menu.js index d66bddf4ed..9a1bf71de0 100644 --- a/plugins/menus-menu.js +++ b/plugins/menus-menu.js @@ -1,4 +1,4 @@ -import fetch from 'node-fetch'; + // Para configurar o idioma, na raiz do projeto altere o arquivo config.json // Para configurar el idioma, en la raíz del proyecto, modifique el archivo config.json. @@ -12,26 +12,14 @@ const handler = async (m, { conn, usedPrefix, usedPrefix: _p, __dirname, text, i 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.menu_menu - // const pp = imagen7; - - // let vn = './src/assets/audio/01J673Y3TGCFF1D548242AX68Q.mp3' - const img = './src/assets/images/menu/languages/es/menu.png'; - const d = new Date(new Date + 3600000); - const locale = 'es-ES'; - const week = d.toLocaleDateString(locale, { weekday: 'long' }); - const date = d.toLocaleDateString(locale, { day: '2-digit', month: '2-digit', year: 'numeric' }); - const _uptime = process.uptime() * 1000; - const uptime = clockString(_uptime); + + const user = global.db.data.users[m.sender]; const { money, joincount } = global.db.data.users[m.sender]; const { exp, limit, level, role } = global.db.data.users[m.sender]; - const rtotalreg = Object.values(global.db.data.users).filter((user) => user.registered == true).length; - const rtotal = Object.entries(global.db.data.users).length || '0' const more = String.fromCharCode(8206); const readMore = more.repeat(850); const taguser = '@' + m.sender.split('@s.whatsapp.net')[0]; - const doc = ['pdf', 'zip', 'vnd.openxmlformats-officedocument.presentationml.presentation', 'vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'vnd.openxmlformats-officedocument.wordprocessingml.document']; - const document = doc[Math.floor(Math.random() * doc.length)]; const str = `${tradutor.texto1[0]} ${tradutor.texto1[1]} ${taguser} @@ -540,9 +528,7 @@ ${tradutor.texto1[9]} ${user.premiumTime > 0 ? '✅' : (isPrems ? '✅' : '❌') // await conn.sendFile(m.chat, vn, './src/assets/audio/01J673Y3TGCFF1D548242AX68Q.mp3', null, m, true, { type: 'audioMessage', ptt: true}) conn.sendMessage(m.chat, { image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net') }, { quoted: m }); } else { - //await conn.sendFile(m.chat, vn, './src/assets/audio/01J673Y3TGCFF1D548242AX68Q.mp3', null, m, true, { type: 'audioMessage', ptt: true}) - const fkontak = { key: { participants:"0@s.whatsapp.net", "remoteJid": "status@broadcast", "fromMe": false, "id": "Halo" }, "message": { "contactMessage": { "vcard": `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD` }}, "participant": "0@s.whatsapp.net" } - conn.sendMessage(m.chat, { image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net') }, { quoted: fkontak }); + conn.sendMessage(m.chat, { image: pp, caption: str.trim(), mentions: [...str.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + '@s.whatsapp.net') }, { quoted: global.fkontak }); } } catch { const datas = global @@ -557,9 +543,4 @@ handler.command = /^(menu|menú|memu|memú|help|info|comandos|allmenu|2help|menu handler.exp = 50; handler.fail = null; export default handler; -function clockString(ms) { - const h = isNaN(ms) ? '--' : Math.floor(ms / 3600000); - const m = isNaN(ms) ? '--' : Math.floor(ms / 60000) % 60; - const s = isNaN(ms) ? '--' : Math.floor(ms / 1000) % 60; - return [h, m, s].map((v) => v.toString().padStart(2, 0)).join(':'); - } + diff --git a/plugins/owner-broadcast.js b/plugins/owner-broadcast.js index 4052b55514..b554e285c0 100644 --- a/plugins/owner-broadcast.js +++ b/plugins/owner-broadcast.js @@ -1,6 +1,5 @@ // codigo adaptado por: https://github.com/GataNina-Li & https://github.com/elrebelde21 -import {randomBytes} from 'crypto'; const handler = async (m, {conn, command, participants, usedPrefix, text}) => { @@ -10,7 +9,6 @@ const handler = async (m, {conn, command, participants, usedPrefix, text}) => { const tradutor = _translate.plugins.owner_broadcast if (!text) return tradutor.texto1; - const fkontak = {'key': {'participants': '0@s.whatsapp.net', 'remoteJid': 'status@broadcast', 'fromMe': false, 'id': 'Halo'}, 'message': {'contactMessage': {'vcard': `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${conn.user.jid.split('@')[0]}:${conn.user.jid.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`}}, 'participant': '0@s.whatsapp.net'}; const cc4 = text ? m : m.quoted ? await m.getQuotedObj() : false || m; const teks4 = text ? text : cc4.text; const groups2 = Object.keys(await conn.groupFetchAllParticipating()); @@ -23,12 +21,12 @@ const handler = async (m, {conn, command, participants, usedPrefix, text}) => { const group = groups2[i]; const delay = i * 4000; // 4 seg setTimeout(async () => { - await conn.reply(group, tradutor.texto3[0] + teks4, {mentions: usersTag2}, {quoted: fkontak}); + await conn.reply(group, tradutor.texto3[0] + teks4, {mentions: usersTag2}, {quoted: global.fkontak}); }, delay); } for (const user of chats2) { await new Promise((resolve) => setTimeout(resolve, 2000)); // 2 segundos - await conn.reply(user, tradutor.texto3[1] + teks4, fkontak, null); + await conn.reply(user, tradutor.texto3[1] + teks4, global.fkontak, null); totalPri2++; if (totalPri2 >= 500000) { break; @@ -58,29 +56,3 @@ handler.command = /^(comunicar|comunicado|broadcastall|bc)$/i; handler.owner = true; export default handler; -const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); - -const more = String.fromCharCode(8206); -const readMore = more.repeat(4001); - -const randomID = (length) => randomBytes(Math.ceil(length * .5)).toString('hex').slice(0, length); - -/* import fs from 'fs' -let handler = async (m, { conn, text } ) => { -let chatsall = Object.entries(conn.chats).filter(([_, chat]) => chat.isChats).map(v => v[0]) -let cc = text ? m : m.quoted ? await m.getQuotedObj() : false || m -let teks = text ? text : cc.text -for (let id of chatsall) { conn.sendButton(id, `*╔══❰ 𝐂𝐎𝐌𝐔𝐍𝐈𝐂𝐀𝐃𝐎 ❱══╗*\n*║*\n*╠❧* ${text}\n*║*\n*╚══════════════╝*`, '𝙀𝙎𝙏𝙀 𝙀𝙎 𝙐𝙉 𝘾𝙊𝙈𝙐𝙉𝙄𝘾𝘼𝘿𝙊 𝙊𝙁𝙄𝘾𝙄𝘼𝙇\n' + wm, fs.readFileSync('./src/avatar_contact.png'), [['🤖 𝙾𝚆𝙽𝙴𝚁 🤖', '.owner'],['💎 𝙳𝙾𝙽𝙰𝚁 💎', '.donasi']], false, { -contextInfo: { externalAdReply: { -title: 'ᴄᴏᴍᴜɴɪᴄᴀᴅᴏ ᴏғɪᴄɪᴀʟ ᴀ ᴛᴏᴅᴏs ʟᴏs ᴄʜᴀᴛs', -body: 'ʙʏ ᴛʜᴇ ᴍʏsᴛɪᴄ ﹣ ʙᴏᴛ', -sourceUrl: `https://github.com/BrunoSobrino/TheMystic-Bot-MD`, -thumbnail: fs.readFileSync('./src/assets/images/menu/languages/es/menu.png') }}})} -} -m.reply(`*[❗𝐈𝐍𝐅𝐎❗] 𝙼𝙴𝙽𝚂𝙰𝙹𝙴 𝙴𝙽𝚅𝙸𝙰𝙳𝙾 𝙰 𝚃𝙾𝙳𝙾𝚂 𝙻𝙾𝚂 𝙲𝙷𝙰𝚃𝚂*\n\n*𝐍𝐎𝐓𝐀: 𝙴𝚂 𝙿𝙾𝚂𝙸𝙱𝙻𝙴 𝚀𝚄𝙴 𝚃𝙴𝙽𝙶𝙰 𝙵𝙰𝙻𝙻𝙾𝚂 𝙴𝚂𝚃𝙴 𝙲𝙾𝙼𝙰𝙽𝙳𝙾 𝚈 𝙽𝙾 𝚂𝙴 𝙴𝙽𝚅𝙸𝙴 𝙰 𝚃𝙾𝙳𝙾𝚂 𝙻𝙾𝚂 𝙲𝙷𝙰𝚃𝚂, 𝙳𝙸𝚂𝙲𝚄𝙻𝙿𝙴 𝙿𝙾𝚁 𝙴𝙻 𝙼𝙾𝙼𝙴𝙽𝚃𝙾*`) -} -handler.help = ['broadcast', 'bc'].map(v => v + ' ') -handler.tags = ['owner'] -handler.command = /^(broadcast|bc)$/i -handler.rowner = true -export default handler*/ diff --git a/plugins/rpg-cofre.js b/plugins/rpg-cofre.js index cdcbeeb99e..d43c9001a9 100644 --- a/plugins/rpg-cofre.js +++ b/plugins/rpg-cofre.js @@ -29,23 +29,8 @@ ${tradutor.texto2[2]} ║➢ *${expp} ${tradutor.texto2[6]} ${tradutor.texto2[7]}`; - const fkontak = { - 'key': { - 'participants': '0@s.whatsapp.net', - 'remoteJid': 'status@broadcast', - 'fromMe': false, - 'id': 'Halo', - }, - 'message': { - 'contactMessage': { - 'vcard': `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`, - }, - }, - 'participant': '0@s.whatsapp.net', - }; - await conn.sendFile(m.chat, img, 'mystic.jpg', texto, fkontak); - // await conn.sendButton(m.chat, texto, wm, img, [['🔰 𝙼𝙴𝙽𝚄', '/menu'] ], fkontak, m) + await conn.sendFile(m.chat, img, 'mystic.jpg', texto, global.fkontak); global.db.data.users[m.sender].lastcofre = new Date * 1; }; handler.help = ['daily']; diff --git a/plugins/rpg-daily.js b/plugins/rpg-daily.js index 9f89858035..fa5d2fdb84 100644 --- a/plugins/rpg-daily.js +++ b/plugins/rpg-daily.js @@ -1,4 +1,3 @@ -import fetch from 'node-fetch'; const handler = async (m, {isPrems, conn}) => { @@ -7,9 +6,7 @@ const handler = async (m, {isPrems, conn}) => { const _translate = JSON.parse(fs.readFileSync(`./src/languages/${idioma}.json`)) const tradutor = _translate.plugins.rpg_daily - const fkontak = m //{'key': {'participants': '0@s.whatsapp.net', 'remoteJid': 'status@broadcast', 'fromMe': false, 'id': 'Halo'}, 'message': {'contactMessage': {'vcard': `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`}}, 'participant': '0@s.whatsapp.net'}; - const mystic = './src/assets/images/menu/languages/es/menu.png'; - const dos = [md]; + const user = global.db.data.users[m.sender]; const premium = user.premium; @@ -43,8 +40,7 @@ const handler = async (m, {isPrems, conn}) => { }; const time = user.lastclaim + 7200000; // 2 Horas 7200000 - if (new Date - user.lastclaim < 7200000) return await conn.reply(m.chat, `${tradutor.texto1[0]} *${msToTime(time - new Date())}* ${tradutor.texto1[1]}`, fkontak, m); - // await conn.sendButton(m.chat, `𝙔𝘼 𝙍𝙀𝘾𝙇𝘼𝙈𝘼𝙎𝙏𝙀 𝙏𝙐 𝙍𝙀𝙂𝘼𝙇𝙊 🎁\n𝙑𝙐𝙀𝙇𝙑𝙀 𝙀𝙉 *${msToTime(time - new Date())}* 𝙋𝘼𝙍𝘼 𝙑𝙊𝙇𝙑𝙀𝙍 𝘼 𝙍𝙀𝘾𝙇𝘼𝙈𝘼𝙍`, wm, null, [['𝗠 𝗘 𝗡 𝗨 ☘️', '/menu']], fkontak, m) + if (new Date - user.lastclaim < 7200000) return await conn.reply(m.chat, `${tradutor.texto1[0]} *${msToTime(time - new Date())}* ${tradutor.texto1[1]}`, global.fkontak, m); let texto = ''; for (const reward of Object.keys(recompensas)) { if (!(reward in user)) continue; @@ -57,7 +53,7 @@ ${tradutor.texto3[1]} ┃ ${texto} ${tradutor.texto3[4]} ${premium ? '✅' : '❌'}\n${wm}`; const img = './src/assets/images/menu/languages/es/menu.png'; - await conn.sendFile(m.chat, img, 'mystic.jpg', text, fkontak); + await conn.sendFile(m.chat, img, 'mystic.jpg', text, global.fkontak); // await conn.sendButton(m.chat, text, texto + `\n\n🎟️ 𝗣 𝗥 𝗘 𝗠 𝗜 𝗨 𝗠 ⇢ ${premium ? '✅' : '❌'}\n${wm}`, img, [['⛰️ 𝘼𝘽𝙍𝙄𝙍 𝘾𝙊𝙁𝙍𝙀 | 𝘾𝙊𝙁𝙁𝙀𝙍 ⛰️', '/cofre'], ['𝙑𝙤𝙡𝙫𝙚𝙧 𝙖𝙡 𝙈𝙚𝙣𝙪́ | 𝘽𝙖𝙘𝙠 𝙩𝙤 𝙈𝙚𝙣𝙪 ☘️', '/menu']], m, dos.getRandom()) user.lastclaim = new Date * 1; }; diff --git a/protoDB/database/db.proto b/protoDB/database/db.proto new file mode 100644 index 0000000000..f7f8e96eca --- /dev/null +++ b/protoDB/database/db.proto @@ -0,0 +1,90 @@ +syntax = "proto3"; + +message User { + int32 afk = 1; + string afkReason = 2; + int32 age = 4; + int32 wait = 5; + int32 agility = 6; + int32 bowDurability = 7; + int32 armor = 8; + int32 armorDurability = 9; + bool autolevelup = 10; + int32 lastadventure = 11; + string role = 12; + string language = 13; + int32 exp = 14; + int32 money = 15; + int32 joincount = 16; + int32 wood = 17; + int32 rock = 18; + int32 string = 19; + int32 common = 20; + int32 uncommon = 21; + int32 mythic = 22; + int32 legendary = 23; + int32 pet = 24; + int32 level = 25; + int32 premiumTime = 26; + bool premium = 27; + int32 diamond = 28; + int32 limit = 29; + int32 lastMining = 30; + int32 potion = 31; + int32 health = 32; +} + +message Chat { + bool isBanned = 1; + bool welcome = 2; + bool banchat = 3; + bool detect = 4; + bool detect2 = 5; + string sWelcome = 6; + string sBye = 7; + string sPromote = 8; + string sDemote = 9; + bool antidelete = 10; + bool modohorny = 11; + bool autosticker = 12; + bool audios = 13; + bool antiLink2 = 14; + bool antiviewonce = 15; + bool antiToxic = 16; + bool antiTraba = 17; + bool modoadmin = 18; + bool antiArab = 19; + bool antiArab2 = 20; + bool antiporno = 21; + bool simi = 22; + bool game = 23; + int32 expired = 24; + string language = 25; +} +message Settings { + bool self = 1; + bool autoread = 2; + bool autoread2 = 3; + bool restrict = 4; + bool antiCall = 5; + bool antiPrivate = 6; + bool modejadibot = 7; + bool antispam = 8; + bool audiosBot = 9; + bool modoia = 10; +} + +message Sticker { + string text = 1; + string mentionedJid = 2; + string creator = 3; + bool locked = 4; + int32 at = 5; +} + +message Database { + map users = 1; + map chats = 2; + map settings = 3; + map stickers = 4; +} diff --git a/protoDB/database/index.d.ts b/protoDB/database/index.d.ts new file mode 100644 index 0000000000..ce63a56fa3 --- /dev/null +++ b/protoDB/database/index.d.ts @@ -0,0 +1,906 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +/** Properties of a User. */ +export interface IUser { + + /** User afk */ + afk?: (number|null); + + /** User afkReason */ + afkReason?: (string|null); + + /** User age */ + age?: (number|null); + + /** User wait */ + wait?: (number|null); + + /** User agility */ + agility?: (number|null); + + /** User bowDurability */ + bowDurability?: (number|null); + + /** User armor */ + armor?: (number|null); + + /** User armorDurability */ + armorDurability?: (number|null); + + /** User autolevelup */ + autolevelup?: (boolean|null); + + /** User lastadventure */ + lastadventure?: (number|null); + + /** User role */ + role?: (string|null); + + /** User language */ + language?: (string|null); + + /** User exp */ + exp?: (number|null); + + /** User money */ + money?: (number|null); + + /** User joincount */ + joincount?: (number|null); + + /** User wood */ + wood?: (number|null); + + /** User rock */ + rock?: (number|null); + + /** User string */ + string?: (number|null); + + /** User common */ + common?: (number|null); + + /** User uncommon */ + uncommon?: (number|null); + + /** User mythic */ + mythic?: (number|null); + + /** User legendary */ + legendary?: (number|null); + + /** User pet */ + pet?: (number|null); + + /** User level */ + level?: (number|null); + + /** User premiumTime */ + premiumTime?: (number|null); + + /** User premium */ + premium?: (boolean|null); + + /** User diamond */ + diamond?: (number|null); + + /** User limit */ + limit?: (number|null); + + /** User lastMining */ + lastMining?: (number|null); + + /** User potion */ + potion?: (number|null); + + /** User health */ + health?: (number|null); +} + +/** Represents a User. */ +export class User implements IUser { + + /** + * Constructs a new User. + * @param [properties] Properties to set + */ + constructor(properties?: IUser); + + /** User afk. */ + public afk: number; + + /** User afkReason. */ + public afkReason: string; + + /** User age. */ + public age: number; + + /** User wait. */ + public wait: number; + + /** User agility. */ + public agility: number; + + /** User bowDurability. */ + public bowDurability: number; + + /** User armor. */ + public armor: number; + + /** User armorDurability. */ + public armorDurability: number; + + /** User autolevelup. */ + public autolevelup: boolean; + + /** User lastadventure. */ + public lastadventure: number; + + /** User role. */ + public role: string; + + /** User language. */ + public language: string; + + /** User exp. */ + public exp: number; + + /** User money. */ + public money: number; + + /** User joincount. */ + public joincount: number; + + /** User wood. */ + public wood: number; + + /** User rock. */ + public rock: number; + + /** User string. */ + public string: number; + + /** User common. */ + public common: number; + + /** User uncommon. */ + public uncommon: number; + + /** User mythic. */ + public mythic: number; + + /** User legendary. */ + public legendary: number; + + /** User pet. */ + public pet: number; + + /** User level. */ + public level: number; + + /** User premiumTime. */ + public premiumTime: number; + + /** User premium. */ + public premium: boolean; + + /** User diamond. */ + public diamond: number; + + /** User limit. */ + public limit: number; + + /** User lastMining. */ + public lastMining: number; + + /** User potion. */ + public potion: number; + + /** User health. */ + public health: number; + + /** + * Creates a new User instance using the specified properties. + * @param [properties] Properties to set + * @returns User instance + */ + public static create(properties?: IUser): User; + + /** + * Encodes the specified User message. Does not implicitly {@link User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a User message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): User; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): User; + + /** + * Verifies a User message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns User + */ + public static fromObject(object: { [k: string]: any }): User; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @param message User + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: User, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this User to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for User + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; +} + +/** Properties of a Chat. */ +export interface IChat { + + /** Chat isBanned */ + isBanned?: (boolean|null); + + /** Chat welcome */ + welcome?: (boolean|null); + + /** Chat banchat */ + banchat?: (boolean|null); + + /** Chat detect */ + detect?: (boolean|null); + + /** Chat detect2 */ + detect2?: (boolean|null); + + /** Chat sWelcome */ + sWelcome?: (string|null); + + /** Chat sBye */ + sBye?: (string|null); + + /** Chat sPromote */ + sPromote?: (string|null); + + /** Chat sDemote */ + sDemote?: (string|null); + + /** Chat antidelete */ + antidelete?: (boolean|null); + + /** Chat modohorny */ + modohorny?: (boolean|null); + + /** Chat autosticker */ + autosticker?: (boolean|null); + + /** Chat audios */ + audios?: (boolean|null); + + /** Chat antiLink2 */ + antiLink2?: (boolean|null); + + /** Chat antiviewonce */ + antiviewonce?: (boolean|null); + + /** Chat antiToxic */ + antiToxic?: (boolean|null); + + /** Chat antiTraba */ + antiTraba?: (boolean|null); + + /** Chat modoadmin */ + modoadmin?: (boolean|null); + + /** Chat antiArab */ + antiArab?: (boolean|null); + + /** Chat antiArab2 */ + antiArab2?: (boolean|null); + + /** Chat antiporno */ + antiporno?: (boolean|null); + + /** Chat simi */ + simi?: (boolean|null); + + /** Chat game */ + game?: (boolean|null); + + /** Chat expired */ + expired?: (number|null); + + /** Chat language */ + language?: (string|null); +} + +/** Represents a Chat. */ +export class Chat implements IChat { + + /** + * Constructs a new Chat. + * @param [properties] Properties to set + */ + constructor(properties?: IChat); + + /** Chat isBanned. */ + public isBanned: boolean; + + /** Chat welcome. */ + public welcome: boolean; + + /** Chat banchat. */ + public banchat: boolean; + + /** Chat detect. */ + public detect: boolean; + + /** Chat detect2. */ + public detect2: boolean; + + /** Chat sWelcome. */ + public sWelcome: string; + + /** Chat sBye. */ + public sBye: string; + + /** Chat sPromote. */ + public sPromote: string; + + /** Chat sDemote. */ + public sDemote: string; + + /** Chat antidelete. */ + public antidelete: boolean; + + /** Chat modohorny. */ + public modohorny: boolean; + + /** Chat autosticker. */ + public autosticker: boolean; + + /** Chat audios. */ + public audios: boolean; + + /** Chat antiLink2. */ + public antiLink2: boolean; + + /** Chat antiviewonce. */ + public antiviewonce: boolean; + + /** Chat antiToxic. */ + public antiToxic: boolean; + + /** Chat antiTraba. */ + public antiTraba: boolean; + + /** Chat modoadmin. */ + public modoadmin: boolean; + + /** Chat antiArab. */ + public antiArab: boolean; + + /** Chat antiArab2. */ + public antiArab2: boolean; + + /** Chat antiporno. */ + public antiporno: boolean; + + /** Chat simi. */ + public simi: boolean; + + /** Chat game. */ + public game: boolean; + + /** Chat expired. */ + public expired: number; + + /** Chat language. */ + public language: string; + + /** + * Creates a new Chat instance using the specified properties. + * @param [properties] Properties to set + * @returns Chat instance + */ + public static create(properties?: IChat): Chat; + + /** + * Encodes the specified Chat message. Does not implicitly {@link Chat.verify|verify} messages. + * @param message Chat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IChat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Chat message, length delimited. Does not implicitly {@link Chat.verify|verify} messages. + * @param message Chat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IChat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Chat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Chat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Chat; + + /** + * Decodes a Chat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Chat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Chat; + + /** + * Verifies a Chat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Chat message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Chat + */ + public static fromObject(object: { [k: string]: any }): Chat; + + /** + * Creates a plain object from a Chat message. Also converts values to other types if specified. + * @param message Chat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Chat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Chat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Chat + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; +} + +/** Properties of a Settings. */ +export interface ISettings { + + /** Settings self */ + self?: (boolean|null); + + /** Settings autoread */ + autoread?: (boolean|null); + + /** Settings autoread2 */ + autoread2?: (boolean|null); + + /** Settings restrict */ + restrict?: (boolean|null); + + /** Settings antiCall */ + antiCall?: (boolean|null); + + /** Settings antiPrivate */ + antiPrivate?: (boolean|null); + + /** Settings modejadibot */ + modejadibot?: (boolean|null); + + /** Settings antispam */ + antispam?: (boolean|null); + + /** Settings audiosBot */ + audiosBot?: (boolean|null); + + /** Settings modoia */ + modoia?: (boolean|null); +} + +/** Represents a Settings. */ +export class Settings implements ISettings { + + /** + * Constructs a new Settings. + * @param [properties] Properties to set + */ + constructor(properties?: ISettings); + + /** Settings self. */ + public self: boolean; + + /** Settings autoread. */ + public autoread: boolean; + + /** Settings autoread2. */ + public autoread2: boolean; + + /** Settings restrict. */ + public restrict: boolean; + + /** Settings antiCall. */ + public antiCall: boolean; + + /** Settings antiPrivate. */ + public antiPrivate: boolean; + + /** Settings modejadibot. */ + public modejadibot: boolean; + + /** Settings antispam. */ + public antispam: boolean; + + /** Settings audiosBot. */ + public audiosBot: boolean; + + /** Settings modoia. */ + public modoia: boolean; + + /** + * Creates a new Settings instance using the specified properties. + * @param [properties] Properties to set + * @returns Settings instance + */ + public static create(properties?: ISettings): Settings; + + /** + * Encodes the specified Settings message. Does not implicitly {@link Settings.verify|verify} messages. + * @param message Settings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: ISettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Settings message, length delimited. Does not implicitly {@link Settings.verify|verify} messages. + * @param message Settings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: ISettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Settings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Settings; + + /** + * Decodes a Settings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Settings; + + /** + * Verifies a Settings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Settings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Settings + */ + public static fromObject(object: { [k: string]: any }): Settings; + + /** + * Creates a plain object from a Settings message. Also converts values to other types if specified. + * @param message Settings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Settings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Settings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Settings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; +} + +/** Properties of a Sticker. */ +export interface ISticker { + + /** Sticker text */ + text?: (string|null); + + /** Sticker mentionedJid */ + mentionedJid?: (string|null); + + /** Sticker creator */ + creator?: (string|null); + + /** Sticker locked */ + locked?: (boolean|null); + + /** Sticker at */ + at?: (number|null); +} + +/** Represents a Sticker. */ +export class Sticker implements ISticker { + + /** + * Constructs a new Sticker. + * @param [properties] Properties to set + */ + constructor(properties?: ISticker); + + /** Sticker text. */ + public text: string; + + /** Sticker mentionedJid. */ + public mentionedJid: string; + + /** Sticker creator. */ + public creator: string; + + /** Sticker locked. */ + public locked: boolean; + + /** Sticker at. */ + public at: number; + + /** + * Creates a new Sticker instance using the specified properties. + * @param [properties] Properties to set + * @returns Sticker instance + */ + public static create(properties?: ISticker): Sticker; + + /** + * Encodes the specified Sticker message. Does not implicitly {@link Sticker.verify|verify} messages. + * @param message Sticker message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: ISticker, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Sticker message, length delimited. Does not implicitly {@link Sticker.verify|verify} messages. + * @param message Sticker message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: ISticker, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Sticker message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Sticker + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Sticker; + + /** + * Decodes a Sticker message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Sticker + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Sticker; + + /** + * Verifies a Sticker message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Sticker message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Sticker + */ + public static fromObject(object: { [k: string]: any }): Sticker; + + /** + * Creates a plain object from a Sticker message. Also converts values to other types if specified. + * @param message Sticker + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Sticker, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Sticker to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Sticker + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; +} + +/** Properties of a Database. */ +export interface IDatabase { + + /** Database users */ + users?: ({ [k: string]: IUser }|null); + + /** Database chats */ + chats?: ({ [k: string]: IChat }|null); + + /** Database settings */ + settings?: ({ [k: string]: ISettings }|null); + + /** Database stickers */ + stickers?: ({ [k: string]: ISticker }|null); +} + +/** Represents a Database. */ +export class Database implements IDatabase { + + /** + * Constructs a new Database. + * @param [properties] Properties to set + */ + constructor(properties?: IDatabase); + + /** Database users. */ + public users: { [k: string]: IUser }; + + /** Database chats. */ + public chats: { [k: string]: IChat }; + + /** Database settings. */ + public settings: { [k: string]: ISettings }; + + /** Database stickers. */ + public stickers: { [k: string]: ISticker }; + + /** + * Creates a new Database instance using the specified properties. + * @param [properties] Properties to set + * @returns Database instance + */ + public static create(properties?: IDatabase): Database; + + /** + * Encodes the specified Database message. Does not implicitly {@link Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Database message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Database; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Database; + + /** + * Verifies a Database message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Database + */ + public static fromObject(object: { [k: string]: any }): Database; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @param message Database + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Database, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Database to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Database + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; +} diff --git a/protoDB/database/index.js b/protoDB/database/index.js new file mode 100644 index 0000000000..170752a835 --- /dev/null +++ b/protoDB/database/index.js @@ -0,0 +1,2807 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +"use strict"; + +var $protobuf = require("protobufjs/minimal"); + +// Common aliases +var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + +$root.User = (function() { + + /** + * Properties of a User. + * @exports IUser + * @interface IUser + * @property {number|null} [afk] User afk + * @property {string|null} [afkReason] User afkReason + * @property {number|null} [age] User age + * @property {number|null} [wait] User wait + * @property {number|null} [agility] User agility + * @property {number|null} [bowDurability] User bowDurability + * @property {number|null} [armor] User armor + * @property {number|null} [armorDurability] User armorDurability + * @property {boolean|null} [autolevelup] User autolevelup + * @property {number|null} [lastadventure] User lastadventure + * @property {string|null} [role] User role + * @property {string|null} [language] User language + * @property {number|null} [exp] User exp + * @property {number|null} [money] User money + * @property {number|null} [joincount] User joincount + * @property {number|null} [wood] User wood + * @property {number|null} [rock] User rock + * @property {number|null} [string] User string + * @property {number|null} [common] User common + * @property {number|null} [uncommon] User uncommon + * @property {number|null} [mythic] User mythic + * @property {number|null} [legendary] User legendary + * @property {number|null} [pet] User pet + * @property {number|null} [level] User level + * @property {number|null} [premiumTime] User premiumTime + * @property {boolean|null} [premium] User premium + * @property {number|null} [diamond] User diamond + * @property {number|null} [limit] User limit + * @property {number|null} [lastMining] User lastMining + * @property {number|null} [potion] User potion + * @property {number|null} [health] User health + */ + + /** + * Constructs a new User. + * @exports User + * @classdesc Represents a User. + * @implements IUser + * @constructor + * @param {IUser=} [properties] Properties to set + */ + function User(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * User afk. + * @member {number} afk + * @memberof User + * @instance + */ + User.prototype.afk = 0; + + /** + * User afkReason. + * @member {string} afkReason + * @memberof User + * @instance + */ + User.prototype.afkReason = ""; + + /** + * User age. + * @member {number} age + * @memberof User + * @instance + */ + User.prototype.age = 0; + + /** + * User wait. + * @member {number} wait + * @memberof User + * @instance + */ + User.prototype.wait = 0; + + /** + * User agility. + * @member {number} agility + * @memberof User + * @instance + */ + User.prototype.agility = 0; + + /** + * User bowDurability. + * @member {number} bowDurability + * @memberof User + * @instance + */ + User.prototype.bowDurability = 0; + + /** + * User armor. + * @member {number} armor + * @memberof User + * @instance + */ + User.prototype.armor = 0; + + /** + * User armorDurability. + * @member {number} armorDurability + * @memberof User + * @instance + */ + User.prototype.armorDurability = 0; + + /** + * User autolevelup. + * @member {boolean} autolevelup + * @memberof User + * @instance + */ + User.prototype.autolevelup = false; + + /** + * User lastadventure. + * @member {number} lastadventure + * @memberof User + * @instance + */ + User.prototype.lastadventure = 0; + + /** + * User role. + * @member {string} role + * @memberof User + * @instance + */ + User.prototype.role = ""; + + /** + * User language. + * @member {string} language + * @memberof User + * @instance + */ + User.prototype.language = ""; + + /** + * User exp. + * @member {number} exp + * @memberof User + * @instance + */ + User.prototype.exp = 0; + + /** + * User money. + * @member {number} money + * @memberof User + * @instance + */ + User.prototype.money = 0; + + /** + * User joincount. + * @member {number} joincount + * @memberof User + * @instance + */ + User.prototype.joincount = 0; + + /** + * User wood. + * @member {number} wood + * @memberof User + * @instance + */ + User.prototype.wood = 0; + + /** + * User rock. + * @member {number} rock + * @memberof User + * @instance + */ + User.prototype.rock = 0; + + /** + * User string. + * @member {number} string + * @memberof User + * @instance + */ + User.prototype.string = 0; + + /** + * User common. + * @member {number} common + * @memberof User + * @instance + */ + User.prototype.common = 0; + + /** + * User uncommon. + * @member {number} uncommon + * @memberof User + * @instance + */ + User.prototype.uncommon = 0; + + /** + * User mythic. + * @member {number} mythic + * @memberof User + * @instance + */ + User.prototype.mythic = 0; + + /** + * User legendary. + * @member {number} legendary + * @memberof User + * @instance + */ + User.prototype.legendary = 0; + + /** + * User pet. + * @member {number} pet + * @memberof User + * @instance + */ + User.prototype.pet = 0; + + /** + * User level. + * @member {number} level + * @memberof User + * @instance + */ + User.prototype.level = 0; + + /** + * User premiumTime. + * @member {number} premiumTime + * @memberof User + * @instance + */ + User.prototype.premiumTime = 0; + + /** + * User premium. + * @member {boolean} premium + * @memberof User + * @instance + */ + User.prototype.premium = false; + + /** + * User diamond. + * @member {number} diamond + * @memberof User + * @instance + */ + User.prototype.diamond = 0; + + /** + * User limit. + * @member {number} limit + * @memberof User + * @instance + */ + User.prototype.limit = 0; + + /** + * User lastMining. + * @member {number} lastMining + * @memberof User + * @instance + */ + User.prototype.lastMining = 0; + + /** + * User potion. + * @member {number} potion + * @memberof User + * @instance + */ + User.prototype.potion = 0; + + /** + * User health. + * @member {number} health + * @memberof User + * @instance + */ + User.prototype.health = 0; + + /** + * Creates a new User instance using the specified properties. + * @function create + * @memberof User + * @static + * @param {IUser=} [properties] Properties to set + * @returns {User} User instance + */ + User.create = function create(properties) { + return new User(properties); + }; + + /** + * Encodes the specified User message. Does not implicitly {@link User.verify|verify} messages. + * @function encode + * @memberof User + * @static + * @param {IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.afk != null && Object.hasOwnProperty.call(message, "afk")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.afk); + if (message.afkReason != null && Object.hasOwnProperty.call(message, "afkReason")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.afkReason); + if (message.age != null && Object.hasOwnProperty.call(message, "age")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.age); + if (message.wait != null && Object.hasOwnProperty.call(message, "wait")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.wait); + if (message.agility != null && Object.hasOwnProperty.call(message, "agility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.agility); + if (message.bowDurability != null && Object.hasOwnProperty.call(message, "bowDurability")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.bowDurability); + if (message.armor != null && Object.hasOwnProperty.call(message, "armor")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.armor); + if (message.armorDurability != null && Object.hasOwnProperty.call(message, "armorDurability")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.armorDurability); + if (message.autolevelup != null && Object.hasOwnProperty.call(message, "autolevelup")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.autolevelup); + if (message.lastadventure != null && Object.hasOwnProperty.call(message, "lastadventure")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.lastadventure); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.role); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.language); + if (message.exp != null && Object.hasOwnProperty.call(message, "exp")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.exp); + if (message.money != null && Object.hasOwnProperty.call(message, "money")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.money); + if (message.joincount != null && Object.hasOwnProperty.call(message, "joincount")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.joincount); + if (message.wood != null && Object.hasOwnProperty.call(message, "wood")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.wood); + if (message.rock != null && Object.hasOwnProperty.call(message, "rock")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.rock); + if (message.string != null && Object.hasOwnProperty.call(message, "string")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.string); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.common); + if (message.uncommon != null && Object.hasOwnProperty.call(message, "uncommon")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.uncommon); + if (message.mythic != null && Object.hasOwnProperty.call(message, "mythic")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.mythic); + if (message.legendary != null && Object.hasOwnProperty.call(message, "legendary")) + writer.uint32(/* id 23, wireType 0 =*/184).int32(message.legendary); + if (message.pet != null && Object.hasOwnProperty.call(message, "pet")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.pet); + if (message.level != null && Object.hasOwnProperty.call(message, "level")) + writer.uint32(/* id 25, wireType 0 =*/200).int32(message.level); + if (message.premiumTime != null && Object.hasOwnProperty.call(message, "premiumTime")) + writer.uint32(/* id 26, wireType 0 =*/208).int32(message.premiumTime); + if (message.premium != null && Object.hasOwnProperty.call(message, "premium")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.premium); + if (message.diamond != null && Object.hasOwnProperty.call(message, "diamond")) + writer.uint32(/* id 28, wireType 0 =*/224).int32(message.diamond); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 29, wireType 0 =*/232).int32(message.limit); + if (message.lastMining != null && Object.hasOwnProperty.call(message, "lastMining")) + writer.uint32(/* id 30, wireType 0 =*/240).int32(message.lastMining); + if (message.potion != null && Object.hasOwnProperty.call(message, "potion")) + writer.uint32(/* id 31, wireType 0 =*/248).int32(message.potion); + if (message.health != null && Object.hasOwnProperty.call(message, "health")) + writer.uint32(/* id 32, wireType 0 =*/256).int32(message.health); + return writer; + }; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link User.verify|verify} messages. + * @function encodeDelimited + * @memberof User + * @static + * @param {IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a User message from the specified reader or buffer. + * @function decode + * @memberof User + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.User(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.afk = reader.int32(); + break; + } + case 2: { + message.afkReason = reader.string(); + break; + } + case 4: { + message.age = reader.int32(); + break; + } + case 5: { + message.wait = reader.int32(); + break; + } + case 6: { + message.agility = reader.int32(); + break; + } + case 7: { + message.bowDurability = reader.int32(); + break; + } + case 8: { + message.armor = reader.int32(); + break; + } + case 9: { + message.armorDurability = reader.int32(); + break; + } + case 10: { + message.autolevelup = reader.bool(); + break; + } + case 11: { + message.lastadventure = reader.int32(); + break; + } + case 12: { + message.role = reader.string(); + break; + } + case 13: { + message.language = reader.string(); + break; + } + case 14: { + message.exp = reader.int32(); + break; + } + case 15: { + message.money = reader.int32(); + break; + } + case 16: { + message.joincount = reader.int32(); + break; + } + case 17: { + message.wood = reader.int32(); + break; + } + case 18: { + message.rock = reader.int32(); + break; + } + case 19: { + message.string = reader.int32(); + break; + } + case 20: { + message.common = reader.int32(); + break; + } + case 21: { + message.uncommon = reader.int32(); + break; + } + case 22: { + message.mythic = reader.int32(); + break; + } + case 23: { + message.legendary = reader.int32(); + break; + } + case 24: { + message.pet = reader.int32(); + break; + } + case 25: { + message.level = reader.int32(); + break; + } + case 26: { + message.premiumTime = reader.int32(); + break; + } + case 27: { + message.premium = reader.bool(); + break; + } + case 28: { + message.diamond = reader.int32(); + break; + } + case 29: { + message.limit = reader.int32(); + break; + } + case 30: { + message.lastMining = reader.int32(); + break; + } + case 31: { + message.potion = reader.int32(); + break; + } + case 32: { + message.health = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof User + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a User message. + * @function verify + * @memberof User + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + User.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.afk != null && message.hasOwnProperty("afk")) + if (!$util.isInteger(message.afk)) + return "afk: integer expected"; + if (message.afkReason != null && message.hasOwnProperty("afkReason")) + if (!$util.isString(message.afkReason)) + return "afkReason: string expected"; + if (message.age != null && message.hasOwnProperty("age")) + if (!$util.isInteger(message.age)) + return "age: integer expected"; + if (message.wait != null && message.hasOwnProperty("wait")) + if (!$util.isInteger(message.wait)) + return "wait: integer expected"; + if (message.agility != null && message.hasOwnProperty("agility")) + if (!$util.isInteger(message.agility)) + return "agility: integer expected"; + if (message.bowDurability != null && message.hasOwnProperty("bowDurability")) + if (!$util.isInteger(message.bowDurability)) + return "bowDurability: integer expected"; + if (message.armor != null && message.hasOwnProperty("armor")) + if (!$util.isInteger(message.armor)) + return "armor: integer expected"; + if (message.armorDurability != null && message.hasOwnProperty("armorDurability")) + if (!$util.isInteger(message.armorDurability)) + return "armorDurability: integer expected"; + if (message.autolevelup != null && message.hasOwnProperty("autolevelup")) + if (typeof message.autolevelup !== "boolean") + return "autolevelup: boolean expected"; + if (message.lastadventure != null && message.hasOwnProperty("lastadventure")) + if (!$util.isInteger(message.lastadventure)) + return "lastadventure: integer expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.language != null && message.hasOwnProperty("language")) + if (!$util.isString(message.language)) + return "language: string expected"; + if (message.exp != null && message.hasOwnProperty("exp")) + if (!$util.isInteger(message.exp)) + return "exp: integer expected"; + if (message.money != null && message.hasOwnProperty("money")) + if (!$util.isInteger(message.money)) + return "money: integer expected"; + if (message.joincount != null && message.hasOwnProperty("joincount")) + if (!$util.isInteger(message.joincount)) + return "joincount: integer expected"; + if (message.wood != null && message.hasOwnProperty("wood")) + if (!$util.isInteger(message.wood)) + return "wood: integer expected"; + if (message.rock != null && message.hasOwnProperty("rock")) + if (!$util.isInteger(message.rock)) + return "rock: integer expected"; + if (message.string != null && message.hasOwnProperty("string")) + if (!$util.isInteger(message.string)) + return "string: integer expected"; + if (message.common != null && message.hasOwnProperty("common")) + if (!$util.isInteger(message.common)) + return "common: integer expected"; + if (message.uncommon != null && message.hasOwnProperty("uncommon")) + if (!$util.isInteger(message.uncommon)) + return "uncommon: integer expected"; + if (message.mythic != null && message.hasOwnProperty("mythic")) + if (!$util.isInteger(message.mythic)) + return "mythic: integer expected"; + if (message.legendary != null && message.hasOwnProperty("legendary")) + if (!$util.isInteger(message.legendary)) + return "legendary: integer expected"; + if (message.pet != null && message.hasOwnProperty("pet")) + if (!$util.isInteger(message.pet)) + return "pet: integer expected"; + if (message.level != null && message.hasOwnProperty("level")) + if (!$util.isInteger(message.level)) + return "level: integer expected"; + if (message.premiumTime != null && message.hasOwnProperty("premiumTime")) + if (!$util.isInteger(message.premiumTime)) + return "premiumTime: integer expected"; + if (message.premium != null && message.hasOwnProperty("premium")) + if (typeof message.premium !== "boolean") + return "premium: boolean expected"; + if (message.diamond != null && message.hasOwnProperty("diamond")) + if (!$util.isInteger(message.diamond)) + return "diamond: integer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.lastMining != null && message.hasOwnProperty("lastMining")) + if (!$util.isInteger(message.lastMining)) + return "lastMining: integer expected"; + if (message.potion != null && message.hasOwnProperty("potion")) + if (!$util.isInteger(message.potion)) + return "potion: integer expected"; + if (message.health != null && message.hasOwnProperty("health")) + if (!$util.isInteger(message.health)) + return "health: integer expected"; + return null; + }; + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof User + * @static + * @param {Object.} object Plain object + * @returns {User} User + */ + User.fromObject = function fromObject(object) { + if (object instanceof $root.User) + return object; + var message = new $root.User(); + if (object.afk != null) + message.afk = object.afk | 0; + if (object.afkReason != null) + message.afkReason = String(object.afkReason); + if (object.age != null) + message.age = object.age | 0; + if (object.wait != null) + message.wait = object.wait | 0; + if (object.agility != null) + message.agility = object.agility | 0; + if (object.bowDurability != null) + message.bowDurability = object.bowDurability | 0; + if (object.armor != null) + message.armor = object.armor | 0; + if (object.armorDurability != null) + message.armorDurability = object.armorDurability | 0; + if (object.autolevelup != null) + message.autolevelup = Boolean(object.autolevelup); + if (object.lastadventure != null) + message.lastadventure = object.lastadventure | 0; + if (object.role != null) + message.role = String(object.role); + if (object.language != null) + message.language = String(object.language); + if (object.exp != null) + message.exp = object.exp | 0; + if (object.money != null) + message.money = object.money | 0; + if (object.joincount != null) + message.joincount = object.joincount | 0; + if (object.wood != null) + message.wood = object.wood | 0; + if (object.rock != null) + message.rock = object.rock | 0; + if (object.string != null) + message.string = object.string | 0; + if (object.common != null) + message.common = object.common | 0; + if (object.uncommon != null) + message.uncommon = object.uncommon | 0; + if (object.mythic != null) + message.mythic = object.mythic | 0; + if (object.legendary != null) + message.legendary = object.legendary | 0; + if (object.pet != null) + message.pet = object.pet | 0; + if (object.level != null) + message.level = object.level | 0; + if (object.premiumTime != null) + message.premiumTime = object.premiumTime | 0; + if (object.premium != null) + message.premium = Boolean(object.premium); + if (object.diamond != null) + message.diamond = object.diamond | 0; + if (object.limit != null) + message.limit = object.limit | 0; + if (object.lastMining != null) + message.lastMining = object.lastMining | 0; + if (object.potion != null) + message.potion = object.potion | 0; + if (object.health != null) + message.health = object.health | 0; + return message; + }; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @function toObject + * @memberof User + * @static + * @param {User} message User + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + User.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.afk = 0; + object.afkReason = ""; + object.age = 0; + object.wait = 0; + object.agility = 0; + object.bowDurability = 0; + object.armor = 0; + object.armorDurability = 0; + object.autolevelup = false; + object.lastadventure = 0; + object.role = ""; + object.language = ""; + object.exp = 0; + object.money = 0; + object.joincount = 0; + object.wood = 0; + object.rock = 0; + object.string = 0; + object.common = 0; + object.uncommon = 0; + object.mythic = 0; + object.legendary = 0; + object.pet = 0; + object.level = 0; + object.premiumTime = 0; + object.premium = false; + object.diamond = 0; + object.limit = 0; + object.lastMining = 0; + object.potion = 0; + object.health = 0; + } + if (message.afk != null && message.hasOwnProperty("afk")) + object.afk = message.afk; + if (message.afkReason != null && message.hasOwnProperty("afkReason")) + object.afkReason = message.afkReason; + if (message.age != null && message.hasOwnProperty("age")) + object.age = message.age; + if (message.wait != null && message.hasOwnProperty("wait")) + object.wait = message.wait; + if (message.agility != null && message.hasOwnProperty("agility")) + object.agility = message.agility; + if (message.bowDurability != null && message.hasOwnProperty("bowDurability")) + object.bowDurability = message.bowDurability; + if (message.armor != null && message.hasOwnProperty("armor")) + object.armor = message.armor; + if (message.armorDurability != null && message.hasOwnProperty("armorDurability")) + object.armorDurability = message.armorDurability; + if (message.autolevelup != null && message.hasOwnProperty("autolevelup")) + object.autolevelup = message.autolevelup; + if (message.lastadventure != null && message.hasOwnProperty("lastadventure")) + object.lastadventure = message.lastadventure; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.language != null && message.hasOwnProperty("language")) + object.language = message.language; + if (message.exp != null && message.hasOwnProperty("exp")) + object.exp = message.exp; + if (message.money != null && message.hasOwnProperty("money")) + object.money = message.money; + if (message.joincount != null && message.hasOwnProperty("joincount")) + object.joincount = message.joincount; + if (message.wood != null && message.hasOwnProperty("wood")) + object.wood = message.wood; + if (message.rock != null && message.hasOwnProperty("rock")) + object.rock = message.rock; + if (message.string != null && message.hasOwnProperty("string")) + object.string = message.string; + if (message.common != null && message.hasOwnProperty("common")) + object.common = message.common; + if (message.uncommon != null && message.hasOwnProperty("uncommon")) + object.uncommon = message.uncommon; + if (message.mythic != null && message.hasOwnProperty("mythic")) + object.mythic = message.mythic; + if (message.legendary != null && message.hasOwnProperty("legendary")) + object.legendary = message.legendary; + if (message.pet != null && message.hasOwnProperty("pet")) + object.pet = message.pet; + if (message.level != null && message.hasOwnProperty("level")) + object.level = message.level; + if (message.premiumTime != null && message.hasOwnProperty("premiumTime")) + object.premiumTime = message.premiumTime; + if (message.premium != null && message.hasOwnProperty("premium")) + object.premium = message.premium; + if (message.diamond != null && message.hasOwnProperty("diamond")) + object.diamond = message.diamond; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.lastMining != null && message.hasOwnProperty("lastMining")) + object.lastMining = message.lastMining; + if (message.potion != null && message.hasOwnProperty("potion")) + object.potion = message.potion; + if (message.health != null && message.hasOwnProperty("health")) + object.health = message.health; + return object; + }; + + /** + * Converts this User to JSON. + * @function toJSON + * @memberof User + * @instance + * @returns {Object.} JSON object + */ + User.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for User + * @function getTypeUrl + * @memberof User + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/User"; + }; + + return User; +})(); + +$root.Chat = (function() { + + /** + * Properties of a Chat. + * @exports IChat + * @interface IChat + * @property {boolean|null} [isBanned] Chat isBanned + * @property {boolean|null} [welcome] Chat welcome + * @property {boolean|null} [banchat] Chat banchat + * @property {boolean|null} [detect] Chat detect + * @property {boolean|null} [detect2] Chat detect2 + * @property {string|null} [sWelcome] Chat sWelcome + * @property {string|null} [sBye] Chat sBye + * @property {string|null} [sPromote] Chat sPromote + * @property {string|null} [sDemote] Chat sDemote + * @property {boolean|null} [antidelete] Chat antidelete + * @property {boolean|null} [modohorny] Chat modohorny + * @property {boolean|null} [autosticker] Chat autosticker + * @property {boolean|null} [audios] Chat audios + * @property {boolean|null} [antiLink2] Chat antiLink2 + * @property {boolean|null} [antiviewonce] Chat antiviewonce + * @property {boolean|null} [antiToxic] Chat antiToxic + * @property {boolean|null} [antiTraba] Chat antiTraba + * @property {boolean|null} [modoadmin] Chat modoadmin + * @property {boolean|null} [antiArab] Chat antiArab + * @property {boolean|null} [antiArab2] Chat antiArab2 + * @property {boolean|null} [antiporno] Chat antiporno + * @property {boolean|null} [simi] Chat simi + * @property {boolean|null} [game] Chat game + * @property {number|null} [expired] Chat expired + * @property {string|null} [language] Chat language + */ + + /** + * Constructs a new Chat. + * @exports Chat + * @classdesc Represents a Chat. + * @implements IChat + * @constructor + * @param {IChat=} [properties] Properties to set + */ + function Chat(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Chat isBanned. + * @member {boolean} isBanned + * @memberof Chat + * @instance + */ + Chat.prototype.isBanned = false; + + /** + * Chat welcome. + * @member {boolean} welcome + * @memberof Chat + * @instance + */ + Chat.prototype.welcome = false; + + /** + * Chat banchat. + * @member {boolean} banchat + * @memberof Chat + * @instance + */ + Chat.prototype.banchat = false; + + /** + * Chat detect. + * @member {boolean} detect + * @memberof Chat + * @instance + */ + Chat.prototype.detect = false; + + /** + * Chat detect2. + * @member {boolean} detect2 + * @memberof Chat + * @instance + */ + Chat.prototype.detect2 = false; + + /** + * Chat sWelcome. + * @member {string} sWelcome + * @memberof Chat + * @instance + */ + Chat.prototype.sWelcome = ""; + + /** + * Chat sBye. + * @member {string} sBye + * @memberof Chat + * @instance + */ + Chat.prototype.sBye = ""; + + /** + * Chat sPromote. + * @member {string} sPromote + * @memberof Chat + * @instance + */ + Chat.prototype.sPromote = ""; + + /** + * Chat sDemote. + * @member {string} sDemote + * @memberof Chat + * @instance + */ + Chat.prototype.sDemote = ""; + + /** + * Chat antidelete. + * @member {boolean} antidelete + * @memberof Chat + * @instance + */ + Chat.prototype.antidelete = false; + + /** + * Chat modohorny. + * @member {boolean} modohorny + * @memberof Chat + * @instance + */ + Chat.prototype.modohorny = false; + + /** + * Chat autosticker. + * @member {boolean} autosticker + * @memberof Chat + * @instance + */ + Chat.prototype.autosticker = false; + + /** + * Chat audios. + * @member {boolean} audios + * @memberof Chat + * @instance + */ + Chat.prototype.audios = false; + + /** + * Chat antiLink2. + * @member {boolean} antiLink2 + * @memberof Chat + * @instance + */ + Chat.prototype.antiLink2 = false; + + /** + * Chat antiviewonce. + * @member {boolean} antiviewonce + * @memberof Chat + * @instance + */ + Chat.prototype.antiviewonce = false; + + /** + * Chat antiToxic. + * @member {boolean} antiToxic + * @memberof Chat + * @instance + */ + Chat.prototype.antiToxic = false; + + /** + * Chat antiTraba. + * @member {boolean} antiTraba + * @memberof Chat + * @instance + */ + Chat.prototype.antiTraba = false; + + /** + * Chat modoadmin. + * @member {boolean} modoadmin + * @memberof Chat + * @instance + */ + Chat.prototype.modoadmin = false; + + /** + * Chat antiArab. + * @member {boolean} antiArab + * @memberof Chat + * @instance + */ + Chat.prototype.antiArab = false; + + /** + * Chat antiArab2. + * @member {boolean} antiArab2 + * @memberof Chat + * @instance + */ + Chat.prototype.antiArab2 = false; + + /** + * Chat antiporno. + * @member {boolean} antiporno + * @memberof Chat + * @instance + */ + Chat.prototype.antiporno = false; + + /** + * Chat simi. + * @member {boolean} simi + * @memberof Chat + * @instance + */ + Chat.prototype.simi = false; + + /** + * Chat game. + * @member {boolean} game + * @memberof Chat + * @instance + */ + Chat.prototype.game = false; + + /** + * Chat expired. + * @member {number} expired + * @memberof Chat + * @instance + */ + Chat.prototype.expired = 0; + + /** + * Chat language. + * @member {string} language + * @memberof Chat + * @instance + */ + Chat.prototype.language = ""; + + /** + * Creates a new Chat instance using the specified properties. + * @function create + * @memberof Chat + * @static + * @param {IChat=} [properties] Properties to set + * @returns {Chat} Chat instance + */ + Chat.create = function create(properties) { + return new Chat(properties); + }; + + /** + * Encodes the specified Chat message. Does not implicitly {@link Chat.verify|verify} messages. + * @function encode + * @memberof Chat + * @static + * @param {IChat} message Chat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.isBanned != null && Object.hasOwnProperty.call(message, "isBanned")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isBanned); + if (message.welcome != null && Object.hasOwnProperty.call(message, "welcome")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.welcome); + if (message.banchat != null && Object.hasOwnProperty.call(message, "banchat")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.banchat); + if (message.detect != null && Object.hasOwnProperty.call(message, "detect")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.detect); + if (message.detect2 != null && Object.hasOwnProperty.call(message, "detect2")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.detect2); + if (message.sWelcome != null && Object.hasOwnProperty.call(message, "sWelcome")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.sWelcome); + if (message.sBye != null && Object.hasOwnProperty.call(message, "sBye")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.sBye); + if (message.sPromote != null && Object.hasOwnProperty.call(message, "sPromote")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.sPromote); + if (message.sDemote != null && Object.hasOwnProperty.call(message, "sDemote")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.sDemote); + if (message.antidelete != null && Object.hasOwnProperty.call(message, "antidelete")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.antidelete); + if (message.modohorny != null && Object.hasOwnProperty.call(message, "modohorny")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.modohorny); + if (message.autosticker != null && Object.hasOwnProperty.call(message, "autosticker")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.autosticker); + if (message.audios != null && Object.hasOwnProperty.call(message, "audios")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.audios); + if (message.antiLink2 != null && Object.hasOwnProperty.call(message, "antiLink2")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.antiLink2); + if (message.antiviewonce != null && Object.hasOwnProperty.call(message, "antiviewonce")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.antiviewonce); + if (message.antiToxic != null && Object.hasOwnProperty.call(message, "antiToxic")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.antiToxic); + if (message.antiTraba != null && Object.hasOwnProperty.call(message, "antiTraba")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.antiTraba); + if (message.modoadmin != null && Object.hasOwnProperty.call(message, "modoadmin")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.modoadmin); + if (message.antiArab != null && Object.hasOwnProperty.call(message, "antiArab")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.antiArab); + if (message.antiArab2 != null && Object.hasOwnProperty.call(message, "antiArab2")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.antiArab2); + if (message.antiporno != null && Object.hasOwnProperty.call(message, "antiporno")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.antiporno); + if (message.simi != null && Object.hasOwnProperty.call(message, "simi")) + writer.uint32(/* id 22, wireType 0 =*/176).bool(message.simi); + if (message.game != null && Object.hasOwnProperty.call(message, "game")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.game); + if (message.expired != null && Object.hasOwnProperty.call(message, "expired")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.expired); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 25, wireType 2 =*/202).string(message.language); + return writer; + }; + + /** + * Encodes the specified Chat message, length delimited. Does not implicitly {@link Chat.verify|verify} messages. + * @function encodeDelimited + * @memberof Chat + * @static + * @param {IChat} message Chat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chat message from the specified reader or buffer. + * @function decode + * @memberof Chat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Chat} Chat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chat.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Chat(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.isBanned = reader.bool(); + break; + } + case 2: { + message.welcome = reader.bool(); + break; + } + case 3: { + message.banchat = reader.bool(); + break; + } + case 4: { + message.detect = reader.bool(); + break; + } + case 5: { + message.detect2 = reader.bool(); + break; + } + case 6: { + message.sWelcome = reader.string(); + break; + } + case 7: { + message.sBye = reader.string(); + break; + } + case 8: { + message.sPromote = reader.string(); + break; + } + case 9: { + message.sDemote = reader.string(); + break; + } + case 10: { + message.antidelete = reader.bool(); + break; + } + case 11: { + message.modohorny = reader.bool(); + break; + } + case 12: { + message.autosticker = reader.bool(); + break; + } + case 13: { + message.audios = reader.bool(); + break; + } + case 14: { + message.antiLink2 = reader.bool(); + break; + } + case 15: { + message.antiviewonce = reader.bool(); + break; + } + case 16: { + message.antiToxic = reader.bool(); + break; + } + case 17: { + message.antiTraba = reader.bool(); + break; + } + case 18: { + message.modoadmin = reader.bool(); + break; + } + case 19: { + message.antiArab = reader.bool(); + break; + } + case 20: { + message.antiArab2 = reader.bool(); + break; + } + case 21: { + message.antiporno = reader.bool(); + break; + } + case 22: { + message.simi = reader.bool(); + break; + } + case 23: { + message.game = reader.bool(); + break; + } + case 24: { + message.expired = reader.int32(); + break; + } + case 25: { + message.language = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Chat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Chat} Chat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chat message. + * @function verify + * @memberof Chat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.isBanned != null && message.hasOwnProperty("isBanned")) + if (typeof message.isBanned !== "boolean") + return "isBanned: boolean expected"; + if (message.welcome != null && message.hasOwnProperty("welcome")) + if (typeof message.welcome !== "boolean") + return "welcome: boolean expected"; + if (message.banchat != null && message.hasOwnProperty("banchat")) + if (typeof message.banchat !== "boolean") + return "banchat: boolean expected"; + if (message.detect != null && message.hasOwnProperty("detect")) + if (typeof message.detect !== "boolean") + return "detect: boolean expected"; + if (message.detect2 != null && message.hasOwnProperty("detect2")) + if (typeof message.detect2 !== "boolean") + return "detect2: boolean expected"; + if (message.sWelcome != null && message.hasOwnProperty("sWelcome")) + if (!$util.isString(message.sWelcome)) + return "sWelcome: string expected"; + if (message.sBye != null && message.hasOwnProperty("sBye")) + if (!$util.isString(message.sBye)) + return "sBye: string expected"; + if (message.sPromote != null && message.hasOwnProperty("sPromote")) + if (!$util.isString(message.sPromote)) + return "sPromote: string expected"; + if (message.sDemote != null && message.hasOwnProperty("sDemote")) + if (!$util.isString(message.sDemote)) + return "sDemote: string expected"; + if (message.antidelete != null && message.hasOwnProperty("antidelete")) + if (typeof message.antidelete !== "boolean") + return "antidelete: boolean expected"; + if (message.modohorny != null && message.hasOwnProperty("modohorny")) + if (typeof message.modohorny !== "boolean") + return "modohorny: boolean expected"; + if (message.autosticker != null && message.hasOwnProperty("autosticker")) + if (typeof message.autosticker !== "boolean") + return "autosticker: boolean expected"; + if (message.audios != null && message.hasOwnProperty("audios")) + if (typeof message.audios !== "boolean") + return "audios: boolean expected"; + if (message.antiLink2 != null && message.hasOwnProperty("antiLink2")) + if (typeof message.antiLink2 !== "boolean") + return "antiLink2: boolean expected"; + if (message.antiviewonce != null && message.hasOwnProperty("antiviewonce")) + if (typeof message.antiviewonce !== "boolean") + return "antiviewonce: boolean expected"; + if (message.antiToxic != null && message.hasOwnProperty("antiToxic")) + if (typeof message.antiToxic !== "boolean") + return "antiToxic: boolean expected"; + if (message.antiTraba != null && message.hasOwnProperty("antiTraba")) + if (typeof message.antiTraba !== "boolean") + return "antiTraba: boolean expected"; + if (message.modoadmin != null && message.hasOwnProperty("modoadmin")) + if (typeof message.modoadmin !== "boolean") + return "modoadmin: boolean expected"; + if (message.antiArab != null && message.hasOwnProperty("antiArab")) + if (typeof message.antiArab !== "boolean") + return "antiArab: boolean expected"; + if (message.antiArab2 != null && message.hasOwnProperty("antiArab2")) + if (typeof message.antiArab2 !== "boolean") + return "antiArab2: boolean expected"; + if (message.antiporno != null && message.hasOwnProperty("antiporno")) + if (typeof message.antiporno !== "boolean") + return "antiporno: boolean expected"; + if (message.simi != null && message.hasOwnProperty("simi")) + if (typeof message.simi !== "boolean") + return "simi: boolean expected"; + if (message.game != null && message.hasOwnProperty("game")) + if (typeof message.game !== "boolean") + return "game: boolean expected"; + if (message.expired != null && message.hasOwnProperty("expired")) + if (!$util.isInteger(message.expired)) + return "expired: integer expected"; + if (message.language != null && message.hasOwnProperty("language")) + if (!$util.isString(message.language)) + return "language: string expected"; + return null; + }; + + /** + * Creates a Chat message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof Chat + * @static + * @param {Object.} object Plain object + * @returns {Chat} Chat + */ + Chat.fromObject = function fromObject(object) { + if (object instanceof $root.Chat) + return object; + var message = new $root.Chat(); + if (object.isBanned != null) + message.isBanned = Boolean(object.isBanned); + if (object.welcome != null) + message.welcome = Boolean(object.welcome); + if (object.banchat != null) + message.banchat = Boolean(object.banchat); + if (object.detect != null) + message.detect = Boolean(object.detect); + if (object.detect2 != null) + message.detect2 = Boolean(object.detect2); + if (object.sWelcome != null) + message.sWelcome = String(object.sWelcome); + if (object.sBye != null) + message.sBye = String(object.sBye); + if (object.sPromote != null) + message.sPromote = String(object.sPromote); + if (object.sDemote != null) + message.sDemote = String(object.sDemote); + if (object.antidelete != null) + message.antidelete = Boolean(object.antidelete); + if (object.modohorny != null) + message.modohorny = Boolean(object.modohorny); + if (object.autosticker != null) + message.autosticker = Boolean(object.autosticker); + if (object.audios != null) + message.audios = Boolean(object.audios); + if (object.antiLink2 != null) + message.antiLink2 = Boolean(object.antiLink2); + if (object.antiviewonce != null) + message.antiviewonce = Boolean(object.antiviewonce); + if (object.antiToxic != null) + message.antiToxic = Boolean(object.antiToxic); + if (object.antiTraba != null) + message.antiTraba = Boolean(object.antiTraba); + if (object.modoadmin != null) + message.modoadmin = Boolean(object.modoadmin); + if (object.antiArab != null) + message.antiArab = Boolean(object.antiArab); + if (object.antiArab2 != null) + message.antiArab2 = Boolean(object.antiArab2); + if (object.antiporno != null) + message.antiporno = Boolean(object.antiporno); + if (object.simi != null) + message.simi = Boolean(object.simi); + if (object.game != null) + message.game = Boolean(object.game); + if (object.expired != null) + message.expired = object.expired | 0; + if (object.language != null) + message.language = String(object.language); + return message; + }; + + /** + * Creates a plain object from a Chat message. Also converts values to other types if specified. + * @function toObject + * @memberof Chat + * @static + * @param {Chat} message Chat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chat.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.isBanned = false; + object.welcome = false; + object.banchat = false; + object.detect = false; + object.detect2 = false; + object.sWelcome = ""; + object.sBye = ""; + object.sPromote = ""; + object.sDemote = ""; + object.antidelete = false; + object.modohorny = false; + object.autosticker = false; + object.audios = false; + object.antiLink2 = false; + object.antiviewonce = false; + object.antiToxic = false; + object.antiTraba = false; + object.modoadmin = false; + object.antiArab = false; + object.antiArab2 = false; + object.antiporno = false; + object.simi = false; + object.game = false; + object.expired = 0; + object.language = ""; + } + if (message.isBanned != null && message.hasOwnProperty("isBanned")) + object.isBanned = message.isBanned; + if (message.welcome != null && message.hasOwnProperty("welcome")) + object.welcome = message.welcome; + if (message.banchat != null && message.hasOwnProperty("banchat")) + object.banchat = message.banchat; + if (message.detect != null && message.hasOwnProperty("detect")) + object.detect = message.detect; + if (message.detect2 != null && message.hasOwnProperty("detect2")) + object.detect2 = message.detect2; + if (message.sWelcome != null && message.hasOwnProperty("sWelcome")) + object.sWelcome = message.sWelcome; + if (message.sBye != null && message.hasOwnProperty("sBye")) + object.sBye = message.sBye; + if (message.sPromote != null && message.hasOwnProperty("sPromote")) + object.sPromote = message.sPromote; + if (message.sDemote != null && message.hasOwnProperty("sDemote")) + object.sDemote = message.sDemote; + if (message.antidelete != null && message.hasOwnProperty("antidelete")) + object.antidelete = message.antidelete; + if (message.modohorny != null && message.hasOwnProperty("modohorny")) + object.modohorny = message.modohorny; + if (message.autosticker != null && message.hasOwnProperty("autosticker")) + object.autosticker = message.autosticker; + if (message.audios != null && message.hasOwnProperty("audios")) + object.audios = message.audios; + if (message.antiLink2 != null && message.hasOwnProperty("antiLink2")) + object.antiLink2 = message.antiLink2; + if (message.antiviewonce != null && message.hasOwnProperty("antiviewonce")) + object.antiviewonce = message.antiviewonce; + if (message.antiToxic != null && message.hasOwnProperty("antiToxic")) + object.antiToxic = message.antiToxic; + if (message.antiTraba != null && message.hasOwnProperty("antiTraba")) + object.antiTraba = message.antiTraba; + if (message.modoadmin != null && message.hasOwnProperty("modoadmin")) + object.modoadmin = message.modoadmin; + if (message.antiArab != null && message.hasOwnProperty("antiArab")) + object.antiArab = message.antiArab; + if (message.antiArab2 != null && message.hasOwnProperty("antiArab2")) + object.antiArab2 = message.antiArab2; + if (message.antiporno != null && message.hasOwnProperty("antiporno")) + object.antiporno = message.antiporno; + if (message.simi != null && message.hasOwnProperty("simi")) + object.simi = message.simi; + if (message.game != null && message.hasOwnProperty("game")) + object.game = message.game; + if (message.expired != null && message.hasOwnProperty("expired")) + object.expired = message.expired; + if (message.language != null && message.hasOwnProperty("language")) + object.language = message.language; + return object; + }; + + /** + * Converts this Chat to JSON. + * @function toJSON + * @memberof Chat + * @instance + * @returns {Object.} JSON object + */ + Chat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Chat + * @function getTypeUrl + * @memberof Chat + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Chat.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/Chat"; + }; + + return Chat; +})(); + +$root.Settings = (function() { + + /** + * Properties of a Settings. + * @exports ISettings + * @interface ISettings + * @property {boolean|null} [self] Settings self + * @property {boolean|null} [autoread] Settings autoread + * @property {boolean|null} [autoread2] Settings autoread2 + * @property {boolean|null} [restrict] Settings restrict + * @property {boolean|null} [antiCall] Settings antiCall + * @property {boolean|null} [antiPrivate] Settings antiPrivate + * @property {boolean|null} [modejadibot] Settings modejadibot + * @property {boolean|null} [antispam] Settings antispam + * @property {boolean|null} [audiosBot] Settings audiosBot + * @property {boolean|null} [modoia] Settings modoia + */ + + /** + * Constructs a new Settings. + * @exports Settings + * @classdesc Represents a Settings. + * @implements ISettings + * @constructor + * @param {ISettings=} [properties] Properties to set + */ + function Settings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Settings self. + * @member {boolean} self + * @memberof Settings + * @instance + */ + Settings.prototype.self = false; + + /** + * Settings autoread. + * @member {boolean} autoread + * @memberof Settings + * @instance + */ + Settings.prototype.autoread = false; + + /** + * Settings autoread2. + * @member {boolean} autoread2 + * @memberof Settings + * @instance + */ + Settings.prototype.autoread2 = false; + + /** + * Settings restrict. + * @member {boolean} restrict + * @memberof Settings + * @instance + */ + Settings.prototype.restrict = false; + + /** + * Settings antiCall. + * @member {boolean} antiCall + * @memberof Settings + * @instance + */ + Settings.prototype.antiCall = false; + + /** + * Settings antiPrivate. + * @member {boolean} antiPrivate + * @memberof Settings + * @instance + */ + Settings.prototype.antiPrivate = false; + + /** + * Settings modejadibot. + * @member {boolean} modejadibot + * @memberof Settings + * @instance + */ + Settings.prototype.modejadibot = false; + + /** + * Settings antispam. + * @member {boolean} antispam + * @memberof Settings + * @instance + */ + Settings.prototype.antispam = false; + + /** + * Settings audiosBot. + * @member {boolean} audiosBot + * @memberof Settings + * @instance + */ + Settings.prototype.audiosBot = false; + + /** + * Settings modoia. + * @member {boolean} modoia + * @memberof Settings + * @instance + */ + Settings.prototype.modoia = false; + + /** + * Creates a new Settings instance using the specified properties. + * @function create + * @memberof Settings + * @static + * @param {ISettings=} [properties] Properties to set + * @returns {Settings} Settings instance + */ + Settings.create = function create(properties) { + return new Settings(properties); + }; + + /** + * Encodes the specified Settings message. Does not implicitly {@link Settings.verify|verify} messages. + * @function encode + * @memberof Settings + * @static + * @param {ISettings} message Settings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Settings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.self != null && Object.hasOwnProperty.call(message, "self")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.self); + if (message.autoread != null && Object.hasOwnProperty.call(message, "autoread")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.autoread); + if (message.autoread2 != null && Object.hasOwnProperty.call(message, "autoread2")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.autoread2); + if (message.restrict != null && Object.hasOwnProperty.call(message, "restrict")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.restrict); + if (message.antiCall != null && Object.hasOwnProperty.call(message, "antiCall")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.antiCall); + if (message.antiPrivate != null && Object.hasOwnProperty.call(message, "antiPrivate")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.antiPrivate); + if (message.modejadibot != null && Object.hasOwnProperty.call(message, "modejadibot")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.modejadibot); + if (message.antispam != null && Object.hasOwnProperty.call(message, "antispam")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.antispam); + if (message.audiosBot != null && Object.hasOwnProperty.call(message, "audiosBot")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.audiosBot); + if (message.modoia != null && Object.hasOwnProperty.call(message, "modoia")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.modoia); + return writer; + }; + + /** + * Encodes the specified Settings message, length delimited. Does not implicitly {@link Settings.verify|verify} messages. + * @function encodeDelimited + * @memberof Settings + * @static + * @param {ISettings} message Settings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Settings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Settings message from the specified reader or buffer. + * @function decode + * @memberof Settings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Settings} Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Settings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Settings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.self = reader.bool(); + break; + } + case 2: { + message.autoread = reader.bool(); + break; + } + case 3: { + message.autoread2 = reader.bool(); + break; + } + case 4: { + message.restrict = reader.bool(); + break; + } + case 5: { + message.antiCall = reader.bool(); + break; + } + case 6: { + message.antiPrivate = reader.bool(); + break; + } + case 7: { + message.modejadibot = reader.bool(); + break; + } + case 8: { + message.antispam = reader.bool(); + break; + } + case 9: { + message.audiosBot = reader.bool(); + break; + } + case 10: { + message.modoia = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Settings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Settings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Settings} Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Settings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Settings message. + * @function verify + * @memberof Settings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Settings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.self != null && message.hasOwnProperty("self")) + if (typeof message.self !== "boolean") + return "self: boolean expected"; + if (message.autoread != null && message.hasOwnProperty("autoread")) + if (typeof message.autoread !== "boolean") + return "autoread: boolean expected"; + if (message.autoread2 != null && message.hasOwnProperty("autoread2")) + if (typeof message.autoread2 !== "boolean") + return "autoread2: boolean expected"; + if (message.restrict != null && message.hasOwnProperty("restrict")) + if (typeof message.restrict !== "boolean") + return "restrict: boolean expected"; + if (message.antiCall != null && message.hasOwnProperty("antiCall")) + if (typeof message.antiCall !== "boolean") + return "antiCall: boolean expected"; + if (message.antiPrivate != null && message.hasOwnProperty("antiPrivate")) + if (typeof message.antiPrivate !== "boolean") + return "antiPrivate: boolean expected"; + if (message.modejadibot != null && message.hasOwnProperty("modejadibot")) + if (typeof message.modejadibot !== "boolean") + return "modejadibot: boolean expected"; + if (message.antispam != null && message.hasOwnProperty("antispam")) + if (typeof message.antispam !== "boolean") + return "antispam: boolean expected"; + if (message.audiosBot != null && message.hasOwnProperty("audiosBot")) + if (typeof message.audiosBot !== "boolean") + return "audiosBot: boolean expected"; + if (message.modoia != null && message.hasOwnProperty("modoia")) + if (typeof message.modoia !== "boolean") + return "modoia: boolean expected"; + return null; + }; + + /** + * Creates a Settings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof Settings + * @static + * @param {Object.} object Plain object + * @returns {Settings} Settings + */ + Settings.fromObject = function fromObject(object) { + if (object instanceof $root.Settings) + return object; + var message = new $root.Settings(); + if (object.self != null) + message.self = Boolean(object.self); + if (object.autoread != null) + message.autoread = Boolean(object.autoread); + if (object.autoread2 != null) + message.autoread2 = Boolean(object.autoread2); + if (object.restrict != null) + message.restrict = Boolean(object.restrict); + if (object.antiCall != null) + message.antiCall = Boolean(object.antiCall); + if (object.antiPrivate != null) + message.antiPrivate = Boolean(object.antiPrivate); + if (object.modejadibot != null) + message.modejadibot = Boolean(object.modejadibot); + if (object.antispam != null) + message.antispam = Boolean(object.antispam); + if (object.audiosBot != null) + message.audiosBot = Boolean(object.audiosBot); + if (object.modoia != null) + message.modoia = Boolean(object.modoia); + return message; + }; + + /** + * Creates a plain object from a Settings message. Also converts values to other types if specified. + * @function toObject + * @memberof Settings + * @static + * @param {Settings} message Settings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Settings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.self = false; + object.autoread = false; + object.autoread2 = false; + object.restrict = false; + object.antiCall = false; + object.antiPrivate = false; + object.modejadibot = false; + object.antispam = false; + object.audiosBot = false; + object.modoia = false; + } + if (message.self != null && message.hasOwnProperty("self")) + object.self = message.self; + if (message.autoread != null && message.hasOwnProperty("autoread")) + object.autoread = message.autoread; + if (message.autoread2 != null && message.hasOwnProperty("autoread2")) + object.autoread2 = message.autoread2; + if (message.restrict != null && message.hasOwnProperty("restrict")) + object.restrict = message.restrict; + if (message.antiCall != null && message.hasOwnProperty("antiCall")) + object.antiCall = message.antiCall; + if (message.antiPrivate != null && message.hasOwnProperty("antiPrivate")) + object.antiPrivate = message.antiPrivate; + if (message.modejadibot != null && message.hasOwnProperty("modejadibot")) + object.modejadibot = message.modejadibot; + if (message.antispam != null && message.hasOwnProperty("antispam")) + object.antispam = message.antispam; + if (message.audiosBot != null && message.hasOwnProperty("audiosBot")) + object.audiosBot = message.audiosBot; + if (message.modoia != null && message.hasOwnProperty("modoia")) + object.modoia = message.modoia; + return object; + }; + + /** + * Converts this Settings to JSON. + * @function toJSON + * @memberof Settings + * @instance + * @returns {Object.} JSON object + */ + Settings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Settings + * @function getTypeUrl + * @memberof Settings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Settings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/Settings"; + }; + + return Settings; +})(); + +$root.Sticker = (function() { + + /** + * Properties of a Sticker. + * @exports ISticker + * @interface ISticker + * @property {string|null} [text] Sticker text + * @property {string|null} [mentionedJid] Sticker mentionedJid + * @property {string|null} [creator] Sticker creator + * @property {boolean|null} [locked] Sticker locked + * @property {number|null} [at] Sticker at + */ + + /** + * Constructs a new Sticker. + * @exports Sticker + * @classdesc Represents a Sticker. + * @implements ISticker + * @constructor + * @param {ISticker=} [properties] Properties to set + */ + function Sticker(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Sticker text. + * @member {string} text + * @memberof Sticker + * @instance + */ + Sticker.prototype.text = ""; + + /** + * Sticker mentionedJid. + * @member {string} mentionedJid + * @memberof Sticker + * @instance + */ + Sticker.prototype.mentionedJid = ""; + + /** + * Sticker creator. + * @member {string} creator + * @memberof Sticker + * @instance + */ + Sticker.prototype.creator = ""; + + /** + * Sticker locked. + * @member {boolean} locked + * @memberof Sticker + * @instance + */ + Sticker.prototype.locked = false; + + /** + * Sticker at. + * @member {number} at + * @memberof Sticker + * @instance + */ + Sticker.prototype.at = 0; + + /** + * Creates a new Sticker instance using the specified properties. + * @function create + * @memberof Sticker + * @static + * @param {ISticker=} [properties] Properties to set + * @returns {Sticker} Sticker instance + */ + Sticker.create = function create(properties) { + return new Sticker(properties); + }; + + /** + * Encodes the specified Sticker message. Does not implicitly {@link Sticker.verify|verify} messages. + * @function encode + * @memberof Sticker + * @static + * @param {ISticker} message Sticker message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sticker.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.mentionedJid != null && Object.hasOwnProperty.call(message, "mentionedJid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mentionedJid); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.creator); + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.locked); + if (message.at != null && Object.hasOwnProperty.call(message, "at")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.at); + return writer; + }; + + /** + * Encodes the specified Sticker message, length delimited. Does not implicitly {@link Sticker.verify|verify} messages. + * @function encodeDelimited + * @memberof Sticker + * @static + * @param {ISticker} message Sticker message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sticker.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Sticker message from the specified reader or buffer. + * @function decode + * @memberof Sticker + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Sticker} Sticker + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sticker.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Sticker(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.mentionedJid = reader.string(); + break; + } + case 3: { + message.creator = reader.string(); + break; + } + case 4: { + message.locked = reader.bool(); + break; + } + case 5: { + message.at = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Sticker message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Sticker + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Sticker} Sticker + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sticker.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Sticker message. + * @function verify + * @memberof Sticker + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sticker.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.mentionedJid != null && message.hasOwnProperty("mentionedJid")) + if (!$util.isString(message.mentionedJid)) + return "mentionedJid: string expected"; + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: string expected"; + if (message.locked != null && message.hasOwnProperty("locked")) + if (typeof message.locked !== "boolean") + return "locked: boolean expected"; + if (message.at != null && message.hasOwnProperty("at")) + if (!$util.isInteger(message.at)) + return "at: integer expected"; + return null; + }; + + /** + * Creates a Sticker message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof Sticker + * @static + * @param {Object.} object Plain object + * @returns {Sticker} Sticker + */ + Sticker.fromObject = function fromObject(object) { + if (object instanceof $root.Sticker) + return object; + var message = new $root.Sticker(); + if (object.text != null) + message.text = String(object.text); + if (object.mentionedJid != null) + message.mentionedJid = String(object.mentionedJid); + if (object.creator != null) + message.creator = String(object.creator); + if (object.locked != null) + message.locked = Boolean(object.locked); + if (object.at != null) + message.at = object.at | 0; + return message; + }; + + /** + * Creates a plain object from a Sticker message. Also converts values to other types if specified. + * @function toObject + * @memberof Sticker + * @static + * @param {Sticker} message Sticker + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sticker.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.mentionedJid = ""; + object.creator = ""; + object.locked = false; + object.at = 0; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.mentionedJid != null && message.hasOwnProperty("mentionedJid")) + object.mentionedJid = message.mentionedJid; + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.locked != null && message.hasOwnProperty("locked")) + object.locked = message.locked; + if (message.at != null && message.hasOwnProperty("at")) + object.at = message.at; + return object; + }; + + /** + * Converts this Sticker to JSON. + * @function toJSON + * @memberof Sticker + * @instance + * @returns {Object.} JSON object + */ + Sticker.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Sticker + * @function getTypeUrl + * @memberof Sticker + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Sticker.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/Sticker"; + }; + + return Sticker; +})(); + +$root.Database = (function() { + + /** + * Properties of a Database. + * @exports IDatabase + * @interface IDatabase + * @property {Object.|null} [users] Database users + * @property {Object.|null} [chats] Database chats + * @property {Object.|null} [settings] Database settings + * @property {Object.|null} [stickers] Database stickers + */ + + /** + * Constructs a new Database. + * @exports Database + * @classdesc Represents a Database. + * @implements IDatabase + * @constructor + * @param {IDatabase=} [properties] Properties to set + */ + function Database(properties) { + this.users = {}; + this.chats = {}; + this.settings = {}; + this.stickers = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Database users. + * @member {Object.} users + * @memberof Database + * @instance + */ + Database.prototype.users = $util.emptyObject; + + /** + * Database chats. + * @member {Object.} chats + * @memberof Database + * @instance + */ + Database.prototype.chats = $util.emptyObject; + + /** + * Database settings. + * @member {Object.} settings + * @memberof Database + * @instance + */ + Database.prototype.settings = $util.emptyObject; + + /** + * Database stickers. + * @member {Object.} stickers + * @memberof Database + * @instance + */ + Database.prototype.stickers = $util.emptyObject; + + /** + * Creates a new Database instance using the specified properties. + * @function create + * @memberof Database + * @static + * @param {IDatabase=} [properties] Properties to set + * @returns {Database} Database instance + */ + Database.create = function create(properties) { + return new Database(properties); + }; + + /** + * Encodes the specified Database message. Does not implicitly {@link Database.verify|verify} messages. + * @function encode + * @memberof Database + * @static + * @param {IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.users != null && Object.hasOwnProperty.call(message, "users")) + for (var keys = Object.keys(message.users), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.User.encode(message.users[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.chats != null && Object.hasOwnProperty.call(message, "chats")) + for (var keys = Object.keys(message.chats), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.Chat.encode(message.chats[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.settings != null && Object.hasOwnProperty.call(message, "settings")) + for (var keys = Object.keys(message.settings), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.Settings.encode(message.settings[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.stickers != null && Object.hasOwnProperty.call(message, "stickers")) + for (var keys = Object.keys(message.stickers), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.Sticker.encode(message.stickers[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link Database.verify|verify} messages. + * @function encodeDelimited + * @memberof Database + * @static + * @param {IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Database message from the specified reader or buffer. + * @function decode + * @memberof Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Database(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.users === $util.emptyObject) + message.users = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.User.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.users[key] = value; + break; + } + case 2: { + if (message.chats === $util.emptyObject) + message.chats = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.Chat.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.chats[key] = value; + break; + } + case 3: { + if (message.settings === $util.emptyObject) + message.settings = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.Settings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.settings[key] = value; + break; + } + case 4: { + if (message.stickers === $util.emptyObject) + message.stickers = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.Sticker.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.stickers[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Database message. + * @function verify + * @memberof Database + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Database.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.users != null && message.hasOwnProperty("users")) { + if (!$util.isObject(message.users)) + return "users: object expected"; + var key = Object.keys(message.users); + for (var i = 0; i < key.length; ++i) { + var error = $root.User.verify(message.users[key[i]]); + if (error) + return "users." + error; + } + } + if (message.chats != null && message.hasOwnProperty("chats")) { + if (!$util.isObject(message.chats)) + return "chats: object expected"; + var key = Object.keys(message.chats); + for (var i = 0; i < key.length; ++i) { + var error = $root.Chat.verify(message.chats[key[i]]); + if (error) + return "chats." + error; + } + } + if (message.settings != null && message.hasOwnProperty("settings")) { + if (!$util.isObject(message.settings)) + return "settings: object expected"; + var key = Object.keys(message.settings); + for (var i = 0; i < key.length; ++i) { + var error = $root.Settings.verify(message.settings[key[i]]); + if (error) + return "settings." + error; + } + } + if (message.stickers != null && message.hasOwnProperty("stickers")) { + if (!$util.isObject(message.stickers)) + return "stickers: object expected"; + var key = Object.keys(message.stickers); + for (var i = 0; i < key.length; ++i) { + var error = $root.Sticker.verify(message.stickers[key[i]]); + if (error) + return "stickers." + error; + } + } + return null; + }; + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof Database + * @static + * @param {Object.} object Plain object + * @returns {Database} Database + */ + Database.fromObject = function fromObject(object) { + if (object instanceof $root.Database) + return object; + var message = new $root.Database(); + if (object.users) { + if (typeof object.users !== "object") + throw TypeError(".Database.users: object expected"); + message.users = {}; + for (var keys = Object.keys(object.users), i = 0; i < keys.length; ++i) { + if (typeof object.users[keys[i]] !== "object") + throw TypeError(".Database.users: object expected"); + message.users[keys[i]] = $root.User.fromObject(object.users[keys[i]]); + } + } + if (object.chats) { + if (typeof object.chats !== "object") + throw TypeError(".Database.chats: object expected"); + message.chats = {}; + for (var keys = Object.keys(object.chats), i = 0; i < keys.length; ++i) { + if (typeof object.chats[keys[i]] !== "object") + throw TypeError(".Database.chats: object expected"); + message.chats[keys[i]] = $root.Chat.fromObject(object.chats[keys[i]]); + } + } + if (object.settings) { + if (typeof object.settings !== "object") + throw TypeError(".Database.settings: object expected"); + message.settings = {}; + for (var keys = Object.keys(object.settings), i = 0; i < keys.length; ++i) { + if (typeof object.settings[keys[i]] !== "object") + throw TypeError(".Database.settings: object expected"); + message.settings[keys[i]] = $root.Settings.fromObject(object.settings[keys[i]]); + } + } + if (object.stickers) { + if (typeof object.stickers !== "object") + throw TypeError(".Database.stickers: object expected"); + message.stickers = {}; + for (var keys = Object.keys(object.stickers), i = 0; i < keys.length; ++i) { + if (typeof object.stickers[keys[i]] !== "object") + throw TypeError(".Database.stickers: object expected"); + message.stickers[keys[i]] = $root.Sticker.fromObject(object.stickers[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @function toObject + * @memberof Database + * @static + * @param {Database} message Database + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Database.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.users = {}; + object.chats = {}; + object.settings = {}; + object.stickers = {}; + } + var keys2; + if (message.users && (keys2 = Object.keys(message.users)).length) { + object.users = {}; + for (var j = 0; j < keys2.length; ++j) + object.users[keys2[j]] = $root.User.toObject(message.users[keys2[j]], options); + } + if (message.chats && (keys2 = Object.keys(message.chats)).length) { + object.chats = {}; + for (var j = 0; j < keys2.length; ++j) + object.chats[keys2[j]] = $root.Chat.toObject(message.chats[keys2[j]], options); + } + if (message.settings && (keys2 = Object.keys(message.settings)).length) { + object.settings = {}; + for (var j = 0; j < keys2.length; ++j) + object.settings[keys2[j]] = $root.Settings.toObject(message.settings[keys2[j]], options); + } + if (message.stickers && (keys2 = Object.keys(message.stickers)).length) { + object.stickers = {}; + for (var j = 0; j < keys2.length; ++j) + object.stickers[keys2[j]] = $root.Sticker.toObject(message.stickers[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Database to JSON. + * @function toJSON + * @memberof Database + * @instance + * @returns {Object.} JSON object + */ + Database.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Database + * @function getTypeUrl + * @memberof Database + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Database.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/Database"; + }; + + return Database; +})(); + +module.exports = $root; diff --git a/protoDB/database/readme.md b/protoDB/database/readme.md new file mode 100644 index 0000000000..aad79fb335 --- /dev/null +++ b/protoDB/database/readme.md @@ -0,0 +1,15 @@ +### Database Proto - The Mystic Bot MD + +Instalación +Primero, instala protobufjs globalmente ejecutando el siguiente comando: +npm install -g protobufjs + + +Para generar el archivo js a partir del archivo db.proto, usa el siguiente comando: +pbjs -t static-module -w commonjs -o index.js db.proto + +Este comando creará un archivo llamado index.js el cual contendra los datos de la db + + + +La base de datos generada con db.proto está diseñada específicamente para The Mystic Bot MD, optimizando la database