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