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

[Bug]: Moderation commands throw an error when trying to take action on user that has left server #192

Closed
sloth-ontabasco opened this issue Mar 9, 2024 · 2 comments · Fixed by #203
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@sloth-ontabasco
Copy link
Member

Discord Contact Details

183092910495891467

Title

Mod commands fail when trying to take action on non existent server member

Reproduction Steps

  • Run a moderation command that takes in a user ID as input
  • Ensure the said user has left the server

Expected Results

Command informs the user that member is not present in the server

Actual Results

An unhandled exception is thrown

Relevant log output

https://discord.com/channels/414027124836532234/865321589919055882/1216113853918613607

System Information

No response

@sloth-ontabasco sloth-ontabasco added bug Something isn't working good first issue Good for newcomers labels Mar 9, 2024
@arcinfini
Copy link
Contributor

To further the information on this.

The mod commands mute, unmute, kick, and warn all use a MemberTransformer to collect the member to take action on. The ban command is the only command to take a User. This allows the banning of members not currently within the server.

The commands mute, unmute, and kick all require a member object to proceed with the action.


Therefore warn should be changed to not require a member object. For the remaining commands requiring a member object, stronger error information should be provided.

@arcinfini arcinfini linked a pull request Apr 2, 2024 that will close this issue
9 tasks
@arcinfini
Copy link
Contributor

This has now been implemented into master. Error handling will share if the member cannot be resolved in argument transformation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants