(sock, message, args, context)
| 6 | usage: '.clear', |
| 7 | ownerOnly: true, |
| 8 | async handler(sock, message, args, context) { |
| 9 | const { chatId, channelInfo } = context; |
| 10 | try { |
| 11 | const sent = await sock.sendMessage(chatId, { |
| 12 | text: 'Clearing bot messages...', |
| 13 | ...channelInfo |
| 14 | }); |
| 15 | await new Promise(resolve => setTimeout(resolve, 1000)); |
| 16 | await sock.sendMessage(chatId, { delete: sent.key }); |
| 17 | } |
| 18 | catch (error) { |
| 19 | console.error('Error clearing messages:', error); |
| 20 | await sock.sendMessage(chatId, { |
| 21 | text: 'An error occurred while clearing messages.', |
| 22 | ...channelInfo |
| 23 | }, { quoted: message }); |
| 24 | } |
| 25 | } |
| 26 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected