Versions in this module Expand all Collapse all v0 v0.1.0 Dec 9, 2021 Changes in this version + const InteractionResponseID + func OAuth2AuthorizationURL(clientID string, opts *OAuth2Options) *url.URL + type ApplicationCommand struct + ApplicationID string + Description string + GuildID string + ID string + Name string + Options []*ApplicationCommandOption + type ApplicationCommandOption struct + Choices []*ApplicationCommandOptionChoice + Description string + Name string + Options []*ApplicationCommandOption + Required bool + Type ApplicationCommandOptionType + type ApplicationCommandOptionChoice struct + Name string + Value interface{} + type ApplicationCommandOptionType int + const OptionTypeBoolean + const OptionTypeChannel + const OptionTypeInteger + const OptionTypeMentionable + const OptionTypeNumber + const OptionTypeRole + const OptionTypeString + const OptionTypeSubCommand + const OptionTypeSubCommandGroup + const OptionTypeUser + type AuthHeader string + func BearerAuthorization(token string) AuthHeader + func BotAuthorization(token string) AuthHeader + func (auth AuthHeader) IsValid() bool + type AuthorizationInfo struct + Expires time.Time + Scopes []string + User *User + type ButtonStyle int + const ButtonStyleDanger + const ButtonStyleLink + const ButtonStylePrimary + const ButtonStyleSecondary + const ButtonStyleSuccess + type Channel struct + ApplicationID string + Bitrate int + GuildID string + ID string + Icon string + LastMessageID string + NSFW bool + Name string + OwnerID string + ParentID string + Position int + RateLimitPerUserSeconds int + Recipients []*User + Topic string + Type ChannelType + UserLimit int + type ChannelType int + const ChannelTypeDM + const ChannelTypeGroupDM + const ChannelTypeGuildCategory + const ChannelTypeGuildNews + const ChannelTypeGuildNewsThread + const ChannelTypeGuildPrivateThread + const ChannelTypeGuildPublicThread + const ChannelTypeGuildStageVoice + const ChannelTypeGuildStore + const ChannelTypeGuildText + const ChannelTypeGuildVoice + type Client struct + func NewClient(auth AuthHeader, opts *ClientOptions) *Client + func (c *Client) CreateDM(ctx context.Context, recipientID string) (*Channel, error) + func (c *Client) CreateGlobalApplicationCommand(ctx context.Context, cmd *ApplicationCommand) (id string, err error) + func (c *Client) CreateInteractionResponse(ctx context.Context, resp *InteractionResponse) error + func (c *Client) CreateMessage(ctx context.Context, params *CreateMessageParams) (*Message, error) + func (c *Client) CreateReaction(ctx context.Context, channelID, messageID, emoji string) error + func (c *Client) CurrentAuthorization(ctx context.Context) (*AuthorizationInfo, error) + func (c *Client) EditMessage(ctx context.Context, params *EditMessageParams) (*Message, error) + func (c *Client) EditWebhookMessage(ctx context.Context, resp *EditWebhookMessageParams) (*Message, error) + func (c *Client) GetChannel(ctx context.Context, id string) (*Channel, error) + func (c *Client) GetMessage(ctx context.Context, channelID, messageID string) (*Message, error) + func (c *Client) GetUser(ctx context.Context, id string) (*User, error) + func (c *Client) ListGlobalApplicationCommands(ctx context.Context, appID string) ([]*ApplicationCommand, error) + func (c *Client) OpenGateway(ctx context.Context) (*Gateway, error) + type ClientOptions struct + BaseURL *url.URL + HTTPClient *http.Client + UserAgent string + type Component struct + ButtonEmoji *Emoji + ButtonLabel string + ButtonStyle ButtonStyle + ButtonURL string + Components []*Component + CustomID string + Disabled bool + SelectMaxValues json.Number + SelectMinValues json.Number + SelectOptions []*SelectOption + SelectPlaceholder string + Type ComponentType + type ComponentType int + const ComponentTypeActionRow + const ComponentTypeButton + const ComponentTypeSelectMenu + type CreateMessageParams struct + ChannelID string + Components []*Component + Content string + MessageReference *MessageReference + TextToSpeech bool + type EditMessageParams struct + ChannelID string + Components []*Component + Content string + MessageID string + type EditWebhookMessageParams struct + Components []*Component + Content string + MessageID string + WebhookID string + WebhookToken string + type Emoji struct + Animated bool + Available bool + ID string + Managed bool + Name string + RequiresColons bool + User *User + type Gateway struct + func (g *Gateway) Close() error + func (g *Gateway) Listen(ctx context.Context) (*GatewayPayload, error) + func (g *Gateway) SetConnectFuncs(start, success func(ctx context.Context, isResume bool)) + func (g *Gateway) SetErrorFunc(f func(ctx context.Context, err error)) + func (g *Gateway) URL() *url.URL + func (g *Gateway) WaitForReady(ctx context.Context) error + type GatewayPayload struct + Data json.RawMessage + EventName string + OpCode int + SequenceNumber int64 + type GuildMember struct + Deaf bool + JoinedAt time.Time + Mute bool + Nickname string + Pending bool + Permissions string + Roles []string + User *User + type Interaction struct + ApplicationID string + ChannelID string + DMUser *User + Data *InteractionData + GuildID string + ID string + Member *GuildMember + Message *Message + Token string + Type InteractionRequestType + func (interaction *Interaction) User() *User + type InteractionCallbackFlags uint + const InteractionCallbackFlagEphemeral + type InteractionCallbackType int + const InteractionCallbackTypeChannelMessageWithSource + const InteractionCallbackTypeDeferredChannelMessageWithSource + const InteractionCallbackTypeDeferredUpdateMessage + const InteractionCallbackTypePong + const InteractionCallbackTypeUpdateMessage + type InteractionData struct + CommandName string + ComponentType ComponentType + CustomID string + ID string + Options []*ApplicationCommandOption + Values []string + type InteractionDataOption struct + Name string + Options []*InteractionDataOption + Type ApplicationCommandOptionType + Value interface{} + type InteractionRequestType int + const InteractionRequestTypeApplicationCommand + const InteractionRequestTypeMessageComponent + const InteractionRequestTypePing + type InteractionResponse struct + Data *InteractionResponseData + InteractionID string + InteractionToken string + Type InteractionCallbackType + type InteractionResponseData struct + Content string + Flags InteractionCallbackFlags + TextToSpeech bool + type Message struct + ApplicationID string + Author *User + ChannelID string + Components []*Component + Content string + GuildID string + ID string + Member *GuildMember + MentionEveryone bool + Nonce string + Pinned bool + Reactions []*Reaction + ReferencedMessage *MessageReference + TextToSpeech bool + Thread *Channel + Timestamp time.Time + Type MessageType + WebhookID string + func (msg *Message) User() *User + type MessageReference struct + ChannelID string + GuildID string + MessageID string + ResponseMessageID string + func (ref *MessageReference) ID() string + type MessageType int + const MessageTypeDefault + type OAuth2Options struct + BaseURL *url.URL + Permissions Permissions + RedirectURI string + Scopes []string + State string + type Permissions uint64 + const SendMessages + type Reaction struct + Count int + Emoji *Emoji + Me bool + type SelectOption struct + Default bool + Description string + Emoji *Emoji + Label string + Value string + type User struct + Avatar string + Bot bool + Discriminator string + Email string + ID string + Locale string + MFAEnabled bool + System bool + Username string + Verified bool + func (u *User) String() string