feat: Added ICommandSender to Kicking/Banning EventArgs#436
feat: Added ICommandSender to Kicking/Banning EventArgs#436louis1706 merged 1 commit intoExMod-Team:devfrom
Conversation
|
Why we need sender here? Only case of issuer will be host and we can explicitly set issuer to host in this case |
As explained in the description, plugins can implement their own ICommandSender types that contain extra data, which is currently not available in the event. My use case is a discord bot that allows executing server commands, and implements DiscordCommandSender, that contains discord id of the user. Another plugin of mine logs each ban/kick that happens on the server, and the problem I have is that I was unable to retrieve the discord id of the user in OnBanning/OnKicking events. I think there can be other devs having similar issues with how the event works currently, that's why I'm suggesting adding the sender object to EventArgs. |
Description
Describe the changes
This pull request adds ICommandSender to Kicking and Banning EventArgs. This might be useful when devs make a custom CommandSender class that contains extra data (e.g. DiscordCommandSender), but currently it just gets turned into Server.Host in the events.
What is the current behavior? (You can also link to an open issue here)
😭
What is the new behavior? (if this is a feature change)
😊
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
It does not
Types of changes
Submission checklist
Patches (if there are any changes related to Harmony patches)
Other