Git Product home page Git Product logo

Comments (5)

stemount avatar stemount commented on May 27, 2024 3

this rocks

from eddiebot.

eddiejaoude avatar eddiejaoude commented on May 27, 2024 1

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 πŸ‘

from eddiebot.

BOLT04 avatar BOLT04 commented on May 27, 2024

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.

from eddiebot.

eddiejaoude avatar eddiejaoude commented on May 27, 2024

Oh awesome πŸ‘ . Thanks for the example πŸ€“

from eddiebot.

BOLT04 avatar BOLT04 commented on May 27, 2024

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

from eddiebot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.