Documentation ¶
Index ¶
- func SetHttpClient(newClient http.Client)
- type ActionRow
- type AllowedMentions
- type Application
- type ApplicationCommandData
- type ApplicationCommandOption
- type Attachment
- type AutoCompleteChoice
- type AutocompleteCallbackData
- type Button
- type Channel
- type ChannelMention
- type DefaultReaction
- type Embed
- type EmbedAuthor
- type EmbedError
- type EmbedField
- type EmbedFooter
- type EmbedImage
- type EmbedProvider
- type EmbedVideo
- type Emoji
- type ErrComponentMissingProperty
- type ErrComponentMustHaveCustomId
- type ErrComponentMustHaveStyle
- type ErrInvalidParseGroup
- type ErrInvalidPropertyLength
- type ErrLinkButtonCannotHaveCustomId
- type ErrLinkButtonMustHaveUrl
- type ErrNestedActionRow
- type ErrNonLinkButtonCannotHaveUrl
- type ErrNonStringSelectMenuCannotHaveOptions
- type ErrSelectOptionMustHaveLabel
- type ErrSelectOptionMustHaveValue
- type ErrStringSelectMenuMustHaveOptions
- type ErrTooManyComponents
- type Guild
- type InstallParams
- type Interaction
- func (interaction *Interaction) CreateResponse(response InteractionResponse) error
- func (interaction *Interaction) DeferResponse(isEphemeral bool) error
- func (interaction *Interaction) DeleteResponse() error
- func (interaction *Interaction) EditResponse(data ResponseEditData) error
- func (interaction *Interaction) GetResponse() (*Message, error)
- func (interaction *Interaction) GetWebhook() *Webhook
- func (interaction *Interaction) IsPing() bool
- func (interaction *Interaction) UnmarshalJSON(d []byte) error
- type InteractionCallbackData
- type InteractionData
- type InteractionResponse
- type Member
- type Message
- type MessageActivity
- type MessageCallbackData
- type MessageComponent
- type MessageComponentData
- type MessageComponentWrapper
- type MessageInteraction
- type MessageReference
- type ModalCallback
- type ModalSubmitData
- type Overwrite
- type Permissions
- type Reaction
- type ResolvedData
- type ResponseEditData
- type Role
- type RoleSubscriptionData
- type RoleTags
- type SelectMenu
- type SelectOption
- type Snowflake
- type Sticker
- type StickerItem
- type Tag
- type Team
- type TeamMember
- type TextInput
- type ThreadMember
- type ThreadMetadata
- type User
- type Webhook
- func (hook *Webhook) DeleteMessage(messageId string) error
- func (hook *Webhook) EditMessage(messageId string, data ResponseEditData) error
- func (hook *Webhook) GetMessage(req WebhookGetMessageRequest) (message *Message, err error)
- func (hook *Webhook) GetUrl() string
- func (hook *Webhook) Send(req WebhookRequest) (returnedMessage *Message, err error)
- type WebhookGetMessageRequest
- type WebhookMessageResponse
- type WebhookRequest
- type WelcomeScreen
- type WelcomeScreenChannel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetHttpClient ¶ added in v0.5.6
Types ¶
type ActionRow ¶ added in v0.5.0
type ActionRow struct { RowType component_type.ComponentType `json:"type"` Components []MessageComponent `json:"components"` }
func (*ActionRow) MarshalJSON ¶ added in v0.5.0
func (*ActionRow) Type ¶ added in v0.5.0
func (a *ActionRow) Type() component_type.ComponentType
func (*ActionRow) UnmarshalDynamoDBAttributeValue ¶ added in v0.5.4
func (a *ActionRow) UnmarshalDynamoDBAttributeValue(value *dynamodb.AttributeValue) (err error)
func (*ActionRow) UnmarshalJSON ¶ added in v0.5.0
type AllowedMentions ¶
type AllowedMentions struct { Parse []allowed_mention_type.AllowedMentionType `json:"parse"` Roles []Snowflake `json:"roles"` Users []Snowflake `json:"users"` RepliedUser bool `json:"replied_user"` }
func (AllowedMentions) Verify ¶ added in v0.5.0
func (allowedMentions AllowedMentions) Verify() error
type Application ¶ added in v0.1.4
type Application struct { Id Snowflake `json:"id"` Name string `json:"name"` Icon string `json:"icon"` Description string `json:"description"` RpcOrigins []string `json:"rpc_origins,omitempty"` BotPublic bool `json:"bot_public"` BotRequireCodeGrant bool `json:"bot_require_code_grant"` TermsOfServiceUrl *string `json:"terms_of_service_url,omitempty"` PrivacyPolicyUrl *string `json:"privacy_policy_url,omitempty"` Owner *User `json:"owner,omitempty"` VerifyKey string `json:"verify_key"` Team *Team `json:"team,omitempty"` GuildId *Snowflake `json:"guild_id,omitempty"` PrimarySkuId *Snowflake `json:"primary_sku_id,omitempty"` Slug *string `json:"slug,omitempty"` CoverImage *string `json:"cover_image,omitempty"` Flags *uint `json:"flags,omitempty"` Tags []string `json:"tags,omitempty"` InstallParams *InstallParams `json:"install_params,omitempty"` CustomInstallUrl *string `json:"custom_install_url,omitempty"` RoleConnectionsVerificationUrl *string `json:"role_connections_verification_url,omitempty"` }
type ApplicationCommandData ¶ added in v0.5.0
type ApplicationCommandData struct { Id Snowflake `json:"id"` Name string `json:"name"` Type command_type.ApplicationCommandType `json:"type"` Resolved *ResolvedData `json:"resolved,omitempty"` Options []ApplicationCommandOption `json:"options,omitempty"` GuildId *Snowflake `json:"guild_id,omitempty"` TargetId *Snowflake `json:"target_id,omitempty"` // contains filtered or unexported fields }
func (*ApplicationCommandData) GetOption ¶ added in v0.5.0
func (commandData *ApplicationCommandData) GetOption(optionName string) *ApplicationCommandOption
type ApplicationCommandOption ¶ added in v0.5.0
type ApplicationCommandOption struct { Name string `json:"name"` Type command_option_type.CommandOptionType `json:"type"` Value interface{} `json:"value,omitempty"` Options []ApplicationCommandOption `json:"options,omitempty"` Focused bool `json:"focused,omitempty"` }
type Attachment ¶
type Attachment struct { ID Snowflake `json:"id"` Filename string `json:"filename"` Description *string `json:"description,omitempty"` ContentType *string `json:"content_type,omitempty"` Size int `json:"size"` URL string `json:"url"` ProxyURL string `json:"proxy_url"` Height *int `json:"height,omitempty"` Width *int `json:"width,omitempty"` Ephemeral *bool `json:"ephemeral,omitempty"` }
type AutoCompleteChoice ¶ added in v0.5.0
type AutocompleteCallbackData ¶ added in v0.5.0
type AutocompleteCallbackData struct {
Choices []AutoCompleteChoice `json:"choices"`
}
type Button ¶ added in v0.5.0
type Button struct { Style button_style.ButtonStyle `json:"style"` Label *string `json:"label,omitempty"` Emoji *Emoji `json:"emoji,omitempty"` CustomId *string `json:"custom_id,omitempty"` Url *string `json:"url,omitempty"` Disabled *bool `json:"disabled,omitempty"` ButtonType component_type.ComponentType `json:"type"` }
func (*Button) MarshalJSON ¶ added in v0.5.0
func (*Button) Type ¶ added in v0.5.0
func (button *Button) Type() component_type.ComponentType
type Channel ¶ added in v0.1.9
type Channel struct { Id Snowflake `json:"id"` Type channel_type.ChannelType `json:"type"` GuildId *Snowflake `json:"guild_id,omitempty"` Position *int `json:"position,omitempty"` PermissionOverwrites []Overwrite `json:"permission_overwrites,omitempty"` Name *string `json:"name,omitempty"` Topic *string `json:"topic,omitempty"` Nsfw *bool `json:"nsfw,omitempty"` LastMessageId *Snowflake `json:"last_message_id,omitempty"` Bitrate *int `json:"bitrate,omitempty"` UserLimit *int `json:"user_limit,omitempty"` RateLimitPerUser *int `json:"rate_limit_per_user,omitempty"` Recipients []User `json:"recipients,omitempty"` Icon *string `json:"icon,omitempty"` OwnerId *Snowflake `json:"owner_id,omitempty"` ApplicationId *Snowflake `json:"application_id,omitempty"` Managed *bool `json:"managed,omitempty"` ParentId *Snowflake `json:"parent_id,omitempty"` LastPinTimestamp *time.Time `json:"last_pin_timestamp,omitempty"` RtcRegion *string `json:"rtc_region,omitempty"` VideoQualityMode *int `json:"video_quality_mode,omitempty"` MessageCount *int `json:"message_count,omitempty"` MemberCount *int `json:"member_count,omitempty"` ThreadMetadata *ThreadMetadata `json:"thread_metadata,omitempty"` Member *ThreadMember `json:"member,omitempty"` DefaultAutoArchiveDuration *int `json:"default_auto_archive_duration,omitempty"` Permissions *string `json:"permissions,omitempty"` Flags *int `json:"flags,omitempty"` TotalMessageSent *int `json:"total_message_sent,omitempty"` AvailableTags []Tag `json:"available_tags,omitempty"` AppliedTags []Snowflake `json:"applied_tags,omitempty"` DefaultReactionEmoji *DefaultReaction `json:"default_reaction_emoji,omitempty"` DefaultThreadRateLimitPerUser *int `json:"default_thread_rate_limit_per_user,omitempty"` DefaultSortOrder *int `json:"default_sort_order,omitempty"` DefaultForumLayout *int `json:"default_forum_layout,omitempty"` }
type ChannelMention ¶ added in v0.1.4
type ChannelMention struct { Id Snowflake `json:"id"` GuildId Snowflake `json:"guild_id"` Type channel_type.ChannelType `json:"type"` Name string `json:"name"` }
type DefaultReaction ¶ added in v0.1.9
type Embed ¶
type Embed struct { Title string `json:"title,omitempty"` Type string `json:"type,omitempty"` Description string `json:"description,omitempty"` URL string `json:"url,omitempty"` Timestamp string `json:"timestamp,omitempty"` Color int `json:"color,omitempty"` Image *EmbedImage `json:"image,omitempty"` Thumbnail *EmbedImage `json:"thumbnail,omitempty"` Video *EmbedVideo `json:"video,omitempty"` Provider *EmbedProvider `json:"provider,omitempty"` Author *EmbedAuthor `json:"author,omitempty"` Fields []EmbedField `json:"fields,omitempty"` }
type EmbedAuthor ¶
type EmbedError ¶ added in v0.2.6
func (EmbedError) Error ¶ added in v0.2.6
func (e EmbedError) Error() string
type EmbedField ¶
type EmbedFooter ¶
type EmbedFooter struct {}
type EmbedImage ¶
type EmbedProvider ¶
type EmbedVideo ¶
type Emoji ¶
type Emoji struct { Id *Snowflake `json:"id,omitempty"` Name *string `json:"name,omitempty"` Roles []Snowflake `json:"roles,omitempty"` User *User `json:"user,omitempty"` RequireColons *bool `json:"require_colons,omitempty"` Managed *bool `json:"managed,omitempty"` Animated *bool `json:"animated,omitempty"` Available *bool `json:"available,omitempty"` }
type ErrComponentMissingProperty ¶ added in v0.5.0
type ErrComponentMissingProperty struct { Component MessageComponent PropertyName string }
func (ErrComponentMissingProperty) Error ¶ added in v0.5.0
func (e ErrComponentMissingProperty) Error() string
type ErrComponentMustHaveCustomId ¶ added in v0.5.0
type ErrComponentMustHaveCustomId struct {
Component MessageComponent
}
func (ErrComponentMustHaveCustomId) Error ¶ added in v0.5.0
func (e ErrComponentMustHaveCustomId) Error() string
type ErrComponentMustHaveStyle ¶ added in v0.5.0
type ErrComponentMustHaveStyle struct {
Component MessageComponent
}
func (ErrComponentMustHaveStyle) Error ¶ added in v0.5.0
func (e ErrComponentMustHaveStyle) Error() string
type ErrInvalidParseGroup ¶ added in v0.5.0
type ErrInvalidParseGroup struct { InvalidGroup allowed_mention_type.AllowedMentionType MentionObject AllowedMentions }
func (ErrInvalidParseGroup) Error ¶ added in v0.5.0
func (e ErrInvalidParseGroup) Error() string
type ErrInvalidPropertyLength ¶ added in v0.5.0
type ErrInvalidPropertyLength struct { Component interface{} PropertyName string MaxLength int MinLength int PropertyLength int PropertyValue interface{} }
func (ErrInvalidPropertyLength) Error ¶ added in v0.5.0
func (e ErrInvalidPropertyLength) Error() string
type ErrLinkButtonCannotHaveCustomId ¶ added in v0.5.0
type ErrLinkButtonCannotHaveCustomId struct {
Component *Button
}
func (ErrLinkButtonCannotHaveCustomId) Error ¶ added in v0.5.0
func (e ErrLinkButtonCannotHaveCustomId) Error() string
type ErrLinkButtonMustHaveUrl ¶ added in v0.5.0
type ErrLinkButtonMustHaveUrl struct {
Component *Button
}
func (ErrLinkButtonMustHaveUrl) Error ¶ added in v0.5.0
func (e ErrLinkButtonMustHaveUrl) Error() string
type ErrNestedActionRow ¶ added in v0.5.0
type ErrNestedActionRow struct {
Components []MessageComponent
}
func (ErrNestedActionRow) Error ¶ added in v0.5.0
func (e ErrNestedActionRow) Error() string
type ErrNonLinkButtonCannotHaveUrl ¶ added in v0.5.0
type ErrNonLinkButtonCannotHaveUrl struct {
Component *Button
}
func (ErrNonLinkButtonCannotHaveUrl) Error ¶ added in v0.5.0
func (e ErrNonLinkButtonCannotHaveUrl) Error() string
type ErrNonStringSelectMenuCannotHaveOptions ¶ added in v0.5.0
type ErrNonStringSelectMenuCannotHaveOptions struct {
Component *SelectMenu
}
func (ErrNonStringSelectMenuCannotHaveOptions) Error ¶ added in v0.5.0
func (e ErrNonStringSelectMenuCannotHaveOptions) Error() string
type ErrSelectOptionMustHaveLabel ¶ added in v0.5.0
type ErrSelectOptionMustHaveLabel struct {
Option SelectOption
}
func (ErrSelectOptionMustHaveLabel) Error ¶ added in v0.5.0
func (e ErrSelectOptionMustHaveLabel) Error() string
type ErrSelectOptionMustHaveValue ¶ added in v0.5.0
type ErrSelectOptionMustHaveValue struct {
Option SelectOption
}
func (ErrSelectOptionMustHaveValue) Error ¶ added in v0.5.0
func (e ErrSelectOptionMustHaveValue) Error() string
type ErrStringSelectMenuMustHaveOptions ¶ added in v0.5.0
type ErrStringSelectMenuMustHaveOptions struct {
Component *SelectMenu
}
func (ErrStringSelectMenuMustHaveOptions) Error ¶ added in v0.5.0
func (e ErrStringSelectMenuMustHaveOptions) Error() string
type ErrTooManyComponents ¶ added in v0.5.0
type ErrTooManyComponents struct {
Components []MessageComponent
}
func (ErrTooManyComponents) Error ¶ added in v0.5.0
func (e ErrTooManyComponents) Error() string
type Guild ¶ added in v0.2.5
type Guild struct { Id Snowflake `json:"id"` Name string `json:"name"` Icon *string `json:"icon,omitempty"` IconHash *string `json:"icon_hash,omitempty"` Splash *string `json:"splash,omitempty"` DiscoverySplash *string `json:"discovery_splash,omitempty"` Owner *bool `json:"owner,omitempty"` OwnerId Snowflake `json:"owner_id"` Permissions *Permissions `json:"permissions,omitempty"` Region *string `json:"region,omitempty"` AfkChannelId *Snowflake `json:"afk_channel_id,omitempty"` AfkTimeout int `json:"afk_timeout"` WidgetEnabled *bool `json:"widget_enabled,omitempty"` WidgetChannelId *Snowflake `json:"widget_channel_id,omitempty"` VerificationLevel int `json:"verification_level"` DefaultMessageNotifications int `json:"default_message_notifications"` ExplicitContentFilter int `json:"explicit_content_filter"` Roles []Role `json:"roles"` Emojis []Emoji `json:"emojis"` Features []string `json:"features"` MfaLevel int `json:"mfa_level"` ApplicationId *Snowflake `json:"application_id,omitempty"` SystemChannelId *Snowflake `json:"system_channel_id,omitempty"` SystemChannelFlags int `json:"system_channel_flags"` RulesChannelId *Snowflake `json:"rules_channel_id,omitempty"` MaxPresences *int `json:"max_presences,omitempty"` MaxMembers int `json:"max_members"` VanityURLCode *string `json:"vanity_url_code,omitempty"` Description *string `json:"description,omitempty"` Banner *string `json:"banner,omitempty"` PremiumTier int `json:"premium_tier"` PremiumSubscriptionCount *int `json:"premium_subscription_count,omitempty"` PreferredLocale string `json:"preferred_locale"` PublicUpdatesChannelId *Snowflake `json:"public_updates_channel_id,omitempty"` MaxVideoChannelUsers *int `json:"max_video_channel_users,omitempty"` MaxStageVideoChannelUsers *int `json:"max_stage_video_channel_users,omitempty"` ApproximateMemberCount *int `json:"approximate_member_count,omitempty"` ApproximatePresenceCount *int `json:"approximate_presence_count,omitempty"` WelcomeScreen *WelcomeScreen `json:"welcome_screen,omitempty"` NsfwLevel int `json:"nsfw_level"` Stickers []Sticker `json:"stickers"` PremiumProgressBarEnabled *bool `json:"premium_progress_bar_enabled,omitempty"` }
type InstallParams ¶ added in v0.1.4
type Interaction ¶ added in v0.5.0
type Interaction struct { Id Snowflake `json:"id"` ApplicationId Snowflake `json:"application_id"` Type interaction_type.InteractionType `json:"type"` DataInternal *json.RawMessage `json:"data,omitempty"` Data InteractionData `json:"-"` GuildId *Snowflake `json:"guild_id,omitempty"` Channel *Channel `json:"channel,omitempty"` ChannelId *Snowflake `json:"channel_id,omitempty"` Member *Member `json:"member,omitempty"` User *User `json:"user,omitempty"` Token string `json:"token"` Version int `json:"version"` Message *Message `json:"message,omitempty"` AppPermissions *Permissions `json:"permissions,omitempty"` Locale string `json:"locale"` GuildLocale string `json:"guild_locale"` // contains filtered or unexported fields }
func ParseInteraction ¶ added in v0.5.2
func ParseInteraction(data string) (interaction *Interaction, err error)
func (*Interaction) CreateResponse ¶ added in v0.5.0
func (interaction *Interaction) CreateResponse(response InteractionResponse) error
func (*Interaction) DeferResponse ¶ added in v0.5.0
func (interaction *Interaction) DeferResponse(isEphemeral bool) error
func (*Interaction) DeleteResponse ¶ added in v0.5.0
func (interaction *Interaction) DeleteResponse() error
func (*Interaction) EditResponse ¶ added in v0.5.0
func (interaction *Interaction) EditResponse(data ResponseEditData) error
func (*Interaction) GetResponse ¶ added in v0.5.0
func (interaction *Interaction) GetResponse() (*Message, error)
func (*Interaction) GetWebhook ¶ added in v0.5.0
func (interaction *Interaction) GetWebhook() *Webhook
func (*Interaction) IsPing ¶ added in v0.5.0
func (interaction *Interaction) IsPing() bool
func (*Interaction) UnmarshalJSON ¶ added in v0.5.0
func (interaction *Interaction) UnmarshalJSON(d []byte) error
type InteractionCallbackData ¶ added in v0.5.0
type InteractionCallbackData interface { }
type InteractionData ¶ added in v0.5.0
type InteractionData interface { }
type InteractionResponse ¶ added in v0.5.0
type InteractionResponse struct { Type interaction_callback_type.InteractionCallbackType `json:"type"` Data InteractionCallbackData `json:"data,omitempty"` }
func CreateDeferEditResponse ¶ added in v0.5.0
func CreateDeferEditResponse() InteractionResponse
func CreateDeferMessageResponse ¶ added in v0.5.0
func CreateDeferMessageResponse() InteractionResponse
func CreatePongResponse ¶ added in v0.5.0
func CreatePongResponse() InteractionResponse
func (InteractionResponse) ToAPIGatewayResponse ¶ added in v0.5.0
func (ir InteractionResponse) ToAPIGatewayResponse() events.APIGatewayProxyResponse
type Member ¶
type Member struct { User *User `json:"user,omitempty"` Nick *string `json:"nick,omitempty"` Avatar *string `json:"avatar,omitempty"` Roles []Snowflake `json:"roles"` JoinedAt time.Time `json:"joined_at"` PremiumSince *time.Time `json:"premium_since,omitempty"` Deaf bool `json:"deaf"` Mute bool `json:"mute"` Pending *bool `json:"pending,omitempty"` Permissions *Permissions `json:"permissions,omitempty"` CommunicationDisabledUntil *time.Time `json:"communication_disabled_until,omitempty"` }
type Message ¶ added in v0.1.4
type Message struct { Id Snowflake `json:"id"` ChannelId Snowflake `json:"channel_id"` Author *User `json:"author"` Content string `json:"content"` Timestamp time.Time `json:"timestamp"` EditedTimestamp time.Time `json:"edited_timestamp"` Tts bool `json:"tts"` MentionEveryone bool `json:"mention_everyone"` Mentions []User `json:"mentions"` MentionRoles []Snowflake `json:"mention_roles"` MentionChannels []ChannelMention `json:"mention_channels"` Attachments []Attachment `json:"attachments"` Embeds []Embed `json:"embeds"` Reactions []Reaction `json:"reactions,omitempty"` Nonce interface{} `json:"nonce,omitempty"` Pinned bool `json:"pinned"` WebhookId *Snowflake `json:"webhook_id,omitempty"` Type message_type.MessageType `json:"type"` Activity *MessageActivity `json:"activity,omitempty"` Application *Application `json:"application,omitempty"` ApplicationId *Snowflake `json:"application_id,omitempty"` MessageReference *MessageReference `json:"message_reference,omitempty"` Flags *int `json:"flags,omitempty"` ReferencedMessage *Message `json:"referenced_message,omitempty"` Interaction *MessageInteraction `json:"interaction,omitempty"` Thread *Channel `json:"thread,omitempty"` Components []MessageComponent `json:"components,omitempty"` StickerItems []StickerItem `json:"sticker_items,omitempty"` Position *int `json:"position,omitempty"` RoleSubscriptionData *RoleSubscriptionData `json:"role_subscription_data,omitempty"` }
func (*Message) UnmarshalDynamoDBAttributeValue ¶ added in v0.5.4
func (m *Message) UnmarshalDynamoDBAttributeValue(value *dynamodb.AttributeValue) (err error)
func (*Message) UnmarshalJSON ¶ added in v0.5.3
type MessageActivity ¶ added in v0.1.4
type MessageActivity struct { Type message_activity_type.MessageActivityType `json:"type"` PartyId string `json:"party_id"` }
type MessageCallbackData ¶ added in v0.5.0
type MessageCallbackData struct { TTS *bool `json:"tts,omitempty"` Content *string `json:"content,omitempty"` Embeds []Embed `json:"embeds,omitempty"` AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"` Flags *int `json:"flags,omitempty"` Components []MessageComponent `json:"components,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` }
type MessageComponent ¶ added in v0.5.0
type MessageComponent interface { Type() component_type.ComponentType Verify() error }
MessageComponent can be made of any variables, so it's a map until we parse it into a specific component.
type MessageComponentData ¶ added in v0.5.0
type MessageComponentData struct { CustomId string `json:"custom_id"` Type component_type.ComponentType `json:"component_type"` Values []string `json:"values"` Resolved *ResolvedData `json:"resolved,omitempty"` }
type MessageComponentWrapper ¶ added in v0.5.0
type MessageComponentWrapper struct {
// contains filtered or unexported fields
}
func (*MessageComponentWrapper) MarshalJSON ¶ added in v0.5.0
func (m *MessageComponentWrapper) MarshalJSON() ([]byte, error)
func (*MessageComponentWrapper) UnmarshalDynamoDBAttributeValue ¶ added in v0.5.4
func (m *MessageComponentWrapper) UnmarshalDynamoDBAttributeValue(value *dynamodb.AttributeValue) (err error)
func (*MessageComponentWrapper) UnmarshalJSON ¶ added in v0.5.0
func (m *MessageComponentWrapper) UnmarshalJSON(data []byte) error
type MessageInteraction ¶ added in v0.4.4
type MessageReference ¶ added in v0.2.1
type ModalCallback ¶ added in v0.5.0
type ModalCallback struct { CustomId string `json:"custom_id"` Title string `json:"title"` Components []MessageComponent `json:"components"` }
type ModalSubmitData ¶ added in v0.5.0
type ModalSubmitData struct { CustomId string `json:"custom_id"` Components []MessageComponent `json:"components"` }
func (ModalSubmitData) UnmarshalJSON ¶ added in v0.5.0
func (m ModalSubmitData) UnmarshalJSON(data []byte) error
type Overwrite ¶ added in v0.1.9
type Overwrite struct { // Role or User ID Id Snowflake `json:"id"` Type string `json:"type"` Allow Permissions `json:"allow"` Deny Permissions `json:"deny"` }
type Permissions ¶
type Permissions uint64
func (*Permissions) MarshalJSON ¶
func (i *Permissions) MarshalJSON() ([]byte, error)
func (*Permissions) UnmarshalJSON ¶
func (i *Permissions) UnmarshalJSON(b []byte) error
type ResolvedData ¶
type ResponseEditData ¶ added in v0.5.0
type ResponseEditData struct { Content *string `json:"content,omitempty"` Embeds []Embed `json:"embeds,omitempty"` AllowedMentions *AllowedMentions `json:"allowed_mentions"` Components []MessageComponent `json:"components"` }
func (ResponseEditData) Verify ¶ added in v0.5.0
func (data ResponseEditData) Verify() error
type Role ¶
type Role struct { Id Snowflake `json:"id"` Name string `json:"name"` Color int `json:"color"` Hoist bool `json:"hoist"` Icon *string `json:"icon,omitempty"` UnicodeEmoji *string `json:"unicode_emoji,omitempty"` Position int `json:"position"` Permissions Permissions `json:"permissions"` Managed bool `json:"managed"` Mentionable bool `json:"mentionable"` Tags *RoleTags `json:"tags,omitempty"` }
type RoleSubscriptionData ¶ added in v0.5.0
type RoleTags ¶
type RoleTags struct { BotId *Snowflake `json:"bot_id,omitempty"` IntegrationId *Snowflake `json:"integration_id,omitempty"` SubscriptionListingId *Snowflake `json:"subscription_listing_id,omitempty"` // These fields should be set to "null" in the JSON if they are true, according to the Discord docs... PremiumSubscriber bool `json:"premium_subscriber,omitempty"` AvailableForPurchase bool `json:"available_for_purchase,omitempty"` GuildConnections bool `json:"guild_connections,omitempty"` }
func (*RoleTags) MarshalJSON ¶
func (*RoleTags) UnmarshalJSON ¶
type SelectMenu ¶ added in v0.5.0
type SelectMenu struct { MenuType component_type.ComponentType `json:"type"` CustomId string `json:"custom_id"` Options []SelectOption `json:"options,omitempty"` ChannelTypes []channel_type.ChannelType `json:"channel_types,omitempty"` Placeholder *string `json:"placeholder,omitempty"` MinValues *uint8 `json:"min_values,omitempty"` MaxValues *uint8 `json:"max_values,omitempty"` Disabled *bool `json:"disabled,omitempty"` }
func (*SelectMenu) Type ¶ added in v0.5.0
func (selectMenu *SelectMenu) Type() component_type.ComponentType
func (*SelectMenu) Verify ¶ added in v0.5.0
func (selectMenu *SelectMenu) Verify() error
type SelectOption ¶ added in v0.5.0
type SelectOption struct { Label string `json:"label"` Value string `json:"value"` Description *string `json:"description,omitempty"` Emoji *Emoji `json:"emoji,omitempty"` Default *bool `json:"default,omitempty"` }
func (SelectOption) Verify ¶ added in v0.5.0
func (selectOption SelectOption) Verify() error
type Snowflake ¶
type Snowflake uint64
func GetSnowflake ¶
func (*Snowflake) MarshalJSON ¶
func (*Snowflake) UnmarshalJSON ¶
type Sticker ¶ added in v0.2.5
type Sticker struct { Id Snowflake `json:"id"` PackId *Snowflake `json:"pack_id,omitempty"` Name string `json:"name"` Description *string `json:"description,omitempty"` Tags *string `json:"tags,omitempty"` Asset *string `json:"asset,omitempty"` Type int `json:"type"` FormatType int `json:"format_type"` Available *bool `json:"available,omitempty"` GuildId *Snowflake `json:"guild_id,omitempty"` User *User `json:"user,omitempty"` SortValue *int `json:"sort_value,omitempty"` }
type StickerItem ¶ added in v0.5.0
type Team ¶ added in v0.1.4
type Team struct { Icon string `json:"icon"` Id Snowflake `json:"id"` Members []TeamMember `json:"members"` Name string `json:"name"` OwnerUserId Snowflake `json:"owner_user_id"` }
type TeamMember ¶ added in v0.1.4
type TextInput ¶ added in v0.5.0
type TextInput struct { TextInputType component_type.ComponentType `json:"type"` CustomId string `json:"custom_id"` Style text_input_style.TextInputStyle `json:"style"` Label string `json:"label"` MinLength int `json:"min_length"` MaxLength int `json:"max_length"` Required bool `json:"required"` Value string `json:"value"` Placeholder string `json:"placeholder"` }
func (*TextInput) MarshalJSON ¶ added in v0.5.0
func (*TextInput) Type ¶ added in v0.5.0
func (t *TextInput) Type() component_type.ComponentType
type ThreadMember ¶ added in v0.1.9
type ThreadMetadata ¶ added in v0.1.9
type ThreadMetadata struct { Archived bool `json:"archived"` AutoArchiveDuration int `json:"auto_archive_duration"` ArchiveTimestamp time.Time `json:"archive_timestamp"` Locked bool `json:"locked"` Invitable *bool `json:"invitable,omitempty"` CreateTimestamp *time.Time `json:"create_timestamp,omitempty"` }
type User ¶
type User struct { Id Snowflake `json:"id"` Username string `json:"username"` Discriminator string `json:"discriminator"` Avatar *string `json:"avatar,omitempty"` Bot *bool `json:"bot,omitempty"` System *bool `json:"system,omitempty"` MfaEnabled *bool `json:"mfa_enabled,omitempty"` Banner *string `json:"banner,omitempty"` AccentColor *uint32 `json:"accent_color,omitempty"` Locale *string `json:"locale,omitempty"` Verified *bool `json:"verified,omitempty"` Email *string `json:"email,omitempty"` Flags *uint32 `json:"flags,omitempty"` PremiumType *uint8 `json:"premium_type,omitempty"` PublicFlags *uint32 `json:"public_flags,omitempty"` }
type Webhook ¶ added in v0.5.0
type Webhook struct { Id Snowflake `json:"id"` Type uint8 `json:"type"` GuildId *Snowflake `json:"guild_id,omitempty"` ChannelId *Snowflake `json:"channel_id,omitempty"` User *User `json:"user,omitempty"` Name *string `json:"name,omitempty"` Avatar *string `json:"avatar,omitempty"` Token *string `json:"token,omitempty"` ApplicationId *Snowflake `json:"application_id,omitempty"` SourceGuild *Guild `json:"source_guild,omitempty"` SourceChannel *Channel `json:"source_channel,omitempty"` Url *string `json:"url,omitempty"` }
func WebhookFromUrl ¶ added in v0.5.0
func (*Webhook) DeleteMessage ¶ added in v0.5.0
func (*Webhook) EditMessage ¶ added in v0.5.0
func (hook *Webhook) EditMessage(messageId string, data ResponseEditData) error
func (*Webhook) GetMessage ¶ added in v0.5.0
func (hook *Webhook) GetMessage(req WebhookGetMessageRequest) (message *Message, err error)
type WebhookGetMessageRequest ¶ added in v0.5.0
type WebhookMessageResponse ¶ added in v0.5.0
type WebhookMessageResponse struct { }
type WebhookRequest ¶ added in v0.5.0
type WebhookRequest struct { Content *string `json:"content,omitempty"` Username string `json:"username,omitempty"` AvatarUrl string `json:"avatar_url,omitempty"` TTS *bool `json:"tts,omitempty"` Embeds []Embed `json:"embeds,omitempty"` AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"` Flags *int `json:"flags,omitempty"` Components []MessageComponent `json:"components,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` ThreadName string `json:"thread_name,omitempty"` }
type WelcomeScreen ¶ added in v0.2.5
type WelcomeScreen struct { Description *string `json:"description,omitempty"` WelcomeChannels []WelcomeScreenChannel `json:"welcome_channels"` }
Source Files ¶
- allowed_mentions.go
- application.go
- attachment.go
- autocomplete.go
- button.go
- channel.go
- command_data.go
- command_option.go
- embed.go
- emoji.go
- guild.go
- interaction.go
- member.go
- message.go
- message_component.go
- modal.go
- permissions.go
- reaction.go
- resolved_data.go
- response.go
- role.go
- select_menu.go
- snowflake.go
- sticker.go
- user.go
- verification_errors.go
- webhook.go
Click to show internal directories.
Click to hide internal directories.