Last active
July 21, 2025 19:53
-
-
Save Corex24/4cda3737d3d7ea319eecdb6e68042acb 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
| //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