kurzgesagt-in-a-nutshell / birdbot

A multipurpose bot for the kurzgesagt discord server
GNU General Public License v3.0
22 stars 5 forks source link

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

Closed sloth-ontabasco closed 6 months ago

sloth-ontabasco commented 7 months ago

Discord Contact Details

183092910495891467

Title

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

Reproduction Steps

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

arcinfini commented 7 months ago

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 commented 6 months ago

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