Skip to content

Instantly share code, notes, and snippets.

@ishkumarr
Created January 11, 2023 05:47
Show Gist options
  • Save ishkumarr/2565e8b8c297add86d83e8604f2b3505 to your computer and use it in GitHub Desktop.
Save ishkumarr/2565e8b8c297add86d83e8604f2b3505 to your computer and use it in GitHub Desktop.
const { Function,isPublic ,getJson } = require("../lib/");
Function({
pattern: 'arin ?(.*)',
fromMe: false,
desc: 'Sends template button image',
type: 'misc',
}, async (message, match) => {
const { content } = await getJson ('https://www.quotable.io/random')
const templateButtons = [
{index: 1, urlButton: {displayText: 'Github ♻️', url: 'https://github.com/arinsharma1979'}},
{index: 1, urlButton: {displayText: 'Instagram 📸', url: 'https://instagram.com/arinnsharma'}},
{index: 1, urlButton: {displayText: 'Take me to your ❤️', url: 'https://youtu.be/eYuUAGXN0KM'}},
]
const templateMessage = {
image: {url: 'https://imgur.io/09HzSRs?r.jpeg'},
caption: `${content}`,
footer: 'by Arin',
templateButtons: templateButtons
}
await message.client.sendMessage(message.chat, templateMessage)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment