package api import ( "encoding/json" "github.com/diamondburned/arikawa/v3/discord" "github.com/diamondburned/arikawa/v3/utils/httputil" ) var EndpointApplications = Endpoint + "applications/" // CurrentApplication returns the current bot account's Discord application. It // can be used to get the application ID. func (c *Client) CurrentApplication() (*discord.Application, error) { var app *discord.Application return app, c.RequestJSON( &app, "GET", Endpoint+"/oauth2/applications/@me", ) } // https://discord.com/developers/docs/interactions/slash-commands#create-global-application-command-json-params type CreateCommandData struct { Name string `json:"name"` Description string `json:"description"` Options discord.CommandOptions `json:"options,omitempty"` NoDefaultPermission bool `json:"-"` Type discord.CommandType `json:"type,omitempty"` } func (c CreateCommandData) MarshalJSON() ([]byte, error) { type RawCreateCommandData CreateCommandData cmd := struct { RawCreateCommandData DefaultPermission bool `json:"default_permission"` }{RawCreateCommandData: (RawCreateCommandData)(c)} // Discord defaults default_permission to true, so we need to invert the // meaning of the field (>NoNo