rework event handling and rework how extensions are set up#2045
Merged
Conversation
Naamloos
approved these changes
Jul 31, 2024
Naamloos
left a comment
Member
There was a problem hiding this comment.
Generally LGTM. Some discussion points but nothing major. Ping me in the server if you want to discuss any.
Seems ready for testing, at least.
Member
Author
|
tested, documented, should be rtm as far as i'm concerned |
Plerx2493
approved these changes
Aug 11, 2024
VelvetToroyashi
left a comment
Member
There was a problem hiding this comment.
Overall looks good! Some small things I caught at a glance, but this is definitely a huge step forward.
Member
Author
|
|
OoLunar
pushed a commit
that referenced
this pull request
Oct 3, 2024
* implement canonicalization of events and rewire Dispatch * this is miserable * remove legacy event hooks * type safety is an obstacle /s * CommandsNext * VoiceNext * SlashCommands * lavalink is dead, so just make sure it compiles * actually remove the old event handling code * interactivity support * update tests * delete legacy BaseExtension * internal convenience for interactivity * make the extensions disposable * shaking my head * fix the return type * this was solved differently in master * update docs * pr feedback
Instellate
pushed a commit
that referenced
this pull request
Nov 4, 2024
* implement canonicalization of events and rewire Dispatch * this is miserable * remove legacy event hooks * type safety is an obstacle /s * CommandsNext * VoiceNext * SlashCommands * lavalink is dead, so just make sure it compiles * actually remove the old event handling code * interactivity support * update tests * delete legacy BaseExtension * internal convenience for interactivity * make the extensions disposable * shaking my head * fix the return type * this was solved differently in master * update docs * pr feedback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IEventHandler<TEventArgs>. these can be registered usingEventHandlingBuilder.AddEventHandlers<T>(ServiceLifetime); a type can contain an indefinite amount of handlers and the type will have a respected service lifetime according to the parameter.IServiceCollection.AddExtension(Action<Extension> setup, ExtensionConfiguration);, with matching methods onDiscordClientBuilder, following anUseExtensionscheme according to past convention (open to changing this).setupparameter fills the need for calling additional configuration on the extension, so for example the following code would be refactored as followssetupparametercloses #1820 as complete