-
-
Save ADK-RICHU/9093d971432981a2d486b5509e328841 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| const { | |
| Function, | |
| isPublic, | |
| getJson, | |
| prefix | |
| } = require("../lib/"); | |
| Function({ | |
| pattern: 'joke ?(.*)', | |
| fromMe: isPublic, | |
| desc: 'Funny jokes', | |
| type: 'fun' | |
| }, async (m, text, client) => { | |
| let imgs = ["https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTrFBYrhQhs_Rdv2vq_6jT-lfJHMJq39sr9Pw&usqp=CAU", "https://i.imgur.com/BfcYBnE.jpeg", "https://i.imgur.com/t8aUdZS.jpeg", "https://i.imgur.com/RWG58nL.jpeg", "https://i.imgur.com/xdvaMaN.jpeg", "https://i.imgur.com/X4wT8Lq.jpeg", "https://i.imgur.com/FIxdk2D.jpeg"] | |
| let image = imgs[Math.floor(Math.random() * imgs.length)] | |
| var { | |
| joke | |
| } = await getJson("https://some-random-api.ml/joke") | |
| const buttons = [{ | |
| buttonId: prefix + 'joke', | |
| buttonText: { | |
| displayText: 'Next ➩' | |
| }, | |
| type: 1 | |
| }] | |
| const buttonMessage = { | |
| image: { | |
| url: image | |
| }, | |
| caption: '```' + joke + '```', | |
| footer: '© ᴀᴅᴋ ʀᴉᴄⲏᴜ ᴘᴜʙᴌᴉᴄ ʙᴏᴛ', | |
| buttons: buttons, | |
| headerType: 4 | |
| } | |
| await client.sendMessage(m.jid, buttonMessage) | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment