Closed daniwasonline closed 6 months ago
I accidentally pushed the Actions stuff into this refactor, so I'll have to add it as a new part of the PR itself. Requesting re-review.
This pull request adds support for Discord's Context Menu Interactions. In SpongeChat, these are referred to as "Actions".
Other functions that may be more suitable as an Action than a regular Command will be added in the future (see: #57). Adding first-class support for them will be extremely useful for future usage and will reduce the total clutter / technical debt that adding such a feature may otherwise add.
Description
Currently, the
interactionCreate
event is colocated within the event register; this is because of the command map, which is passed into the register.This PR moves
interactionCreate
to its' own module (similar to the other events). The command map is passed into theclient
context, which is then accessed byinteractionCreate
during command runs.Why is this useful?
The colocation of
interactionCreate
in the register may be confusing to contributors, and/or it may be treated "specially". This shouldn't be the case.