Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added ICommandSender to Kicking/Banning EventArgs #436

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

Banalny-Banan
Copy link

@Banalny-Banan Banalny-Banan commented Feb 13, 2025

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentations

Submission checklist

  • I have checked the project can be compiled
  • I have tested my changes and it worked as expected

Patches (if there are any changes related to Harmony patches)

  • I have checked no IL patching errors in the console

Other

  • Still requires more testing

@Banalny-Banan Banalny-Banan changed the title Added ICommandSender to Kicking/Banning EventArgs feat: Added ICommandSender to Kicking/Banning EventArgs Feb 13, 2025
@VALERA771
Copy link

Why we need sender here? Only case of issuer will be host and we can explicitly set issuer to host in this case

@Banalny-Banan
Copy link
Author

Banalny-Banan commented Feb 13, 2025

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.

@louis1706 louis1706 requested a review from VALERA771 February 13, 2025 20:32
@louis1706 louis1706 merged commit 1c27f25 into ExMod-Team:dev Feb 14, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants