-
-
Save A-d-i-t-h-y-a-n/15feb2217e6bedb9af9ccf289c3d38a1 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: 'Funny Jokes 🤣', | |
| 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