zaanposni / discord-masz

MASZ is a selfhostable highly sophisticated moderation bot for Discord. Includes a web dashboard and a discord bot.
https://discord.gg/5zjpzw6h3S
Other
71 stars 18 forks source link

Better command handling for non-registered guilds #551

Closed FlixProd closed 1 year ago

FlixProd commented 1 year ago

Current Situation

Right now, if a command is executed in a guild that is not registered, the command fails. The user doesn't get an error message and an error in the logs appears.

discord_error logs

Improvement

Option A

The Discord API allows apps to register commands only per guild, so the bot could register the commands first when the guild is registered on the MASZ dashboard. When the guild is deleted from MASZ, the bot removes the slash commands again. To avoid confusion, only a /help command could remain, giving a brief explanation of why commands cannot be used. I prefer this option because it is very user friendly and straight-forward.

Option B

If option A is to complex to implement, at least a good error message should be implemented, saying something like You can't use commands here, because this guild is not registered on the MASZ instance. If you are the instance admin, you can register the guild on the dasboard: [link]

zaanposni commented 1 year ago

I agree, I will try to implement Option A. Might take until mid december, since I am preparing for a math exam ^.^

zaanposni commented 1 year ago

fixed in v3.3.0 release branch