(sock, chatId)
| 1 | async function clearCommand(sock, chatId) { |
| 2 | try { |
| 3 | const message = await sock.sendMessage(chatId, { text: 'Clearing bot messages...' }); |
| 4 | const messageKey = message.key; // Get the key of the message the bot just sent |
| 5 | |
| 6 | // Now delete the bot's message |
| 7 | await sock.sendMessage(chatId, { delete: messageKey }); |
| 8 | |
| 9 | } catch (error) { |
| 10 | console.error('Error clearing messages:', error); |
| 11 | await sock.sendMessage(chatId, { text: 'An error occurred while clearing messages.' }); |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | module.exports = { clearCommand }; |
nothing calls this directly
no outgoing calls
no test coverage detected