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.*/);
1"create a variable called id"
2var id
3"then inside your client message statement change id -> id = message.id"
4client.on('message', message => {
5 id = message.id
6});
7"inside your command type message.fetch(id).then(msg => msg.delete());"
8 if (message.content === !test)
9 message.fetch(id).then(msg => msg.delete());
10}});
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