Skip to content

Commit

Permalink
fix is owner method
Browse files Browse the repository at this point in the history
  • Loading branch information
Kry9toN committed Jan 20, 2021
1 parent a87156c commit 2be48fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion command/clearall.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module.exports = {
aliases: ['ca'],
description: 'Untuk benghapus semua chat _only owner_',
execute (client, chat, pesan) {
if (!client.isGroup) return client.reply(pesan.error.group)
if (!isOwner) return reply('Kamu siapa?')
chatAll = client.chats.all()
client.setMaxListeners(25)
Expand Down
4 changes: 2 additions & 2 deletions krypton.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function krypton () {
const content = JSON.stringify(chat.message)

const botNumber = client.user.jid
const ownerNumber = ['[email protected]'] // replace this with your number
const ownerNumber = process.env.OWNER_PHONE // Isi di .env
client.from = chat.key.remoteJid
client.isGroup = client.from.endsWith('@g.us')
client.sender = client.isGroup ? chat.participant : chat.key.remoteJid
Expand All @@ -100,7 +100,7 @@ async function krypton () {
client.isGroup = client.from.endsWith('@g.us')
client.isBotGroupAdmins = groupAdmins.includes(botNumber) || false
client.isGroupAdmins = groupAdmins.includes(client.sender) || false
client.isOwner = ownerNumber.includes(client.sender)
client.isOwner = client.sender.includes(ownerNumber)
client.isUrl = (url) => {
// eslint-disable-next-line prefer-regex-literals
return url.match(new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/, 'gi'))
Expand Down

0 comments on commit 2be48fe

Please sign in to comment.