Skip to content

Add arbitrary JDA event support #237

Closed

Description

@Zabuzard

The command system, as of now, only supports SlashCommands. However, we slowly get more and more commands with a need to listen for any sort of events.

While we do favor offering specific solutions (SlashCommands, MessageListener, ...), we should also offer a catch-them-all solution where commands can just listen to all incoming JDA events. It should be well integrated with existing solutions, i.e. it should be possible to create a slash command that also receives all other events (for example if using the interfaces).

There is no need to put a lot of effort into the arbitrary event support, since it is only meant as backup solution in case we do not offer more concrete and specific support. Commands that need this are for example the mod audit system (#225 )

Activity

  1. added this to the Improvement phase 1 milestone on Oct 30, 2021
  2. github-actions commented on Dec 17, 2021

    @github-actions

    This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

  3. Zabuzard commented on Dec 17, 2021

    @Zabuzard
    MemberAuthor

    This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

    This is actually still relevant, we need it at some point.

  4. github-actions commented on Jan 17, 2022

    @github-actions

    This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

  5. Tais993 commented on Jan 17, 2022

    @Tais993
    Member

    How would you see it exactly implemented then?

    You mean addition of a class that extends both the SlashCommand thing and ListenerAdapter, and adding a class which contains a list of all EventListeners? This way it stays optional, and works with SlashCommand's

  6. Zabuzard commented on Jan 17, 2022

    @Zabuzard
    MemberAuthor

    You mean addition of a class that extends both the SlashCommand thing and ListenerAdapter, and adding a class which contains a list of all EventListeners? This way it stays optional, and works with SlashCommand's

    No, I would seperate it from SlashCommand. 2 separate interfaces and 2 separate adapters with 2 separate flows in the command system.

    And if someone really needs, they can still create a class that implements both interfaces (and for example forwards to both adapters) but that will be custom then.

  7. Zabuzard commented on Jan 17, 2022

    @Zabuzard
    MemberAuthor

    Basically, the command system should offer a way to register a EventListener and manage it accordingly (could be as simple as just jda.addEventListener(listener) in the command system). In parallel to the existing slash command setup.

  8. Tais993 commented on Jan 17, 2022

    @Tais993
    Member

    Issue with this is that you'll get bad UX, you can't both use ListenerAdapter and the SlashCommand adapter

  9. Zabuzard commented on Jan 17, 2022

    @Zabuzard
    MemberAuthor

    Issue with this is that you'll get bad UX, you can't both use ListenerAdapter and the SlashCommand adapter

    I do not think we will have a lot of people who need that both. But still, the crucial part is not that the adapter allow combination but that the interfaces do - and they do.

    Our design is based on the interfaces; we are not forced to use the adapters.

    Putting event-capabilities into slash commands would mean you overload the class/interface with more and more stuff that regular users, such as /ping or similar just never asked for, which is equally not good.

  10. self-assigned this
    on Jan 17, 2022
  11. linked a pull request that will close this issueAdd Message and Event receivers #345on Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementpriority: normal

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions