(sock, message, _args, _context)
| 5 | description: 'Roll a random dice sticker', |
| 6 | usage: '.dado', |
| 7 | async handler(sock, message, _args, _context) { |
| 8 | const chatId = message.key.remoteJid; |
| 9 | const diceLinks = [ |
| 10 | 'https://tinyurl.com/gdd01', |
| 11 | 'https://tinyurl.com/gdd02', |
| 12 | 'https://tinyurl.com/gdd003', |
| 13 | 'https://tinyurl.com/gdd004', |
| 14 | 'https://tinyurl.com/gdd05', |
| 15 | 'https://tinyurl.com/gdd006' |
| 16 | ]; |
| 17 | const randomDice = diceLinks[Math.floor(Math.random() * diceLinks.length)]; |
| 18 | try { |
| 19 | await sock.sendMessage(chatId, { |
| 20 | sticker: { url: randomDice } |
| 21 | }, { quoted: message }); |
| 22 | } |
| 23 | catch (e) { |
| 24 | console.error('Dice Plugin Error:', e); |
| 25 | await sock.sendMessage(chatId, { |
| 26 | image: { url: randomDice }, |
| 27 | caption: '🎲 The dice rolled!' |
| 28 | }, { quoted: message }); |
| 29 | } |
| 30 | } |
| 31 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected