diff --git a/assets/fonts/KeepCalm-Medium.ttf b/assets/fonts/KeepCalm-Medium.ttf deleted file mode 100644 index 5b16cc5..0000000 Binary files a/assets/fonts/KeepCalm-Medium.ttf and /dev/null differ diff --git a/assets/fonts/LuckiestGuy-Regular.ttf b/assets/fonts/LuckiestGuy-Regular.ttf deleted file mode 100644 index 5ca663c..0000000 Binary files a/assets/fonts/LuckiestGuy-Regular.ttf and /dev/null differ diff --git a/assets/fonts/SketchMatch.ttf b/assets/fonts/SketchMatch.ttf deleted file mode 100644 index 8cfb5f7..0000000 Binary files a/assets/fonts/SketchMatch.ttf and /dev/null differ diff --git a/assets/fonts/theboldfont.ttf b/assets/fonts/theboldfont.ttf deleted file mode 100644 index 2985b05..0000000 Binary files a/assets/fonts/theboldfont.ttf and /dev/null differ diff --git a/assets/img/1px.png b/assets/img/1px.png deleted file mode 100644 index 063be68..0000000 Binary files a/assets/img/1px.png and /dev/null differ diff --git a/assets/img/default-avatar.png b/assets/img/default-avatar.png deleted file mode 100644 index e2dc1e4..0000000 Binary files a/assets/img/default-avatar.png and /dev/null differ diff --git a/command/add.js b/command/add.js index 27678a2..02870f2 100644 --- a/command/add.js +++ b/command/add.js @@ -1,10 +1,10 @@ -const { MessageType } = require('@adiwajshing/baileys') const { color } = require('../utils/color') module.exports = { name: 'add', aliases: ['ad'], description: 'Untuk menambahkan orang ke group dengan nomor\nPenggunaan: !add 6285xxxx', + // eslint-disable-next-line no-shadow-restricted-names execute (client, undefined, pesan, args) { if (!client.isGroup) return client.reply(pesan.error.group) if (!client.isGroupAdmins) return client.reply(pesan.hanya.admin) @@ -17,6 +17,6 @@ module.exports = { } catch (e) { console.log('Error : %s', color(e, 'red')) client.reply('Gagal menambahkan target, mungkin karena di private') - } + } } } diff --git a/command/clearall.js b/command/clearall.js index da3247c..30f0d80 100644 --- a/command/clearall.js +++ b/command/clearall.js @@ -1,5 +1,3 @@ -const { MessageType } = require('@adiwajshing/baileys') - module.exports = { name: 'clearall', aliases: ['ca'], @@ -9,8 +7,8 @@ module.exports = { if (!isOwner) return reply('Kamu siapa?') chatAll = client.chats.all() client.setMaxListeners(25) - for (let chat of chatAll) { - client.deleteChat(chat.jid) + for (const chat of chatAll) { + client.deleteChat(chat.jid) } client.reply('Berhasil menghapus semua chat') } diff --git a/command/demote.js b/command/demote.js index 5e0d38b..b180f71 100644 --- a/command/demote.js +++ b/command/demote.js @@ -1,5 +1,3 @@ -const { MessageType } = require('@adiwajshing/baileys') - module.exports = { name: 'demote', aliases: ['dm'], @@ -12,7 +10,7 @@ module.exports = { mentioned = chat.message.extendedTextMessage.contextInfo.mentionedJid if (mentioned.length > 1) { teks = 'Perintah di terima, demote :\n' - for (let _ of mentioned) { + for (const _ of mentioned) { teks += `@${_.split('@')[0]}\n` } client.mentions(teks, mentioned, true) diff --git a/command/help.js b/command/help.js index e2be3b5..80c4beb 100644 --- a/command/help.js +++ b/command/help.js @@ -1,5 +1,3 @@ -const { MessageType } = require('@adiwajshing/baileys') - module.exports = { name: 'help', aliases: ['h'], @@ -7,15 +5,15 @@ module.exports = { execute (client, chat, pesan, args) { const commands = client.cmd.array() if (args.length == 0) { - let text = `Daftar perintah di bot ini\n\nPrefix: !\n` - commands.forEach((cmd) => { - text += `- *${cmd.name}* ${cmd.aliases ? `(${cmd.aliases})` : ''}\n` - }) - return client.reply(text) + let text = 'Daftar perintah di bot ini\n\nPrefix: !\n' + commands.forEach((cmd) => { + text += `- *${cmd.name}* ${cmd.aliases ? `(${cmd.aliases})` : ''}\n` + }) + return client.reply(text) } else { - if (!client.cmd.has(args[0])) return client.reply('Perintah yang anda maksut tidak ada bro') - const text = client.cmd.get(args[0]).description - return client.reply(text) + if (!client.cmd.has(args[0])) return client.reply('Perintah yang anda maksut tidak ada bro') + const text = client.cmd.get(args[0]).description + return client.reply(text) } } } diff --git a/command/hidetag.js b/command/hidetag.js index a74ef92..8fbf834 100644 --- a/command/hidetag.js +++ b/command/hidetag.js @@ -1,5 +1,3 @@ -const { MessageType } = require('@adiwajshing/baileys') - module.exports = { name: 'hidetag', aliases: ['ht'], @@ -8,9 +6,8 @@ module.exports = { if (!client.isGroup) return client.reply(pesan.error.group) if (!client.isGroupAdmins) return client.reply(pesan.hanya.admin) const value = client.body.slice(9) - const group = client.groupMetadata(client.from) const memberList = [] - for (let member of client.groupMembers) { + for (const member of client.groupMembers) { memberList.push(member.jid) } const options = { diff --git a/command/kick.js b/command/kick.js index ed193fc..6247894 100644 --- a/command/kick.js +++ b/command/kick.js @@ -1,5 +1,3 @@ -const { MessageType } = require('@adiwajshing/baileys') - module.exports = { name: 'kick', aliases: ['k'], @@ -12,7 +10,7 @@ module.exports = { mentioned = chat.message.extendedTextMessage.contextInfo.mentionedJid if (mentioned.length > 1) { teks = 'Perintah di terima, mengeluarkan :\n' - for (let _ of mentioned) { + for (const _ of mentioned) { teks += `@${_.split('@')[0]}\n` } client.mentions(teks, mentioned, true) diff --git a/command/nulis.js b/command/nulis.js index 2336752..ca60a55 100644 --- a/command/nulis.js +++ b/command/nulis.js @@ -8,11 +8,11 @@ module.exports = { description: 'Untuk menuliskan di buku bot\nPenggunaan !nulis _tulisan_', execute (client, chat, pesan, args) { const value = args.slice().join(' ') - fetchJson(`https://mhankbarbar.tech/nulis?text=${value}&apiKey=${client.apiKey}`, {method: 'get'}) - .then(async (hasil) => { - client.reply(pesan.tunggu) - const buffer = await getBuffer(hasil.result) - client.sendMessage(client.from, buffer, MessageType.image, {quoted: chat, caption: pesan.berhasil}) - }).catch((err) => console.log(err)) + fetchJson(`https://mhankbarbar.tech/nulis?text=${value}&apiKey=${client.apiKey}`, { method: 'get' }) + .then(async (hasil) => { + client.reply(pesan.tunggu) + const buffer = await getBuffer(hasil.result) + client.sendMessage(client.from, buffer, MessageType.image, { quoted: chat, caption: pesan.berhasil }) + }).catch((err) => console.log(err)) } } diff --git a/command/nulis2.js b/command/nulis2.js index ba697b2..e726a4c 100644 --- a/command/nulis2.js +++ b/command/nulis2.js @@ -1,6 +1,5 @@ const { MessageType } = require('@adiwajshing/baileys') const { getBuffer } = require('../utils/functions') -const { fetchJson } = require('../utils/fetcher') module.exports = { name: 'nulis2', @@ -9,9 +8,9 @@ module.exports = { execute (client, chat, pesan, args) { const value = args.slice().join(' ') getBuffer(`https://api.zeks.xyz/api/nulis?text=${value}&apikey=administrator`) - .then((hasil) => { - client.reply(pesan.tunggu) - client.sendMessage(client.from, hasil, MessageType.image, {quoted: chat, caption: pesan.berhasil}) - }).catch((err) => console.log(err)) + .then((hasil) => { + client.reply(pesan.tunggu) + client.sendMessage(client.from, hasil, MessageType.image, { quoted: chat, caption: pesan.berhasil }) + }).catch((err) => console.log(err)) } } diff --git a/krypton.js b/krypton.js index 7e75d36..21690e8 100644 --- a/krypton.js +++ b/krypton.js @@ -129,16 +129,16 @@ async function krypton () { if (!isCmd && client.isGroup) console.log('\x1b[1;31m~\x1b[1;37m>', '[\x1b[1;31mRECV\x1b[1;37m]', time, color('Message'), 'client.from', color(client.sender.split('@')[0]), 'in', color(groupName), 'args :', color(args.length)) pesan = { - tunggu: '⌛ Sedang di Prosess ⌛', - berhasil: '✔️ Berhasil ✔️', - hanya: { - admin: '❌ Perintah ini hanya bisa di gunakan oleh admin group! ❌', - botAdmin: '❌ Perintah ini hanya bisa di gunakan ketika bot menjadi admin! ❌' - }, - error: { - group: '❌ Perintah ini hanya bisa di gunakan dalam group! ❌', - args: '❌ Perintah anda salah! ❌' - } + tunggu: '⌛ Sedang di Prosess ⌛', + berhasil: '✔️ Berhasil ✔️', + hanya: { + admin: '❌ Perintah ini hanya bisa di gunakan oleh admin group! ❌', + botAdmin: '❌ Perintah ini hanya bisa di gunakan ketika bot menjadi admin! ❌' + }, + error: { + group: '❌ Perintah ini hanya bisa di gunakan dalam group! ❌', + args: '❌ Perintah anda salah! ❌' + } } /** diff --git a/utils/fetcher.js b/utils/fetcher.js index b7c701c..f6ccc34 100644 --- a/utils/fetcher.js +++ b/utils/fetcher.js @@ -2,24 +2,22 @@ const fetch = require('node-fetch') const fs = require('fs') exports.getBase64 = getBase64 = async (url) => { - const response = await fetch(url, { headers: { 'User-Agent': 'okhttp/4.5.0' } }); - if (!response.ok) throw new Error(`unexpected response ${response.statusText}`); - const buffer = await response.buffer(); - const videoBase64 = `data:${response.headers.get('content-type')};base64,` + buffer.toString('base64'); - if (buffer) - return videoBase64; -}; + const response = await fetch(url, { headers: { 'User-Agent': 'okhttp/4.5.0' } }) + if (!response.ok) throw new Error(`unexpected response ${response.statusText}`) + const buffer = await response.buffer() + const videoBase64 = `data:${response.headers.get('content-type')};base64,` + buffer.toString('base64') + if (buffer) { return videoBase64 } +} exports.getBuffer = getBuffer = async (url) => { - const res = await fetch(url, {headers: { 'User-Agent': 'okhttp/4.5.0'}, method: 'GET' }) - const anu = fs.readFileSync('./src/emror.jpg') - if (!res.ok) return { type: 'image/jpeg', result: anu } - const buff = await res.buffer() - if (buff) - return { type: res.headers.get('content-type'), result: buff } + const res = await fetch(url, { headers: { 'User-Agent': 'okhttp/4.5.0' }, method: 'GET' }) + const anu = fs.readFileSync('./src/emror.jpg') + if (!res.ok) return { type: 'image/jpeg', result: anu } + const buff = await res.buffer() + if (buff) { return { type: res.headers.get('content-type'), result: buff } } } -exports.fetchJson = fetchJson = (url, options) => new Promise(async (resolve, reject) => { +exports.fetchJson = fetchJson = (url, options) => new Promise((resolve, reject) => { fetch(url, options) .then(response => response.json()) .then(json => { @@ -31,8 +29,7 @@ exports.fetchJson = fetchJson = (url, options) => new Promise(async (resolve, re }) }) - -exports.fetchText = fetchText = (url, options) => new Promise(async (resolve, reject) => { +exports.fetchText = fetchText = (url, options) => new Promise((resolve, reject) => { fetch(url, options) .then(response => response.text()) .then(text => { @@ -44,4 +41,4 @@ exports.fetchText = fetchText = (url, options) => new Promise(async (resolve, re }) }) -//exports.getBase64 = getBase64; +// exports.getBase64 = getBase64; diff --git a/utils/functions.js b/utils/functions.js index 29b5a10..b183f8a 100644 --- a/utils/functions.js +++ b/utils/functions.js @@ -49,11 +49,11 @@ const processTime = (timestamp, now) => { } const getGroupAdmins = (participants) => { - admins = [] - for (let i of participants) { - i.isAdmin ? admins.push(i.jid) : '' - } - return admins + admins = [] + for (const i of participants) { + i.isAdmin ? admins.push(i.jid) : '' + } + return admins } const banner = cfonts.render(('KRYPTON|WHATSAPP|BOT'), { @@ -64,22 +64,22 @@ const banner = cfonts.render(('KRYPTON|WHATSAPP|BOT'), { }) const getBuffer = async (url, options) => { - try { - options ? options : {} - const res = await axios({ - method: "get", - url, - headers: { - 'DNT': 1, - 'Upgrade-Insecure-Request': 1 - }, - ...options, - responseType: 'arraybuffer' - }) - return res.data - } catch (e) { - console.log(`Error : ${e}`) - } + try { + options || {} + const res = await axios({ + method: 'get', + url, + headers: { + DNT: 1, + 'Upgrade-Insecure-Request': 1 + }, + ...options, + responseType: 'arraybuffer' + }) + return res.data + } catch (e) { + console.log(`Error : ${e}`) + } } module.exports = { diff --git a/utils/greeting.js b/utils/greeting.js index 6c8a66f..1a89b03 100644 --- a/utils/greeting.js +++ b/utils/greeting.js @@ -1,47 +1,47 @@ const Canvas = require('wa-canvas') const welcome = (pushname, gcname, picprofil) => new Promise((resolve, reject) => { -async function welcome () { -const image = await new Canvas.Welcome() - .setUsername(pushname) - .setGuildName(gcname) - .setAvatar(picprofil) - .setColor("border", "#8015EA") - .setColor("username-box", "#8015EA") - .setColor("message-box", "#8015EA") - .setColor("title", "#8015EA") - .setColor("avatar", "#8015EA") - .toAttachment(); + async function welcome () { + const image = await new Canvas.Welcome() + .setUsername(pushname) + .setGuildName(gcname) + .setAvatar(picprofil) + .setColor('border', '#8015EA') + .setColor('username-box', '#8015EA') + .setColor('message-box', '#8015EA') + .setColor('title', '#8015EA') + .setColor('avatar', '#8015EA') + .toAttachment() - const buff = image.toBuffer() - const base64 = `data:image/png;base64,${buff.toString('base64')}` - return base64 -} -welcome().then((hasil) => resolve(hasil)).catch((err) => { -reject(err) -}) + const buff = image.toBuffer() + const base64 = `data:image/png;base64,${buff.toString('base64')}` + return base64 + } + welcome().then((hasil) => resolve(hasil)).catch((err) => { + reject(err) + }) }) const goodbye = (pushname, gcname, picprofil) => new Promise((resolve, reject) => { -async function goodbye () { -const image = await new Canvas.Goodbye() - .setUsername(pushname) - .setGuildName(gcname) - .setAvatar(picprofil) - .setColor("border", "#8015EA") - .setColor("username-box", "#8015EA") - .setColor("message-box", "#8015EA") - .setColor("title", "#8015EA") - .setColor("avatar", "#8015EA") - .toAttachment(); + async function goodbye () { + const image = await new Canvas.Goodbye() + .setUsername(pushname) + .setGuildName(gcname) + .setAvatar(picprofil) + .setColor('border', '#8015EA') + .setColor('username-box', '#8015EA') + .setColor('message-box', '#8015EA') + .setColor('title', '#8015EA') + .setColor('avatar', '#8015EA') + .toAttachment() - const buff = image.toBuffer() - const base64 = `data:image/png;base64,${buff.toString('base64')}` - return base64 -} -goodbye().then((hasil) => resolve(hasil)).catch((err) => { -reject(err) -}) + const buff = image.toBuffer() + const base64 = `data:image/png;base64,${buff.toString('base64')}` + return base64 + } + goodbye().then((hasil) => resolve(hasil)).catch((err) => { + reject(err) + }) }) module.exports = {