MCPcopy Create free account
hub / github.com/Xchristech2/Zenitsu-Bot / clearCommand

Function clearCommand

commands/clear.js:1–13  ·  view source on GitHub ↗
(sock, chatId)

Source from the content-addressed store, hash-verified

1async 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
15module.exports = { clearCommand };

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected