(sock, chatId, message)
| 1 | const fetch = require('node-fetch'); |
| 2 | |
| 3 | async function dareCommand(sock, chatId, message) { |
| 4 | try { |
| 5 | const shizokeys = 'shizo'; |
| 6 | const res = await fetch(`https://shizoapi.onrender.com/api/texts/dare?apikey=${shizokeys}`); |
| 7 | |
| 8 | if (!res.ok) { |
| 9 | throw await res.text(); |
| 10 | } |
| 11 | |
| 12 | const json = await res.json(); |
| 13 | const dareMessage = json.result; |
| 14 | |
| 15 | // Send the dare message |
| 16 | await sock.sendMessage(chatId, { text: dareMessage }, { quoted: message }); |
| 17 | } catch (error) { |
| 18 | console.error('Error in dare command:', error); |
| 19 | await sock.sendMessage(chatId, { text: '❌ Failed to get dare. Please try again later!' }, { quoted: message }); |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | module.exports = { dareCommand }; |
nothing calls this directly
no outgoing calls
no test coverage detected