Skip to content

Instantly share code, notes, and snippets.

@Corex24
Last active July 21, 2025 19:53
Show Gist options
  • Select an option

  • Save Corex24/4cda3737d3d7ea319eecdb6e68042acb to your computer and use it in GitHub Desktop.

Select an option

Save Corex24/4cda3737d3d7ea319eecdb6e68042acb to your computer and use it in GitHub Desktop.
//Created by Corex
//wa.me/2348036869669
//๐Ÿ’™
//levanter
const axios = require('axios')
const { bot } = require('../lib/')
bot(
{
pattern: 'randomqt ?(.*)',
fromMe: true,
desc: 'Send a random inspirational quote fetched from ZenQuotes API',
type: 'text',
},
async (message) => {
try {
// Making a GET request to the ZenQuotes API to get a random quote
const response = await axios.get('https://zenquotes.io/api/random')
// Extracting the quote from the response
const randomQuote = response.data[0].q
// Format the message with the quote
const finalMessage = `"${randomQuote}"\n\n\n--๐ถ๐›ฉ๐‘…๐›ฏ๐›ธ ๐›ฅ๐›ฎ๐‘‡๐›จ๐›ฉ๐›ฎ๐‘Œ--`
// Send the formatted message to the user
await message.send(finalMessage)
} catch (error) {
// If there's an error, notify the user
await message.send("Sorry, I couldn't fetch a quote right now.")
}
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment