momentum-mod / discord-bot

The Discord bot used in the official Momentum Mod Discord Server.
https://discord.gg/momentummod
MIT License
9 stars 7 forks source link

Slash command #106

Closed BIRD311 closed 2 years ago

BIRD311 commented 2 years ago

changed commands to slash commands The bot needs applications.commands permissions as mentioned in https://github.com/DSharpPlus/DSharpPlus/blob/master/DSharpPlus.SlashCommands/README.md Registering the slashcommands without a guildID takes some time and you can add it for testing (this is also in the README) However after running both I got duplicate commands and only one of the works depending on the the bot is currently running. The only way I was able the remove them was to register an empty class. Just wanted to mention this because it took me a while to figure out why some commands didn't go away after removing them.

I had to change the Info commands because apparently we can't overload slash commands. You could probably change the argument to SnowflakeObject and cast it inside but I liked this better. Aliases seemed unnecessary because you get auto completion so I didn't add those commands.

I had to make changes to the build script and the nuget.config to be able to run this before even make any changes and I have included this here too. I also added .vscode files so I was able to just run this locally without docker and debug there.

tsa96 commented 2 years ago

Looking great, asked Goc to run through everything real quick then we can get this in tonight.