16 lines
368 B
Go
16 lines
368 B
Go
package discord
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/disgoorg/disgo/bot"
|
|
"github.com/disgoorg/disgo/discord"
|
|
)
|
|
|
|
func RegisterCommands(client *bot.Client, definitions []discord.ApplicationCommandCreate) error {
|
|
if _, err := client.Rest.SetGlobalCommands(client.ApplicationID, definitions); err != nil {
|
|
return fmt.Errorf("registering commands: %w", err)
|
|
}
|
|
return nil
|
|
}
|