-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nulis nulis2 slap
- Loading branch information
Showing
8 changed files
with
139 additions
and
10 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const { MessageType } = require('@adiwajshing/baileys') | ||
const { getBuffer } = require('../utils/functions') | ||
const { fetchJson } = require('../utils/fetcher') | ||
|
||
module.exports = { | ||
name: 'nulis', | ||
aliases: ['n'], | ||
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)) | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const { MessageType } = require('@adiwajshing/baileys') | ||
const { getBuffer } = require('../utils/functions') | ||
const { fetchJson } = require('../utils/fetcher') | ||
|
||
module.exports = { | ||
name: 'nulis2', | ||
aliases: ['n2'], | ||
description: 'Untuk menuliskan di buku bot\nPenggunaan !nulis _tulisan_', | ||
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)) | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module.exports = { | ||
name: 'slap', | ||
description: 'Untuk menampol orang\nPenggunaan !slap _tag_', | ||
execute (client, chat, pesan, args) { | ||
if (!client.isGroup) return client.reply(pesan.error.group) | ||
if (chat.message.extendedTextMessage === undefined || chat.message.extendedTextMessage === null) return client.reply('Tag target yang ingin di tonjok!') | ||
mentioned = chat.message.extendedTextMessage.contextInfo.mentionedJid | ||
const tagList = [] | ||
const dari = client.sender | ||
const target = mentioned[0] | ||
tagList.push(dari, target) | ||
const data = [ | ||
`@${dari.split('@')[0]} melempar *pisang busuk* ke @${target.split('@')[0]}`, | ||
`@${dari.split('@')[0]} bersiap-siap untuk melempar *sekop* ke @${target.split('@')[0]}`, | ||
`@${dari.split('@')[0]} manapar dengan keras @${target.split('@')[0]} dengan *50jt TON truk*`, | ||
`@${dari.split('@')[0]} mulai *memukul* @${target.split('@')[0]} dengan sendok`, | ||
`@${dari.split('@')[0]} menjatuhkan *meteor* ke @${target.split('@')[0]}`, | ||
`@${dari.split('@')[0]} bersiap-siap *me-rasengan* @${target.split('@')[0]}`, | ||
`@${dari.split('@')[0]} menulis nama @${target.split('@')[0]} di *death note*` | ||
] | ||
const dataslap = data[Math.floor(Math.random() * data.length)] | ||
client.mentions(`${dataslap}`, tagList, true) | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
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; | ||
}; | ||
|
||
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 } | ||
} | ||
|
||
exports.fetchJson = fetchJson = (url, options) => new Promise(async (resolve, reject) => { | ||
fetch(url, options) | ||
.then(response => response.json()) | ||
.then(json => { | ||
// console.log(json) | ||
resolve(json) | ||
}) | ||
.catch((err) => { | ||
reject(err) | ||
}) | ||
}) | ||
|
||
|
||
exports.fetchText = fetchText = (url, options) => new Promise(async (resolve, reject) => { | ||
fetch(url, options) | ||
.then(response => response.text()) | ||
.then(text => { | ||
// console.log(text) | ||
resolve(text) | ||
}) | ||
.catch((err) => { | ||
reject(err) | ||
}) | ||
}) | ||
|
||
//exports.getBase64 = getBase64; |
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