how to delete a message by its id

The solution for “how to delete a message by its id” can be found here. The following code will assist you in solving the problem.

// channel: the channel you want the message to be sent in
// lastmsg: the id of the last poll message

channel.fetchMessage(lastmsg).then(msg => msg.delete());

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

inline scripts encapsulated in