-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from AlenSaito1/master
Update
- Loading branch information
Showing
3 changed files
with
10 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,10 @@ const get = require('got') | |
const color = require('./lib/color') | ||
const { liriklagu, quotemaker, wall } = require('./lib/functions') | ||
const { help, info, } = require('./lib/help') | ||
const quotedd = require('./lib/quote') | ||
const msgFilter = require('./lib/msgFilter') | ||
const akaneko = require('akaneko'); | ||
const fetch = require('node-fetch'); | ||
const bent = require('bent') | ||
const invitegrp = '[email protected]' | ||
const ban = JSON.parse(fs.readFileSync('./lib/banned.json')) | ||
const errorurl = 'https://steamuserimages-a.akamaihd.net/ugc/954087817129084207/5B7E46EE484181A676C02DFCAD48ECB1C74BC423/?imw=512&&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=false' | ||
const errorurl2 = 'https://steamuserimages-a.akamaihd.net/ugc/954087817129084207/5B7E46EE484181A676C02DFCAD48ECB1C74BC423/?imw=512&&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=false' | ||
|
@@ -46,8 +44,8 @@ module.exports = msgHandler = async (client, message) => { | |
const isGroupAdmins = isGroupMsg ? groupAdmins.includes(sender.id) : false | ||
const isBotGroupAdmins = isGroupMsg ? groupAdmins.includes(botNumber + '@c.us') : false | ||
const isBanned = ban.includes(chatId) | ||
const botadmins = await client.getGroupAdmins('919744375687[email protected]') | ||
const isbotadmin = sender.id.includes(botadmins) | ||
const owner = '919744375687' // eg 9190xxxxxxxx@ | ||
const isowner = sender.id+'@c.us' == owner | ||
|
||
msgFilter.addFilter(from) | ||
|
||
|
@@ -93,9 +91,9 @@ module.exports = msgHandler = async (client, message) => { | |
return console.log(err) | ||
} | ||
var postData = { | ||
api_key: 'LBtGgqqQpp663mo1nIEADPcv1AddeLtb', | ||
api_key: 'your_giphy_api_key', // https://devlopers.giphy.com | ||
file: { | ||
value: fs.createReadStream(filename), | ||
value: fs.createReadStream(filename), | ||
options: { | ||
filename: filename, | ||
contentType: 'image/gif' | ||
|
@@ -155,7 +153,7 @@ module.exports = msgHandler = async (client, message) => { | |
} | ||
break | ||
case 'bc': | ||
if(!isbotadmin) return client.reply(from, 'Only Bot admins!', message.id) | ||
if(!isowner) return client.reply(from, 'Only Bot admins!', message.id) | ||
let msg = body.slice(4) | ||
const chatz = await client.getAllChatIds() | ||
for (let ids of chatz) { | ||
|
@@ -165,7 +163,7 @@ module.exports = msgHandler = async (client, message) => { | |
client.reply(from, 'Broadcast Success!', message.id) | ||
break | ||
case 'ban': | ||
if(!isbotadmin) return client.reply(from, 'Only Bot admins can use this CMD!', message.id) | ||
if(!isowner) return client.reply(from, 'Only Bot admins can use this CMD!', message.id) | ||
for (let i = 0; i < mentionedJidList.length; i++) { | ||
ban.push(mentionedJidList[i]) | ||
fs.writeFileSync('./lib/banned.json', JSON.stringify(ban)) | ||
|
@@ -209,15 +207,15 @@ module.exports = msgHandler = async (client, message) => { | |
client.reply(from, 'Done!', message.id) | ||
break | ||
case 'clearall': | ||
if (!isbotadmin) return client.reply(from, 'Owner only', message.id) | ||
if (!isowner) return client.reply(from, 'Owner only', message.id) | ||
const allChatz = await client.getAllChats() | ||
for (let dchat of allChatz) { | ||
await client.deleteChat(dchat.id) | ||
} | ||
client.reply(from, 'Done', message.id) | ||
break | ||
case 'unban': | ||
if(!isbotadmin) return client.reply(from, 'Only bot admins can use this CMD', message.id) | ||
if(!isowner) return client.reply(from, 'Only bot admins can use this CMD', message.id) | ||
let inx = ban.indexOf(mentionedJidList[0]) | ||
ban.splice(inx, 1) | ||
fs.writeFileSync('./lib/banned.json', JSON.stringify(ban)) | ||
|
@@ -265,7 +263,6 @@ module.exports = msgHandler = async (client, message) => { | |
await client.sendTextWithMentions(from, `Demoted @${mentionedJidList[0].replace('@c.us', '')}.`) | ||
break | ||
case 'join': | ||
if (chat.id == invitegrp) { | ||
if (args.length == 0) return client.reply(from, 'Wrong Format', message.id) | ||
const link = body.slice(6) | ||
const minMem = 30 | ||
|
@@ -278,7 +275,6 @@ module.exports = msgHandler = async (client, message) => { | |
}).catch(error => { | ||
client.reply(from, 'An error occured 💔️', message.id) | ||
}) | ||
} | ||
break | ||
case 'sauce': | ||
if (isMedia) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters