discordgo
discordgo copied to clipboard
Slash commands missing features
In #856 slash commands were implemented. From what I've noticed, these are missing two features.
The first is global slash commands working in DMs (documented here). With the current behaviour, using a slash command in DMs will result in a Runtime error as the Guild ID and member objects are null, instead using a user object.
The second is that there is no method to bulk update slash commands. While this technically hasn't been documented, it was announced in the discord developers server here and is considered stable. This method is necessary for updating several commands at once, including creating, editing and deleting with 1 API request, instead of the several that would otherwise be used.
These should both be relatively easy to change.
The permissions field also appears to be missing from the interaction object. See the links below.
https://discord.com/developers/docs/resources/guild#guild-member-object https://discord.com/developers/docs/interactions/slash-commands#receiving-an-interaction https://github.com/bwmarrin/discordgo/blob/182d9b48f34b19f51cc5a88868a5477e52c02776/interactions.go#L70 https://github.com/bwmarrin/discordgo/blob/182d9b48f34b19f51cc5a88868a5477e52c02776/structs.go#L767
I opened a pr for bulk overwriting/updating https://github.com/bwmarrin/discordgo/pull/926
the permissions field has already been implemented