Search code examples
discorddiscord-jda

JDA - slash command event?


is it possible to execute an event when user is using slash command to other bot? Example: something as counter for user's executed commands. (fe. user is typing /ban [...] (in slash command) and it will be executed by other bot and mine (for just counting). I hope you understood me good.


Solution

  • No, that's not possible since the slash command is passed directly to the corresponding bot without other users or bots having the possibility to access or receive it.

    If both bots are yours you might be able to implement a notification that is sent by one bot to another.

    Another possibility is reading from the audit log of the guild, but iirc it's not failproof and might be hard to implement correctly.