| 5 | description: 'Get a random quote', |
| 6 | usage: '.quote', |
| 7 | async handler(sock, message, args, context) { |
| 8 | const chatId = context.chatId || message.key.remoteJid; |
| 9 | try { |
| 10 | const apiKey = 'shizo'; |
| 11 | const res = await fetch(`https://shizoapi.onrender.com/api/texts/quotes?apikey=${apiKey}`); |
| 12 | if (!res.ok) |
| 13 | throw await res.text(); |
| 14 | const json = await res.json(); |
| 15 | const quoteMessage = json.result; |
| 16 | await sock.sendMessage(chatId, { text: quoteMessage }, { quoted: message }); |
| 17 | } |
| 18 | catch (error) { |
| 19 | console.error('Quote Command Error:', error); |
| 20 | await sock.sendMessage(chatId, { |
| 21 | text: '❌ Failed to get quote. Please try again later!' |
| 22 | }, { quoted: message }); |
| 23 | } |
| 24 | } |
| 25 | }; |