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 HTTPResponse
- type InstallParams
- type Interaction
- func (interaction *Interaction) CreateResponse(response InteractionResponse) error
- func (interaction *Interaction) CreateResponseWithContext(ctx context.Context, 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) DeleteMessageWithContext(ctx context.Context, messageId string) (err error)
- func (hook *Webhook) EditMessage(messageId string, data ResponseEditData) error
- func (hook *Webhook) EditMessageWithContext(ctx context.Context, messageId string, data ResponseEditData) error
- func (hook *Webhook) GetMessage(req WebhookGetMessageRequest) (message *Message, err error)
- func (hook *Webhook) GetMessageWithContext(ctx context.Context, req WebhookGetMessageRequest) (message *Message, err error)
- func (hook *Webhook) GetUrl() string
- func (hook *Webhook) Send(req WebhookRequest) (returnedMessage *Message, err error)
- func (hook *Webhook) SendWithContext(ctx context.Context, 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 ¶
Types ¶
type ActionRow ¶
type ActionRow struct { RowType component_type.ComponentType `json:"type"` Components []MessageComponent `json:"components"` }
func (ActionRow) MarshalJSON ¶
func (*ActionRow) Type ¶
func (a *ActionRow) Type() component_type.ComponentType
func (*ActionRow) UnmarshalJSON ¶
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 ¶
func (allowedMentions AllowedMentions) Verify() error
type Application ¶
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 ¶
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 ¶
func (commandData *ApplicationCommandData) GetOption(optionName string) *ApplicationCommandOption
type ApplicationCommandOption ¶
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 ¶
type AutocompleteCallbackData ¶
type AutocompleteCallbackData struct {
Choices []AutoCompleteChoice `json:"choices"`
}
type Button ¶
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 ¶
func (*Button) Type ¶
func (button *Button) Type() component_type.ComponentType
type Channel ¶
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 ¶
type ChannelMention struct { Id Snowflake `json:"id"` GuildId Snowflake `json:"guild_id"` Type channel_type.ChannelType `json:"type"` Name string `json:"name"` }
type DefaultReaction ¶
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 ¶
func (EmbedError) Error ¶
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 ¶
type ErrComponentMissingProperty struct { Component MessageComponent PropertyName string }
func (ErrComponentMissingProperty) Error ¶
func (e ErrComponentMissingProperty) Error() string
type ErrComponentMustHaveCustomId ¶
type ErrComponentMustHaveCustomId struct {
Component MessageComponent
}
func (ErrComponentMustHaveCustomId) Error ¶
func (e ErrComponentMustHaveCustomId) Error() string
type ErrComponentMustHaveStyle ¶
type ErrComponentMustHaveStyle struct {
Component MessageComponent
}
func (ErrComponentMustHaveStyle) Error ¶
func (e ErrComponentMustHaveStyle) Error() string
type ErrInvalidParseGroup ¶
type ErrInvalidParseGroup struct { InvalidGroup allowed_mention_type.AllowedMentionType MentionObject AllowedMentions }
func (ErrInvalidParseGroup) Error ¶
func (e ErrInvalidParseGroup) Error() string
type ErrInvalidPropertyLength ¶
type ErrInvalidPropertyLength struct { Component interface{} PropertyName string MaxLength int MinLength int PropertyLength int PropertyValue interface{} }
func (ErrInvalidPropertyLength) Error ¶
func (e ErrInvalidPropertyLength) Error() string
type ErrLinkButtonCannotHaveCustomId ¶
type ErrLinkButtonCannotHaveCustomId struct {
Component *Button
}
func (ErrLinkButtonCannotHaveCustomId) Error ¶
func (e ErrLinkButtonCannotHaveCustomId) Error() string
type ErrLinkButtonMustHaveUrl ¶
type ErrLinkButtonMustHaveUrl struct {
Component *Button
}
func (ErrLinkButtonMustHaveUrl) Error ¶
func (e ErrLinkButtonMustHaveUrl) Error() string
type ErrNestedActionRow ¶
type ErrNestedActionRow struct {
Components []MessageComponent
}
func (ErrNestedActionRow) Error ¶
func (e ErrNestedActionRow) Error() string
type ErrNonLinkButtonCannotHaveUrl ¶
type ErrNonLinkButtonCannotHaveUrl struct {
Component *Button
}
func (ErrNonLinkButtonCannotHaveUrl) Error ¶
func (e ErrNonLinkButtonCannotHaveUrl) Error() string
type ErrNonStringSelectMenuCannotHaveOptions ¶
type ErrNonStringSelectMenuCannotHaveOptions struct {
Component *SelectMenu
}
func (ErrNonStringSelectMenuCannotHaveOptions) Error ¶
func (e ErrNonStringSelectMenuCannotHaveOptions) Error() string
type ErrSelectOptionMustHaveLabel ¶
type ErrSelectOptionMustHaveLabel struct {
Option SelectOption
}
func (ErrSelectOptionMustHaveLabel) Error ¶
func (e ErrSelectOptionMustHaveLabel) Error() string
type ErrSelectOptionMustHaveValue ¶
type ErrSelectOptionMustHaveValue struct {
Option SelectOption
}
func (ErrSelectOptionMustHaveValue) Error ¶
func (e ErrSelectOptionMustHaveValue) Error() string
type ErrStringSelectMenuMustHaveOptions ¶
type ErrStringSelectMenuMustHaveOptions struct {
Component *SelectMenu
}
func (ErrStringSelectMenuMustHaveOptions) Error ¶
func (e ErrStringSelectMenuMustHaveOptions) Error() string
type ErrTooManyComponents ¶
type ErrTooManyComponents struct {
Components []MessageComponent
}
func (ErrTooManyComponents) Error ¶
func (e ErrTooManyComponents) Error() string
type Guild ¶
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 HTTPResponse ¶ added in v1.0.1
func (HTTPResponse) WriteResponse ¶ added in v1.0.2
func (res HTTPResponse) WriteResponse(w http.ResponseWriter)
type InstallParams ¶
type Interaction ¶
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 ¶
func ParseInteraction(data string) (interaction *Interaction, err error)
func (*Interaction) CreateResponse ¶
func (interaction *Interaction) CreateResponse(response InteractionResponse) error
func (*Interaction) CreateResponseWithContext ¶
func (interaction *Interaction) CreateResponseWithContext(ctx context.Context, response InteractionResponse) error
func (*Interaction) DeferResponse ¶
func (interaction *Interaction) DeferResponse(isEphemeral bool) error
func (*Interaction) DeleteResponse ¶
func (interaction *Interaction) DeleteResponse() error
func (*Interaction) EditResponse ¶
func (interaction *Interaction) EditResponse(data ResponseEditData) error
func (*Interaction) GetResponse ¶
func (interaction *Interaction) GetResponse() (*Message, error)
func (*Interaction) GetWebhook ¶
func (interaction *Interaction) GetWebhook() *Webhook
func (*Interaction) IsPing ¶
func (interaction *Interaction) IsPing() bool
func (*Interaction) UnmarshalJSON ¶
func (interaction *Interaction) UnmarshalJSON(d []byte) error
type InteractionCallbackData ¶
type InteractionCallbackData interface { }
type InteractionData ¶
type InteractionData interface { }
type InteractionResponse ¶
type InteractionResponse struct { Type interaction_callback_type.InteractionCallbackType `json:"type"` Data InteractionCallbackData `json:"data,omitempty"` }
func CreateDeferEditResponse ¶
func CreateDeferEditResponse() InteractionResponse
func CreateDeferMessageResponse ¶
func CreateDeferMessageResponse() InteractionResponse
func CreatePongResponse ¶
func CreatePongResponse() InteractionResponse
func (InteractionResponse) ToHttpResponse ¶ added in v1.0.1
func (ir InteractionResponse) ToHttpResponse() HTTPResponse
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 ¶
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) UnmarshalJSON ¶
type MessageActivity ¶
type MessageActivity struct { Type message_activity_type.MessageActivityType `json:"type"` PartyId string `json:"party_id"` }
type MessageCallbackData ¶
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 ¶
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 ¶
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 ¶
type MessageComponentWrapper struct {
// contains filtered or unexported fields
}
func (MessageComponentWrapper) MarshalJSON ¶
func (m MessageComponentWrapper) MarshalJSON() ([]byte, error)
func (*MessageComponentWrapper) UnmarshalJSON ¶
func (m *MessageComponentWrapper) UnmarshalJSON(data []byte) error
type MessageInteraction ¶
type MessageReference ¶
type ModalCallback ¶
type ModalCallback struct { CustomId string `json:"custom_id"` Title string `json:"title"` Components []MessageComponent `json:"components"` }
type ModalSubmitData ¶
type ModalSubmitData struct { CustomId string `json:"custom_id"` Components []MessageComponent `json:"components"` }
func (*ModalSubmitData) UnmarshalJSON ¶
func (m *ModalSubmitData) UnmarshalJSON(data []byte) error
type Overwrite ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
func (selectMenu *SelectMenu) Type() component_type.ComponentType
func (*SelectMenu) Verify ¶
func (selectMenu *SelectMenu) Verify() error
type SelectOption ¶
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 ¶
func (selectOption SelectOption) Verify() error
type Snowflake ¶
type Snowflake uint64
func GetSnowflake ¶
func SnowflakeFromTime ¶
func (Snowflake) MarshalJSON ¶
func (*Snowflake) UnmarshalJSON ¶
func (*Snowflake) UnmarshalText ¶
type Sticker ¶
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 ¶
type Team ¶
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 ¶
type TextInput ¶
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 ¶
func (*TextInput) Type ¶
func (t *TextInput) Type() component_type.ComponentType
type ThreadMember ¶
type ThreadMetadata ¶
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 ¶
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 ¶
func (*Webhook) DeleteMessage ¶
func (*Webhook) DeleteMessageWithContext ¶
func (*Webhook) EditMessage ¶
func (hook *Webhook) EditMessage(messageId string, data ResponseEditData) error
func (*Webhook) EditMessageWithContext ¶
func (*Webhook) GetMessage ¶
func (hook *Webhook) GetMessage(req WebhookGetMessageRequest) (message *Message, err error)
func (*Webhook) GetMessageWithContext ¶
func (*Webhook) Send ¶
func (hook *Webhook) Send(req WebhookRequest) (returnedMessage *Message, err error)
func (*Webhook) SendWithContext ¶
type WebhookMessageResponse ¶
type WebhookMessageResponse struct { }
type WebhookRequest ¶
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 ¶
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.