1message.reply('Invalid command')
2 .then(msg => {
3 msg.delete({ timeout: 20000 /*time unitl delete in milliseconds*/});
4 })
5 .catch(/*Your Error handling if the Message isn't returned, sent, etc.*/);
1client.on('messageDelete', (messageDelete) => {
2 //Your code
3});
4
5//Note, you have to define client.
6//Its best to run these events through something called a "event handler"
1message.channel.send("Hello World!").then(msg=>msg.delete({timeout:"2000"/*Time until delete in milliseconds*/})
1// ASSUMPTIONS:
2// channel: the channel you want the message to be sent in
3// lastmsg: the id of the last poll message
4
5channel.fetchMessage(lastmsg).then(msg => msg.delete());
6