Discord-Net-Labs / Discord.Net-Labs

An experimental fork of Discord.Net that implements the newest discord features for testing and development to eventually get merged into Discord.Net
https://labs.discordnet.dev
MIT License
156 stars 42 forks source link

Error-handling is not working #331

Closed aggiczy closed 2 years ago

aggiczy commented 2 years ago

Hi there,

The error handling (like RequireUserPermission's error if the user not have the permission) is not working. I checked v3.4.0 and in that version it's working properly but in v3.4.7 it's not. Please fix it!

Thanks, Aki26 GamePlay

Cenngo commented 2 years ago

You need to expand on "not working".

Are you saying that failed preconditions dont invoke the "CommandExecuted" event?

aggiczy commented 2 years ago

I'm saying that when I for example run a command and I have no permission for this command, the failed precondition is null.

Cenngo commented 2 years ago

In my testing i didnt encounter any unintended behaviour, failed preconditions seem to return a failed result as expected. Can you provide me with the necessary steps to reproduce this?

aggiczy commented 2 years ago

I just solve the problem with do the error handling not in the ExecuteCommandAsync Task, but in the _commands.CommandExecuted event. Thanks for the help, and sorry for the long respond-time.