I am intending for my bot to allow only "ew" to be sent in chat. I have resolved majority of the work-arounds, however, there is one I can't resolve independently. When someone posts "ew" in chat and then edits the message to something else, it remains like that without being deleted.
How could I resolve this?
When you click on (edited), you can see the versions of the message who as edited...
Edit the message, then click the checkmark button to send the edited message. You will now see the updated message with the “Edited” tag in the chat.
client.on('messageUpdate')
should trigger everytime a message (in cache) is edited. I'm pretty sure you will not get the event if the message was sent when the bot was offline. But you could fetch the messages when the bot starts.
client.on('messageUpdate', (oldMessage, newMessage) => {
if(newMessage.content != "ew"){
newMessage.delete(); // for example
}
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With