Eddiebot: When using the standup command, can it remove the original message?

Created on 5 Jun 2020  路  5Comments  路  Source: EddieJaoudeCommunity/EddieBot

Most helpful comment

this rocks

All 5 comments

I believe this can be done by deleting the message that started the command, like

if (message.deletable) {
  message.delete();
}

But to only do this on a particular command, we would need the command handler to receive the message parameter.

Oh awesome 馃憤 . Thanks for the example 馃

I've tested the delete method, and in order for the bot to execute it it needs the "Manage Messages" permission:
imagem

or this error occurs:
imagem

I think our server has the bots role so maybe we could add the permission there or create a new role with it.


As for the message parameter on the command handlers, what do you guys think @garretcharp @eddiejaoude ? If we have it, this code that deletes the message would be only on the commands that want that. Also, we could have access to more information when creating the embed like adding message.author.username

Sounds good. Having access to the username would be good to include in the bot's response. Could pass it as a 3rd parameter?

Good spot on the bots role, I have now added that permission to that role 馃憤

this rocks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

schmelto picture schmelto  路  5Comments

eddiejaoude picture eddiejaoude  路  5Comments

mikeysan picture mikeysan  路  7Comments

okutewonah picture okutewonah  路  3Comments

RaisinTen picture RaisinTen  路  6Comments