Documentation ¶
Index ¶
- Constants
- type Activity
- type ActivityAssets
- type ActivityFlag
- type ActivityParty
- type ActivitySecrets
- type ActivityType
- type AllowedMentions
- type Application
- type ApplicationCommand
- type ApplicationCommandInteractionData
- type ApplicationCommandInteractionDataOption
- type ApplicationCommandInteractionDataResolved
- type ApplicationCommandOption
- type ApplicationCommandOptionChoice
- type ApplicationCommandOptionType
- type ApplicationCommandPermissionType
- type ApplicationCommandPermissions
- type ApplicationCommandType
- type ApplicationComponentInteractionData
- type ApplicationFlag
- type ApplicationModalInteractionData
- type Attachment
- type AuditLog
- type AuditLogChange
- type AuditLogChangeKey
- type AuditLogEntry
- type AuditLogEvent
- type AuditLogOption
- type Ban
- type ButtonStyle
- type Channel
- type ChannelCreate
- type ChannelDelete
- type ChannelMention
- type ChannelPinsUpdate
- type ChannelType
- type ChannelUpdate
- type ClientStatus
- type Component
- type ComponentType
- type Connection
- type DiscordBaseObject
- type DiscordFile
- type Embed
- type EmbedAuthor
- type EmbedField
- type EmbedFooter
- type EmbedImage
- type EmbedProvider
- type EmbedThumbnail
- type EmbedVideo
- type Emoji
- type ExpireBehavior
- type ExplicitContentFilterLevel
- type FollowedChannel
- type Gateway
- type Guild
- type GuildApplicationCommandPermissions
- type GuildBanAdd
- type GuildBanRemove
- type GuildCreate
- type GuildDelete
- type GuildEmojisUpdate
- type GuildFeature
- type GuildIntegrationsUpdate
- type GuildMember
- type GuildMemberAdd
- type GuildMemberRemove
- type GuildMemberUpdate
- type GuildMembersChunk
- type GuildNSFWLevel
- type GuildPreview
- type GuildRoleCreate
- type GuildRoleDelete
- type GuildRoleUpdate
- type GuildScheduledEvent
- type GuildScheduledEventEntityMetadata
- type GuildScheduledEventEntityType
- type GuildScheduledEventStatus
- type GuildScheduledEventUser
- type GuildStickersUpdate
- type GuildUpdate
- type GuildWidget
- type GuildWidgetJSON
- type HandlerFunc
- type Integration
- type IntegrationAccount
- type IntegrationApplication
- type IntegrationCreate
- type IntegrationDelete
- type IntegrationUpdate
- type Interaction
- type InteractionApplicationCommandCallbackData
- type InteractionCreate
- type InteractionResponse
- type InteractionResponseComponent
- type InteractionType
- type Invite
- type InviteCreate
- type InviteDelete
- type InviteTargetType
- type JSONErrorCode
- type MFALevel
- type MembershipFieldType
- type MembershipScreening
- type MembershipScreeningField
- type Mentionable
- type Message
- type MessageActivity
- type MessageActivityType
- type MessageApplication
- type MessageCreate
- type MessageDelete
- type MessageDeleteBulk
- type MessageFlag
- type MessageInteraction
- type MessageNotificationsLevel
- type MessageReactionAdd
- type MessageReactionRemove
- type MessageReactionRemoveAll
- type MessageReactionRemoveEmoji
- type MessageReference
- type MessageStickerFormat
- type MessageType
- type MessageUpdate
- type PermissionOverwrite
- type PremiumTierLevel
- type PremiumType
- type PresenceUpdate
- type PrivacyLevel
- type Ratelimit
- type Reaction
- type Ready
- type ResponseType
- type Role
- type RoleTags
- type SelectOptions
- type Snowflake
- type SnowflakeObject
- type StageInstance
- type StageInstanceCreate
- type StageInstanceDelete
- type StageInstanceUpdate
- type Sticker
- type StickerFormatType
- type StickerItem
- type StickerPack
- type StickerTags
- type StickerType
- type SystemChannelFlags
- type Team
- type TeamMember
- type TeamMembershipState
- type Template
- type TextStyle
- type ThreadCreate
- type ThreadDelete
- type ThreadListSync
- type ThreadMember
- type ThreadMemberUpdate
- type ThreadMembersUpdate
- type ThreadMetadata
- type ThreadUpdate
- type Time
- func (t *Time) Format(style TimestampStyle) string
- func (t *Time) LongDate() string
- func (t *Time) LongDateTime() string
- func (t *Time) LongTime() string
- func (t *Time) MarshalJSON() ([]byte, error)
- func (t *Time) Mention() string
- func (t *Time) Relative() string
- func (t *Time) ShortDate() string
- func (t *Time) ShortDateTime() string
- func (t *Time) ShortTime() string
- func (t *Time) String() string
- func (t *Time) UnmarshalJSON(b []byte) error
- type TimestampStyle
- type Timestamps
- type TypingStart
- type UnavailableGuild
- type User
- type UserFlags
- type UserUpdate
- type VerificationLevel
- type Visibility
- type VoiceRegion
- type VoiceServerUpdate
- type VoiceState
- type VoiceStateUpdate
- type Webhook
- type WebhookType
- type WebhooksUpdate
- type WelcomeChannel
- type WelcomeScreen
- type WidgetUser
Constants ¶
const (
DiscordEpoch = 1420070400000
)
const UserFlagsNone = UserFlags(0)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Activity ¶
type Activity struct { Name string `json:"name,omitempty"` Type ActivityType `json:"type"` URL string `json:"url,omitempty"` CreatedAt int `json:"created_at"` Timestamps Timestamps `json:"timestamps,omitempty"` ApplicationID Snowflake `json:"application_id,omitempty"` Details string `json:"details,omitempty"` State string `json:"state,omitempty"` Emoji *Emoji `json:"emoji,omitempty"` Party *ActivityParty `json:"party,omitempty"` Assets *ActivityAssets `json:"assets,omitempty"` Secrets *ActivitySecrets `json:"secrets,omitempty"` Instance bool `json:"instance,omitempty"` Flags ActivityFlag `json:"flags,omitempty"` }
type ActivityAssets ¶
type ActivityFlag ¶
type ActivityFlag uint
const ( ActivityInstance ActivityFlag = 1 << iota ActivityJoin ActivitySpectate ActivityJoinRequest ActivitySync ActivityPlay )
func (ActivityFlag) String ¶ added in v0.1.0
func (i ActivityFlag) String() string
type ActivityParty ¶
type ActivitySecrets ¶
type ActivityType ¶
type ActivityType uint
const ( Game ActivityType = iota Streaming Listening Custom Competing )
func (ActivityType) String ¶ added in v0.1.0
func (i ActivityType) String() string
type AllowedMentions ¶
type Application ¶ added in v0.0.15
type Application struct { DiscordBaseObject Name string `json:"name"` Icon string `json:"icon"` Description string `json:"description"` RPCOrigins []string `json:"rpc_origins"` BotPublic bool `json:"bot_public"` BotRequireCodeGrant bool `json:"bot_require_code_grant"` TermsOfServiceURL string `json:"terms_of_service_url"` PrivacyPolicyURL string `json:"privacy_policy_url"` Owner *User `json:"owner"` Summary string `json:"summary"` VerifyKey string `json:"verify_key"` Team *Team `json:"team"` GuildID Snowflake `json:"guild_id"` PrimarySKUID Snowflake `json:"primary_sku_id"` Slug string `json:"slug"` CoverImage string `json:"cover_image"` Flags ApplicationFlag `json:"flags"` }
A Discord API Application object. https://discord.com/developers/docs/resources/application#application-object-application-structure
type ApplicationCommand ¶
type ApplicationCommand struct { // ID is the unique id of the command DiscordBaseObject // Type is the type of command, defaults 1 if not set Type *ApplicationCommandType `json:"type,omitempty"` // Application ID is the unique id of the parent application ApplicationID Snowflake `json:"application_id,omitempty"` // GuildID guild id of the command, if not global GuildID *Snowflake `json:"guild_id,omitempty"` // Name is a 1-32 character name Name string `json:"name"` // Description is a 1-100 character description for CHAT_INPUT commands, empty string for USER and MESSAGE commands Description string `json:"description,omitempty"` // Options are the parameters for the command, max 25, only valid for CHAT_INPUT commands Options []ApplicationCommandOption `json:"options"` // Set of permissions represented as a bit set DefaultPermissions *permissions.PermissionBit `json:"default_member_permissions,omitempty"` // Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. AllowUseInDMs *bool `json:"dm_permission,omitempty"` // DefaultPermission is whether the command is enabled by default when the app is added to a guild DefaultPermission *bool `json:"default_permission,omitempty"` // Version is an autoincrementing version identifier updated during substantial record changes Version Snowflake `json:"version,omitempty"` }
type ApplicationCommandInteractionData ¶
type ApplicationCommandInteractionData struct { DiscordBaseObject Name string `json:"name"` Type ApplicationCommandType `json:"type"` Version Snowflake `json:"version"` Options []*ApplicationCommandInteractionDataOption `json:"options"` Resolved ApplicationCommandInteractionDataResolved `json:"resolved"` TargetID Snowflake `json:"target_id"` }
type ApplicationCommandInteractionDataOption ¶
type ApplicationCommandInteractionDataOption struct { Type ApplicationCommandOptionType `json:"type"` Name string `json:"name"` Value interface{} `json:"value,omitempty"` Focused bool `json:"focused,omitempty"` Options []*ApplicationCommandInteractionDataOption `json:"options,omitempty"` }
type ApplicationCommandInteractionDataResolved ¶
type ApplicationCommandInteractionDataResolved struct { Users map[Snowflake]User `json:"users"` Members map[Snowflake]GuildMember `json:"members"` Roles map[Snowflake]Role `json:"roles"` Channels map[Snowflake]Channel `json:"channels"` Messages map[Snowflake]Message `json:"messages"` Attachments map[Snowflake]Attachment `json:"attachments"` }
type ApplicationCommandOption ¶
type ApplicationCommandOption struct { OptionType ApplicationCommandOptionType `json:"type"` Name string `json:"name"` Description string `json:"description"` Required bool `json:"required,omitempty"` Choices []ApplicationCommandOptionChoice `json:"choices,omitempty"` Options []ApplicationCommandOption `json:"options,omitempty"` ChannelTypes []ChannelType `json:"channel_types,omitempty"` MinValue json.Number `json:"min_value,omitempty"` MaxValue json.Number `json:"max_value,omitempty"` Autocomplete bool `json:"autocomplete,omitempty"` }
type ApplicationCommandOptionChoice ¶
type ApplicationCommandOptionChoice struct { Name string `json:"name"` Value interface{} `json:"value"` }
type ApplicationCommandOptionType ¶
type ApplicationCommandOptionType int
const ( TypeSubCommand ApplicationCommandOptionType = iota + 1 TypeSubCommandGroup TypeString TypeInteger TypeBoolean TypeUser TypeChannel TypeRole TypeMentionable TypeNumber TypeAttachment )
func (ApplicationCommandOptionType) String ¶ added in v0.1.0
func (i ApplicationCommandOptionType) String() string
type ApplicationCommandPermissionType ¶
type ApplicationCommandPermissionType int
const ( PermissionTypeRole ApplicationCommandPermissionType = iota + 1 PermissionTypeUser )
func (ApplicationCommandPermissionType) String ¶ added in v0.1.0
func (i ApplicationCommandPermissionType) String() string
type ApplicationCommandPermissions ¶
type ApplicationCommandPermissions struct { DiscordBaseObject Type ApplicationCommandPermissionType `json:"type"` Permission bool `json:"permission"` }
type ApplicationCommandType ¶
type ApplicationCommandType int
const ( CommandTypeChatInput ApplicationCommandType = iota + 1 CommandTypeUser CommandTypeMessage )
ApplicationCommand types
func (ApplicationCommandType) String ¶ added in v0.1.0
func (i ApplicationCommandType) String() string
type ApplicationComponentInteractionData ¶
type ApplicationComponentInteractionData struct { CustomID string `json:"custom_id"` ComponentType ComponentType `json:"component_type"` Values []string `json:"values,omitempty"` }
type ApplicationFlag ¶ added in v0.1.0
type ApplicationFlag int
const ( ApplicationFlagGatewayPresence ApplicationFlag = 1 << (iota + 12) ApplicationFlagGatewayPresenceLimited ApplicationFlagGatewayGuildMembers ApplicationFlagGatewayGuildMembersLimited ApplicationFlagVerificationPendingGuildLimit ApplicationFlagEmbedded ApplicationFlagMessageContent ApplicationFlagMessageContentLimited )
func (ApplicationFlag) String ¶ added in v0.1.0
func (i ApplicationFlag) String() string
type ApplicationModalInteractionData ¶ added in v0.0.19
type ApplicationModalInteractionData struct { CustomID string `json:"custom_id"` Components []*InteractionResponseComponent `json:"components"` }
type Attachment ¶
type Attachment struct { DiscordBaseObject Filename string `json:"filename,omitempty"` Description string `json:"description,omitempty"` ContentType string `json:"content_type,omitempty"` Size int `json:"size,omitempty"` URL string `json:"url,omitempty"` ProxyURL string `json:"proxy_url,omitempty"` Height int `json:"height,omitempty"` Width int `json:"width,omitempty"` Ephemeral bool `json:"ephemeral,omitempty"` }
type AuditLog ¶
type AuditLog struct { Webhooks []*Webhook `json:"webhooks"` Users []*User `json:"users"` AuditLogEntry []*AuditLogEntry `json:"audit_log_entry"` Integrations []*Integration }
type AuditLogChange ¶
type AuditLogChange struct { NewValue interface{} `json:"new_value,omitempty"` OldValue interface{} `json:"old_value,omitempty"` Key string `json:"key"` }
AuditLogChange is the struct representing changes made to the target ID. More details can be found at https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
type AuditLogChangeKey ¶
type AuditLogChangeKey string
const ( AuditLogChangeAFKChannelID AuditLogChangeKey = "afk_channel_id" AuditLogChangeAFKTimeout AuditLogChangeKey = "afk_timeout" AuditLogChangeAdd AuditLogChangeKey = "$add" AuditLogChangeAllow AuditLogChangeKey = "allow" AuditLogChangeApplicationID AuditLogChangeKey = "application_id" AuditLogChangeAvatarHash AuditLogChangeKey = "avatar_hash" AuditLogChangeBannerHash AuditLogChangeKey = "banner_hash" AuditLogChangeBitrate AuditLogChangeKey = "bitrate" AuditLogChangeChannelID AuditLogChangeKey = "channel_id" AuditLogChangeCode AuditLogChangeKey = "code" AuditLogChangeColor AuditLogChangeKey = "color" AuditLogChangeDeaf AuditLogChangeKey = "deaf" AuditLogChangeDefaultMessageNotifications AuditLogChangeKey = "default_message_notifications" AuditLogChangeDeny AuditLogChangeKey = "deny" AuditLogChangeDescription AuditLogChangeKey = "description" AuditLogChangeDiscoverySplashHash AuditLogChangeKey = "discovery_splash_hash" AuditLogChangeEnableEmoticons AuditLogChangeKey = "enable_emoticons" AuditLogChangeExpireBehaviour AuditLogChangeKey = "expire_behaviour" AuditLogChangeExpireGracePeriod AuditLogChangeKey = "expire_grace_period" AuditLogChangeExplicitContentFilter AuditLogChangeKey = "explicit_content_filter" AuditLogChangeHoist AuditLogChangeKey = "hoist" AuditLogChangeID AuditLogChangeKey = "id" AuditLogChangeIconHash AuditLogChangeKey = "icon_hash" AuditLogChangeInviterID AuditLogChangeKey = "inviter_id" AuditLogChangeMFALevel AuditLogChangeKey = "mfa_level" AuditLogChangeMaxAge AuditLogChangeKey = "max_age" AuditLogChangeMaxUses AuditLogChangeKey = "max_uses" AuditLogChangeMentionable AuditLogChangeKey = "mentionable" AuditLogChangeMute AuditLogChangeKey = "mute" AuditLogChangeNSFW AuditLogChangeKey = "nsfw" AuditLogChangeName AuditLogChangeKey = "name" AuditLogChangeNick AuditLogChangeKey = "nick" AuditLogChangeOwnerID AuditLogChangeKey = "owner_id" AuditLogChangePermissionOverwrites AuditLogChangeKey = "permission_overwrites" AuditLogChangePermissions AuditLogChangeKey = "permissions" AuditLogChangePosition AuditLogChangeKey = "position" AuditLogChangePreferredLocale AuditLogChangeKey = "preferred_locale" AuditLogChangePruneDeleteDays AuditLogChangeKey = "prune_delete_days" AuditLogChangePublicUpdatesChannelID AuditLogChangeKey = "public_updates_channel_id" AuditLogChangeRateLimitPerUser AuditLogChangeKey = "rate_limit_per_user" AuditLogChangeRegion AuditLogChangeKey = "region" AuditLogChangeRemove AuditLogChangeKey = "$remove" AuditLogChangeRuleChannelID AuditLogChangeKey = "rules_channel_id" AuditLogChangeSplashHash AuditLogChangeKey = "splash_hash" AuditLogChangeSystemChannelID AuditLogChangeKey = "system_channel_id" AuditLogChangeTemporary AuditLogChangeKey = "temporary" AuditLogChangeTopic AuditLogChangeKey = "topic" AuditLogChangeType AuditLogChangeKey = "type" AuditLogChangeUserLimit AuditLogChangeKey = "user_limit" AuditLogChangeUses AuditLogChangeKey = "uses" AuditLogChangeVanityURLCode AuditLogChangeKey = "vanity_url_code" AuditLogChangeVerificationLevel AuditLogChangeKey = "verification_level" AuditLogChangeWidgetChannelID AuditLogChangeKey = "widget_channel_id" AuditLogChangeWidgetEnabled AuditLogChangeKey = "widget_enabled" )
type AuditLogEntry ¶
type AuditLogEntry struct { TargetID Snowflake `json:"target_id"` Changes []*AuditLogChange `json:"changes,omitempty"` UserID Snowflake `json:"user_id"` ID Snowflake `json:"id"` Event AuditLogEvent `json:"action_type"` Options *AuditLogOption `json:"options,omitempty"` Reason string `json:"reason,omitempty"` }
AuditLogEntry represents a single audit log.
type AuditLogEvent ¶
type AuditLogEvent uint
const ( AuditLogEventChannelCreate AuditLogEvent = iota + 10 AuditLogEventChannelUpdate AuditLogEventChannelDelete AuditLogEventOverwriteCreate AuditLogEventOverwriteUpdate AuditLogEventOverwriteDelete )
const ( AuditLogEventMemberKick AuditLogEvent = iota + 20 AuditLogEventMemberPrune AuditLogEventMemberBanAdd AuditLogEventMemberBanRemove AuditLogEventMemberUpdate AuditLogEventMemberRoleUpdate AuditLogEventMemberMove AuditLogEventMemberDisconnect AuditLogEventBotAdd )
const ( AuditLogEventRoleCreate AuditLogEvent = iota + 30 AuditLogEventRoleUpdate AuditLogEventRoleDelete )
const ( AuditLogEventInviteCreate AuditLogEvent = iota + 40 AuditLogEventInviteUpdate AuditLogEventInviteDelete )
const ( AuditLogEventWebhookCreate AuditLogEvent = iota + 50 AuditLogEventWebhookUpdate AuditLogEventWebhookDelete )
const ( AuditLogEventEmojiCreate AuditLogEvent = iota + 60 AuditLogEventEmojiUpdate AuditLogEventEmojiDelete )
const ( AuditLogEventMessageDelete AuditLogEvent = iota + 72 AuditLogEventMessageBulkDelete AuditLogEventMessagePin AuditLogEventMessageUnpin )
const ( AuditLogEventIntegrationCreate AuditLogEvent = iota + 80 AuditLogEventIntegrationUpdate AuditLogEventIntegrationDelete )
const (
AuditLogEvtGuildUpdate AuditLogEvent = 1
)
func (AuditLogEvent) String ¶ added in v0.1.0
func (i AuditLogEvent) String() string
type AuditLogOption ¶
type AuditLogOption struct { // number of days after which inactive members were kicked // triggered on MEMBER_PRUNE actions DeleteMemberDays string `json:"delete_member_days"` // number of members removed by the prune // triggered on MEMBER_PRUNE actions MembersRemoved string `json:"members_removed"` // channel in which the entities were targeted // triggered on MEMBER_MOVE & MESSAGE_PIN & MESSAGE_UNPIN & MESSAGE_DELETE actions ChannelID Snowflake `json:"channel_id"` // id of the message that was targeted // triggered for MESSAGE_PIN & MESSAGE_UNPIN actions MessageID Snowflake `json:"message_id"` // number of entities that were targeted // triggered on MESSAGE_DELETE & MESSAGE_BULK_DELETE & MEMBER_DISCONNECT & MEMBER_MOVE actions Count string `json:"count"` // id of the overwritten entity // triggered on CHANNEL_OVERWRITE_CREATE & CHANNEL_OVERWRITE_UPDATE & CHANNEL_OVERWRITE_DELETE actions ID Snowflake `json:"id"` // type of overwritten entity - "0" for "role" or "1" for "member" // triggered on CHANNEL_OVERWRITE_CREATE & CHANNEL_OVERWRITE_UPDATE & CHANNEL_OVERWRITE_DELETE actions Type string `json:"type"` // name of the role if type is "0" (not present if type is "1") // triggered on CHANNEL_OVERWRITE_CREATE & CHANNEL_OVERWRITE_UPDATE & CHANNEL_OVERWRITE_DELETE actions RoleName string `json:"role_name"` }
AuditLogOptions is the options for an audit log entry. More details can be found at https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
type ButtonStyle ¶
type ButtonStyle int
const ( ButtonStylePrimary ButtonStyle = iota + 1 ButtonStyleSecondary ButtonStyleSuccess ButtonStyleDanger ButtonStyleLink )
func (ButtonStyle) String ¶ added in v0.1.0
func (i ButtonStyle) String() string
type Channel ¶
type Channel struct { DiscordBaseObject Type ChannelType `json:"type"` GuildID Snowflake `json:"guild_id,omitempty"` Position int `json:"position,omitempty"` PermissionOverwrites []PermissionOverwrite `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 uint `json:"bitrate,omitempty"` UserLimit uint `json:"user_limit,omitempty"` RateLimitPerUser uint `json:"rate_limit_per_user,omitempty"` Recipients []*User `json:"recipient,omitempty"` Icon string `json:"icon,omitempty"` OwnerID Snowflake `json:"owner_id,omitempty"` ApplicationID Snowflake `json:"application_id,omitempty"` ParentID Snowflake `json:"parent_id,omitempty"` LastPinTimestamp 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"` }
type ChannelCreate ¶ added in v0.0.15
type ChannelCreate struct {
*Channel
}
type ChannelDelete ¶ added in v0.0.15
type ChannelDelete struct {
*Channel
}
type ChannelMention ¶
type ChannelMention struct { DiscordBaseObject GuildID Snowflake `json:"guild_id"` Type ChannelType `json:"type"` Name string `json:"name"` }
type ChannelPinsUpdate ¶ added in v0.0.15
type ChannelType ¶
type ChannelType uint
const ( ChannelTypeGuildText ChannelType = iota ChannelTypeDM ChannelTypeGuildVoice ChannelTypeGroupDM ChannelTypeGuildCategory ChannelTypeGuildNews ChannelTypeGuildStore )
func (ChannelType) String ¶ added in v0.1.0
func (i ChannelType) String() string
type ChannelUpdate ¶ added in v0.0.15
type ChannelUpdate struct {
*Channel
}
type ClientStatus ¶
type Component ¶
type Component struct { Type ComponentType `json:"type"` CustomID string `json:"custom_id,omitempty"` Disabled bool `json:"disabled,omitempty"` Label string `json:"label,omitempty"` Style ButtonStyle `json:"style,omitempty"` Emoji *Emoji `json:"emoji,omitempty"` URL string `json:"url,omitempty"` Options []*SelectOptions `json:"options,omitempty"` Placeholder string `json:"placeholder,omitempty"` // Must be a pointer, discord assumes omitted value = 1 MinValues *int `json:"min_values,omitempty"` MaxValues *int `json:"max_values,omitempty"` MinLength *int `json:"min_length,omitempty"` MaxLength *int `json:"max_length,omitempty"` Value string `json:"value,omitempty"` Required bool `json:"required,omitempty"` Components []*Component `json:"components,omitempty"` }
type ComponentType ¶
type ComponentType int
const ( ComponentTypeActionRow ComponentType = iota + 1 ComponentTypeButton ComponentTypeSelectMenu // ComponentTypeInputText is only usable in modals ComponentTypeInputText )
func (ComponentType) String ¶ added in v0.1.0
func (i ComponentType) String() string
type Connection ¶
type Connection struct { ID string `json:"id"` Name string `json:"name"` Type string `json:"type"` Revoked bool `json:"revoked,omitempty"` Integrations []*Integration `json:"integrations,omitempty"` Verified bool `json:"verified"` FriendSync bool `json:"friend_sync"` ShowActivity bool `json:"show_activity"` Visibility Visibility `json:"visibility"` }
type DiscordBaseObject ¶ added in v0.1.0
type DiscordBaseObject struct {
ID Snowflake `json:"id,omitempty"`
}
func (DiscordBaseObject) GetID ¶ added in v0.1.0
func (d DiscordBaseObject) GetID() Snowflake
type DiscordFile ¶ added in v0.1.2
type DiscordFile struct { *bytes.Buffer Filename string Description string ContentType string Spoiler bool }
func NewDiscordFile ¶ added in v0.1.2
func NewDiscordFile(r io.Reader, filename, description string) (*DiscordFile, error)
func (*DiscordFile) GenerateAttachment ¶ added in v0.1.2
func (f *DiscordFile) GenerateAttachment(index Snowflake, m *multipart.Writer) (*Attachment, error)
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 Time `json:"timetimestamp"` Color int `json:"color,omitempty"` Image *EmbedImage `json:"image,omitempty"` Thumbnail *EmbedThumbnail `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 EmbedField ¶
type EmbedFooter ¶
type EmbedFooter struct {}
type EmbedImage ¶
type EmbedProvider ¶
type EmbedThumbnail ¶
type EmbedVideo ¶
type Emoji ¶
type Emoji struct { DiscordBaseObject 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 ExpireBehavior ¶ added in v0.1.0
type ExpireBehavior uint
const ( ExpireBehaviorRemoveRole ExpireBehavior = iota ExpireBehaviorKick )
func (ExpireBehavior) String ¶ added in v0.1.0
func (i ExpireBehavior) String() string
type ExplicitContentFilterLevel ¶
type ExplicitContentFilterLevel uint
const ( ExplicitContentFilterLevelDisabled ExplicitContentFilterLevel = iota ExplicitContentFilterLevelMembersWithoutRoles ExplicitContentFilterLevelAllMembers )
func (ExplicitContentFilterLevel) String ¶ added in v0.1.0
func (i ExplicitContentFilterLevel) String() string
type FollowedChannel ¶
type Guild ¶
type Guild struct { DiscordBaseObject 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.PermissionBit `json:"permissions,omitempty"` Region string `json:"region"` AFKChannelID Snowflake `json:"afk_channel_id,omitempty"` AFKTimeout int `json:"afk_timeout,omitempty"` WidgetEnabled bool `json:"widget_enabled,omitempty"` WidgetChannelID Snowflake `json:"widget_channel_id,omitempty"` VerificationLevel VerificationLevel `json:"verification_level"` DefaultMessageNotifications MessageNotificationsLevel `json:"default_message_notifications"` ExplicitContentFilter ExplicitContentFilterLevel `json:"explicit_content_filter"` Roles []*Role `json:"roles"` Emojis []*Emoji `json:"emojis"` Features []GuildFeature `json:"features"` MFALevel MFALevel `json:"mfa_level"` ApplicationID Snowflake `json:"application_id,omitempty"` SystemChannelID Snowflake `json:"system_channel_id,omitempty"` SystemChannelFlags SystemChannelFlags `json:"system_channel_flags"` RulesChannelID Snowflake `json:"rules_channel_id,omitempty"` JoinedAt Time `json:"joined_at,omitempty"` Large bool `json:"large,omitempty"` MemberCount int `json:"member_count,omitempty"` VoiceStates []*VoiceState `json:"voice_states,omitempty"` Members []*GuildMember `json:"members,omitempty"` Channels []*Channel `json:"channels,omitempty"` Presences []*PresenceUpdate `json:"presences,omitempty"` MaxPresences int `json:"max_presences,omitempty"` MaxMembers int `json:"max_members,omitempty"` VanityURLCode string `json:"vanity_url_code,omitempty"` Description string `json:"description,omitempty"` Banner string `json:"banned,omitempty"` PremiumTier PremiumTierLevel `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"` ApproximateMemberCount int `json:"approximate_member_count,omitempty"` ApproximatePresenceCount int `json:"approximate_presence_count,omitempty"` WelcomeScreen *WelcomeScreen `json:"welcome_screen,omitempty"` NSFWLevel GuildNSFWLevel `json:"nsfw_level"` StageInstances []*StageInstance `json:"stage_instances,omitempty"` Stickers []*Sticker `json:"stickers"` }
type GuildApplicationCommandPermissions ¶
type GuildApplicationCommandPermissions struct { DiscordBaseObject ApplicationID Snowflake `json:"application_id"` GuildID Snowflake `json:"guild_id"` Permissions []ApplicationCommandPermissions `json:"permissions"` }
type GuildBanAdd ¶ added in v0.0.15
type GuildBanRemove ¶ added in v0.0.15
type GuildCreate ¶ added in v0.0.15
type GuildCreate struct {
*Guild
}
type GuildDelete ¶ added in v0.0.15
type GuildDelete struct {
*Guild
}
type GuildEmojisUpdate ¶ added in v0.0.15
type GuildFeature ¶
type GuildFeature string
const ( GuildFeatureAnimatedIcon GuildFeature = "ANIMATED_ICON" GuildFeatureBanner GuildFeature = "BANNER" GuildFeatureCommerce GuildFeature = "COMMERCE" GuildFeatureCommunity GuildFeature = "COMMUNITY" GuildFeatureDiscoverable GuildFeature = "DISCOVERABLE" GuildFeatureFeaturable GuildFeature = "FEATURABLE" GuildFeatureInviteSplash GuildFeature = "INVITE_SPLASH" GuildFeatureMemberVerificationGateEnabled GuildFeature = "MEMBER_VERIFICATION_GATE_ENABLED" GuildFeatureMonetizationEnabled GuildFeature = "MONETIZATION_ENABLED" GuildFeatureMoreStickers GuildFeature = "MORE_STICKERS" GuildFeatureNews GuildFeature = "NEWS" GuildFeaturePartnered GuildFeature = "PARTNERED" GuildFeaturePreviewEnabled GuildFeature = "PREVIEW_ENABLED" GuildFeaturePrivateThreads GuildFeature = "PRIVATE_THREADS" GuildFeatureRoleIcons GuildFeature = "ROLE_ICONS" GuildFeatureSevenDayThreadArchive GuildFeature = "SEVEN_DAY_THREAD_ARCHIVE" GuildFeatureThreeDayThreadArchive GuildFeature = "THREE_DAY_THREAD_ARCHIVE" GuildFeatureTicketedEventsEnabled GuildFeature = "TICKETED_EVENTS_ENABLED" GuildFeatureVanityURL GuildFeature = "VANITY_URL" GuildFeatureVerified GuildFeature = "VERIFIED" GuildFeatureVIPRegions GuildFeature = "VIP_REGIONS" GuildFeatureWelcomeScreenEnabled GuildFeature = "WELCOME_SCREEN_ENABLED" )
type GuildIntegrationsUpdate ¶ added in v0.0.15
type GuildIntegrationsUpdate struct {
GuildID Snowflake `json:"guild_id"`
}
type GuildMember ¶
type GuildMember struct { User *User `json:"user,omitempty"` Nick string `json:"nick,omitempty"` Avatar string `json:"avatar,omitempty"` Roles []Snowflake `json:"roles"` JoinedAt Time `json:"joined_at"` PremiumSince Time `json:"premium_since,omitempty"` Deaf bool `json:"deaf"` Mute bool `json:"mute"` Pending bool `json:"pending,omitempty"` Permissions string `json:"permissions,omitempty"` CommunicationDisabledUntil *Time `json:"communication_disabled_until,omitempty"` }
func (*GuildMember) GetID ¶ added in v0.1.0
func (m *GuildMember) GetID() Snowflake
func (*GuildMember) Mention ¶ added in v0.1.0
func (m *GuildMember) Mention() string
type GuildMemberAdd ¶ added in v0.0.15
type GuildMemberAdd struct { GuildID Snowflake `json:"guild_id"` *GuildMember }
type GuildMemberRemove ¶ added in v0.0.15
type GuildMemberUpdate ¶ added in v0.0.15
type GuildMemberUpdate struct { GuildID Snowflake `json:"guild_id"` Roles []Snowflake `json:"roles"` User *User `json:"user"` Nick string `json:"nick"` JoinedAt Time `json:"joined_at"` PremiumSince Time `json:"premium_since"` Deaf bool `json:"deaf"` Mute bool `json:"mute"` Pending bool `json:"pending"` }
type GuildMembersChunk ¶ added in v0.0.15
type GuildNSFWLevel ¶ added in v0.1.0
type GuildNSFWLevel int
const ( GuildNSFWLevelDefault GuildNSFWLevel = iota GuildNSFWLevelExplicit GuildNSFWLevelSafe GuildNSFWLevelAgeRestricted )
func (GuildNSFWLevel) String ¶ added in v0.1.0
func (i GuildNSFWLevel) String() string
type GuildPreview ¶
type GuildPreview struct { DiscordBaseObject Name string `json:"name"` Icon string `json:"icon,omitempty"` Splash string `json:"splash,omitempty"` DiscoverySplash string `json:"discovery_splash,omitempty"` Emojis []*Emoji `json:"emojis"` Features []GuildFeature `json:"features"` ApproximateMemberCount int `json:"approximate_member_count"` ApproximatePresenceCount int `json:"approximate_presence_count"` Description string `json:"description,omitempty"` }
type GuildRoleCreate ¶ added in v0.0.15
type GuildRoleDelete ¶ added in v0.0.15
type GuildRoleUpdate ¶ added in v0.0.15
type GuildScheduledEvent ¶ added in v0.1.0
type GuildScheduledEvent struct { DiscordBaseObject GuildID Snowflake `json:"guild_id"` ChannelID *Snowflake `json:"channel_id,omitempty"` Name string `json:"name"` Description *string `json:"description,omitempty"` ScheduledStartTime Time `json:"scheduled_start_time"` ScheduledEndTime Time `json:"scheduled_end_time"` PrivacyLevel PrivacyLevel `json:"privacy_level"` Status GuildScheduledEventStatus `json:"status"` EntityType GuildScheduledEventEntityType `json:"entity_type"` EntityID *Snowflake `json:"entity_id,omitempty"` EntityMetadata *GuildScheduledEventEntityMetadata `json:"entity_metadata,omitempty"` Creator *User `json:"creator,omitempty"` UserCount int `json:"user_count"` Image string `json:"image"` }
type GuildScheduledEventEntityMetadata ¶ added in v0.1.0
type GuildScheduledEventEntityMetadata struct {
Location string `json:"location"`
}
type GuildScheduledEventEntityType ¶ added in v0.1.0
type GuildScheduledEventEntityType int
const ( EntityTypeStageInstance GuildScheduledEventEntityType = iota + 1 EntityTypeVoice EntityTypeExternal )
func (GuildScheduledEventEntityType) String ¶ added in v0.1.0
func (i GuildScheduledEventEntityType) String() string
type GuildScheduledEventStatus ¶ added in v0.1.0
type GuildScheduledEventStatus int
const ( EventStatusScheduled GuildScheduledEventStatus = iota + 1 EventStatusActive EventStatusCompleted EventStatusCanceled )
func (GuildScheduledEventStatus) String ¶ added in v0.1.0
func (i GuildScheduledEventStatus) String() string
type GuildScheduledEventUser ¶ added in v0.1.0
type GuildScheduledEventUser struct { ScheduledEventID Snowflake `json:"guild_scheduled_event_id"` User *User `json:"user"` Member *GuildMember `json:"member"` }
type GuildStickersUpdate ¶ added in v0.0.15
type GuildUpdate ¶ added in v0.0.15
type GuildUpdate struct {
*Guild
}
type GuildWidget ¶
type GuildWidgetJSON ¶
type GuildWidgetJSON struct { DiscordBaseObject Name string `json:"name"` Channels []*Channel `json:"channels"` Members []*WidgetUser `json:"members"` PresenceCount int `json:"presence_count"` }
type HandlerFunc ¶
type HandlerFunc func(data *Interaction) *InteractionResponse
type Integration ¶
type Integration struct { DiscordBaseObject Name string `json:"name"` Type string `json:"type"` Enabled bool `json:"enabled"` Syncing bool `json:"syncing,omitempty"` RoleID Snowflake `json:"role_id,omitempty"` EnableEmoticons bool `json:"enable_emoticons,omitempty"` ExpireBehavior ExpireBehavior `json:"expire_behaviour,omitempty"` ExpireGracePeriod int64 `json:"expire_grace_period,omitempty"` User *User `json:"user,omitempty"` Account *IntegrationAccount `json:"account,omitempty"` SyncedAt Time `json:"synced_at,omitempty"` SubscriberCount int64 `json:"subscriber_count,omitempty"` Revoked bool `json:"revoked,omitempty"` Application *IntegrationApplication `json:"application,omitempty"` }
type IntegrationAccount ¶
type IntegrationAccount struct { DiscordBaseObject Name string `json:"name"` }
type IntegrationApplication ¶
type IntegrationCreate ¶ added in v0.0.15
type IntegrationCreate struct { GuildID Snowflake `json:"guild_id"` *Integration }
type IntegrationDelete ¶ added in v0.0.15
type IntegrationUpdate ¶ added in v0.0.15
type IntegrationUpdate struct { GuildID Snowflake `json:"guild_id"` *Integration }
type Interaction ¶
type Interaction struct { DiscordBaseObject ApplicationID Snowflake `json:"application_id"` Type InteractionType `json:"type"` Data json.RawMessage `json:"data,omitempty"` GuildID Snowflake `json:"guild_id"` ChannelID Snowflake `json:"channel_id"` Member *GuildMember `json:"member"` User *User `json:"user"` Token string `json:"token"` Message *Message `json:"message,omitempty"` Version int `json:"version,omitempty"` Locale string `json:"locale"` GuildLocale string `json:"guild_locale"` }
type InteractionApplicationCommandCallbackData ¶
type InteractionApplicationCommandCallbackData struct { TTS bool `json:"tts,omitempty"` Content string `json:"content,omitempty"` Embeds []*Embed `json:"embeds,omitempty"` AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"` Flags MessageFlag `json:"flags,omitempty"` Components []*Component `json:"components"` Attachments []*Attachment `json:"attachments,omitempty"` Files []*DiscordFile `json:"-"` Choices []*ApplicationCommandOptionChoice `json:"choices,omitempty"` // Data for modal response CustomID string `json:"custom_id,omitempty"` Title string `json:"title,omitempty"` }
type InteractionCreate ¶ added in v0.0.15
type InteractionCreate struct {
*Interaction
}
type InteractionResponse ¶
type InteractionResponse struct { Type ResponseType `json:"type"` Data *InteractionApplicationCommandCallbackData `json:"data,omitempty"` }
type InteractionResponseComponent ¶ added in v0.0.19
type InteractionResponseComponent struct { Type ComponentType `json:"type"` CustomID string `json:"custom_id"` Value string `json:"value"` Components []*InteractionResponseComponent `json:"components,omitempty"` }
type InteractionType ¶
type InteractionType int
const ( InteractionRequestPing InteractionType = iota + 1 InteractionApplicationCommand InteractionComponent InteractionAutoComplete InteractionModalSubmit )
Interaction types
func (InteractionType) String ¶ added in v0.1.0
func (i InteractionType) String() string
type Invite ¶
type Invite struct { // the invite code (unique ID) Code string `json:"code"` // the guild this invite is for Guild *Guild `json:"guild,omitempty"` // the channel this invite is for Channel *Channel `json:"channel"` // the user who created the invite Inviter *User `json:"inviter,omitempty"` // the target user for this invite TargetUser *User `json:"target_user,omitempty"` // The target type for this invite TargetType InviteTargetType `json:"target_type,omitempty"` // The application the invite is targeting TargetApplication *Application `json:"target_application,omitempty"` // approximate count of online members (only present when target_user is set) ApproximatePresenceCount int `json:"approximate_presence_count,omitempty"` // approximate count of total members ApproximateMemberCount int `json:"approximate_member_count,omitempty"` // number of times this invite has been used Uses int `json:"uses"` // max number of times this invite can be used MaxUses int `json:"max_uses"` // duration (in seconds) after which the invite expires MaxAge int `json:"max_age"` // whether this invite only grants temporary membership Temporary bool `json:"temporary"` // when this invite was created CreatedAt Time `json:"created_at"` }
Invite represents a code that when used, adds a user to a guild or group DM channel. https://discord.com/developers/docs/resources/invite#invite-object-invite-structure
type InviteCreate ¶ added in v0.0.15
type InviteCreate struct { ChannelID Snowflake `json:"channel_id"` Code string `json:"code"` CreatedAt Time `json:"created_at"` GuildID Snowflake `json:"guild_id"` Inviter *User `json:"inviter"` MaxAge int `json:"max_age"` MaxUses int `json:"max_uses"` TargetType InviteTargetType `json:"target_type"` TargetUser *User `json:"target_user"` TargetApplication *Application `json:"target_application"` Temporary bool `json:"temporary"` Uses int `json:"uses"` }
type InviteDelete ¶ added in v0.0.15
type InviteTargetType ¶ added in v0.0.15
type InviteTargetType int
https://discord.com/developers/docs/resources/invite#invite-object-invite-structure
const ( InviteTargetTypeStream InviteTargetType = iota + 1 InviteTargetTypeEmbeddedApplication )
func (InviteTargetType) String ¶ added in v0.1.0
func (i InviteTargetType) String() string
type JSONErrorCode ¶ added in v0.1.5
type JSONErrorCode uint
const ( JSONErrorGeneralError JSONErrorCode = 0 // General error (such as a malformed request body, amongst other things) JSONErrorUnknownAccount JSONErrorCode = 10001 // Unknown account JSONErrorUnknownApplication JSONErrorCode = 10002 // Unknown application JSONErrorUnknownChannel JSONErrorCode = 10003 // Unknown channel JSONErrorUnknownGuild JSONErrorCode = 10004 // Unknown guild JSONErrorUnknownIntegration JSONErrorCode = 10005 // Unknown integration JSONErrorUnknownInvite JSONErrorCode = 10006 // Unknown invite JSONErrorUnknownMember JSONErrorCode = 10007 // Unknown member JSONErrorUnknownMessage JSONErrorCode = 10008 // Unknown message JSONErrorUnknownPermissionOverwrite JSONErrorCode = 10009 // Unknown permission overwrite JSONErrorUnknownProvider JSONErrorCode = 10010 // Unknown provider JSONErrorUnknownRole JSONErrorCode = 10011 // Unknown role JSONErrorUnknownToken JSONErrorCode = 10012 // Unknown token JSONErrorUnknownUser JSONErrorCode = 10013 // Unknown user JSONErrorUnknownEmoji JSONErrorCode = 10014 // Unknown emoji JSONErrorUnknownWebhook JSONErrorCode = 10015 // Unknown webhook JSONErrorUnknownWebhookService JSONErrorCode = 10016 // Unknown webhook service JSONErrorUnknownSession JSONErrorCode = 10020 // Unknown session JSONErrorUnknownBan JSONErrorCode = 10026 // Unknown ban JSONErrorUnknownSKU JSONErrorCode = 10027 // Unknown SKU JSONErrorUnknownStoreListing JSONErrorCode = 10028 // Unknown Store Listing JSONErrorUnknownEntitlement JSONErrorCode = 10029 // Unknown entitlement JSONErrorUnknownBuild JSONErrorCode = 10030 // Unknown build JSONErrorUnknownLobby JSONErrorCode = 10031 // Unknown lobby JSONErrorUnknownBranch JSONErrorCode = 10032 // Unknown branch JSONErrorUnknownStoreDirectoryLayout JSONErrorCode = 10033 // Unknown store directory layout JSONErrorUnknownRedistributable JSONErrorCode = 10036 // Unknown redistributable JSONErrorUnknownGiftCode JSONErrorCode = 10038 // Unknown gift code JSONErrorUnknownStream JSONErrorCode = 10049 // Unknown stream JSONErrorUnknownPremiumServerSubscribeCooldown JSONErrorCode = 10050 // Unknown premium server subscribe cooldown JSONErrorUnknownGuildTemplate JSONErrorCode = 10057 // Unknown guild template JSONErrorUnknownDiscoverableServerCategory JSONErrorCode = 10059 // Unknown discoverable server category JSONErrorUnknownSticker JSONErrorCode = 10060 // Unknown sticker JSONErrorUnknownInteraction JSONErrorCode = 10062 // Unknown interaction JSONErrorUnknownApplicationCommand JSONErrorCode = 10063 // Unknown application command JSONErrorUnknownApplicationCommandPermissions JSONErrorCode = 10066 // Unknown application command permissions JSONErrorUnknownStageInstance JSONErrorCode = 10067 // Unknown Stage Instance JSONErrorUnknownGuildMemberVerificationForm JSONErrorCode = 10068 // Unknown Guild Member Verification Form JSONErrorUnknownGuildWelcomeScreen JSONErrorCode = 10069 // Unknown Guild Welcome Screen JSONErrorUnknownGuildScheduledEvent JSONErrorCode = 10070 // Unknown Guild Scheduled Event JSONErrorUnknownGuildScheduledEventUser JSONErrorCode = 10071 // Unknown Guild Scheduled Event User JSONErrorBotsCannotUseThisEndpoint JSONErrorCode = 20001 // Bots cannot use this endpoint JSONErrorOnlyBotsCanUseThisEndpoint JSONErrorCode = 20002 // Only bots can use this endpoint JSONErrorExplicitContentCannotBeSentToTheDesiredRecipient JSONErrorCode = 20009 // Explicit content cannot be sent to the desired recipient(s) JSONErrorYouAreNotAuthorizedToPerformThisActionOnThisApplication JSONErrorCode = 20012 // You are not authorized to perform this action on this application JSONErrorThisActionCannotBePerformedDueToSlowmodeRateLimit JSONErrorCode = 20016 // This action cannot be performed due to slowmode rate limit JSONErrorOnlyTheOwnerOfThisAccountCanPerformThisAction JSONErrorCode = 20018 // Only the owner of this account can perform this action JSONErrorThisMessageCannotBeEditedDueToAnnouncementRateLimits JSONErrorCode = 20022 // This message cannot be edited due to announcement rate limits JSONErrorTheChannelYouAreWritingHasHitTheWriteRateLimit JSONErrorCode = 20028 // The channel you are writing has hit the write rate limit JSONErrorTheWriteActionYouArePerformingOnTheServerHasHitTheWriteRateLimit JSONErrorCode = 20029 // The write action you are performing on the server has hit the write rate limit JSONErrorYourStageTopic JSONErrorCode = 20031 // Your Stage topic, server name, server description, or channel names contain words that are not allowed JSONErrorGuildPremiumSubscriptionLevelTooLow JSONErrorCode = 20035 // Guild premium subscription level too low JSONErrorMaximumNumberOfGuildsReached JSONErrorCode = 30001 // Maximum number of guilds reached (100) JSONErrorMaximumNumberOfFriendsReached JSONErrorCode = 30002 // Maximum number of friends reached (1000) JSONErrorMaximumNumberOfPinsReachedForTheChannel JSONErrorCode = 30003 // Maximum number of pins reached for the channel (50) JSONErrorMaximumNumberOfRecipientsReached JSONErrorCode = 30004 // Maximum number of recipients reached (10) JSONErrorMaximumNumberOfGuildRolesReached JSONErrorCode = 30005 // Maximum number of guild roles reached (250) JSONErrorMaximumNumberOfWebhooksReached JSONErrorCode = 30007 // Maximum number of webhooks reached (10) JSONErrorMaximumNumberOfEmojisReached JSONErrorCode = 30008 // Maximum number of emojis reached JSONErrorMaximumNumberOfReactionsReached JSONErrorCode = 30010 // Maximum number of reactions reached (20) JSONErrorMaximumNumberOfGuildChannelsReached JSONErrorCode = 30013 // Maximum number of guild channels reached (500) JSONErrorMaximumNumberOfAttachmentsInAMessageReached JSONErrorCode = 30015 // Maximum number of attachments in a message reached (10) JSONErrorMaximumNumberOfInvitesReached JSONErrorCode = 30016 // Maximum number of invites reached (1000) JSONErrorMaximumNumberOfAnimatedEmojisReached JSONErrorCode = 30018 // Maximum number of animated emojis reached JSONErrorMaximumNumberOfServerMembersReached JSONErrorCode = 30019 // Maximum number of server members reached JSONErrorMaximumNumberOfServerCategoriesHasBeenReached JSONErrorCode = 30030 // Maximum number of server categories has been reached (5) JSONErrorGuildAlreadyHasATemplate JSONErrorCode = 30031 // Guild already has a template JSONErrorMaxNumberOfThreadParticipantsHasBeenReached JSONErrorCode = 30033 // Max number of thread participants has been reached (1000) JSONErrorMaximumNumberOfBansForNon JSONErrorCode = 30035 // Maximum number of bans for non-guild members have been exceeded JSONErrorMaximumNumberOfBansFetchesHasBeenReached JSONErrorCode = 30037 // Maximum number of bans fetches has been reached JSONErrorMaximumNumberOfUncompletedGuildScheduledEventsReached JSONErrorCode = 30038 // Maximum number of uncompleted guild scheduled events reached (100) JSONErrorMaximumNumberOfStickersReached JSONErrorCode = 30039 // Maximum number of stickers reached JSONErrorMaximumNumberOfPruneRequestsHasBeenReached JSONErrorCode = 30040 // Maximum number of prune requests has been reached. Try again later JSONErrorMaximumNumberOfGuildWidgetSettingsUpdatesHasBeenReached JSONErrorCode = 30042 // Maximum number of guild widget settings updates has been reached. Try again later JSONErrorMaximumNumberOfEditsToMessagesOlderThan1HourReached JSONErrorCode = 30046 // Maximum number of edits to messages older than 1 hour reached. Try again later JSONErrorYouNeedToVerifyYourAccountInOrderToPerformThisAction JSONErrorCode = 40002 // You need to verify your account in order to perform this action JSONErrorYouAreOpeningDirectMessagesTooFast JSONErrorCode = 40003 // You are opening direct messages too fast JSONErrorSendMessagesHasBeenTemporarilyDisabled JSONErrorCode = 40004 // Send messages has been temporarily disabled JSONErrorRequestEntityTooLarge JSONErrorCode = 40005 // Request entity too large. Try sending something smaller in size JSONErrorThisFeatureHasBeenTemporarilyDisabledServer JSONErrorCode = 40006 // This feature has been temporarily disabled server-side JSONErrorTheUserIsBannedFromThisGuild JSONErrorCode = 40007 // The user is banned from this guild JSONErrorTargetUserIsNotConnectedToVoice JSONErrorCode = 40032 // Target user is not connected to voice JSONErrorThisMessageHasAlreadyBeenCrossposted JSONErrorCode = 40033 // This message has already been crossposted JSONErrorAnApplicationCommandWithThatNameAlreadyExists JSONErrorCode = 40041 // An application command with that name already exists JSONErrorMissingAccess JSONErrorCode = 50001 // Missing access JSONErrorInvalidAccountType JSONErrorCode = 50002 // Invalid account type JSONErrorCannotExecuteActionOnADMChannel JSONErrorCode = 50003 // Cannot execute action on a DM channel JSONErrorGuildWidgetDisabled JSONErrorCode = 50004 // Guild widget disabled JSONErrorCannotEditAMessageAuthoredByAnotherUser JSONErrorCode = 50005 // Cannot edit a message authored by another user JSONErrorCannotSendAnEmptyMessage JSONErrorCode = 50006 // Cannot send an empty message JSONErrorCannotSendMessagesToThisUser JSONErrorCode = 50007 // Cannot send messages to this user JSONErrorCannotSendMessagesInAVoiceChannel JSONErrorCode = 50008 // Cannot send messages in a voice channel JSONErrorChannelVerificationLevelIsTooHighForYouToGainAccess JSONErrorCode = 50009 // Channel verification level is too high for you to gain access JSONErrorOAuth2ApplicationDoesNotHaveABot JSONErrorCode = 50010 // OAuth2 application does not have a bot JSONErrorOAuth2ApplicationLimitReached JSONErrorCode = 50011 // OAuth2 application limit reached JSONErrorInvalidOAuth2State JSONErrorCode = 50012 // Invalid OAuth2 state JSONErrorYouLackPermissionsToPerformThatAction JSONErrorCode = 50013 // You lack permissions to perform that action JSONErrorInvalidAuthenticationTokenProvided JSONErrorCode = 50014 // Invalid authentication token provided JSONErrorNoteWasTooLong JSONErrorCode = 50015 // Note was too long JSONErrorProvidedTooFewOrTooManyMessagesToDelete JSONErrorCode = 50016 // Provided too few or too many messages to delete. Must provide at least 2 and fewer than 100 messages to delete JSONErrorAMessageCanOnlyBePinnedToTheChannelItWasSentIn JSONErrorCode = 50019 // A message can only be pinned to the channel it was sent in JSONErrorInviteCodeWasEitherInvalidOrTaken JSONErrorCode = 50020 // Invite code was either invalid or taken JSONErrorCannotExecuteActionOnASystemMessage JSONErrorCode = 50021 // Cannot execute action on a system message JSONErrorCannotExecuteActionOnThisChannelType JSONErrorCode = 50024 // Cannot execute action on this channel type JSONErrorInvalidOAuth2AccessTokenProvided JSONErrorCode = 50025 // Invalid OAuth2 access token provided JSONErrorMissingRequiredOAuth2Scope JSONErrorCode = 50026 // Missing required OAuth2 scope JSONErrorInvalidWebhookTokenProvided JSONErrorCode = 50027 // Invalid webhook token provided JSONErrorInvalidRole JSONErrorCode = 50028 // Invalid role JSONErrorInvalidRecipient JSONErrorCode = 50033 // Invalid Recipient(s) JSONErrorAMessageProvidedWasTooOldToBulkDelete JSONErrorCode = 50034 // A message provided was too old to bulk delete JSONErrorInvalidFormBody JSONErrorCode = 50035 // Invalid form body (returned for both JSONErrorAnInviteWasAcceptedToAGuildTheApplication JSONErrorCode = 50036 // An invite was accepted to a guild the application's bot is not in JSONErrorInvalidAPIVersionProvided JSONErrorCode = 50041 // Invalid API version provided JSONErrorFileUploadedExceedsTheMaximumSize JSONErrorCode = 50045 // File uploaded exceeds the maximum size JSONErrorInvalidFileUploaded JSONErrorCode = 50046 // Invalid file uploaded JSONErrorCannotSelf JSONErrorCode = 50054 // Cannot self-redeem this gift JSONErrorInvalidGuild JSONErrorCode = 50055 // Invalid Guild JSONErrorInvalidMessageType JSONErrorCode = 50068 // Invalid message type JSONErrorPaymentSourceRequiredToRedeemGift JSONErrorCode = 50070 // Payment source required to redeem gift JSONErrorCannotDeleteAChannelRequiredForCommunityGuilds JSONErrorCode = 50074 // Cannot delete a channel required for Community guilds JSONErrorInvalidStickerSent JSONErrorCode = 50081 // Invalid sticker sent JSONErrorTriedToPerformAnOperationOnAnArchivedThread JSONErrorCode = 50083 // Tried to perform an operation on an archived thread, such as editing a message or adding a user to the thread JSONErrorInvalidThreadNotificationSettings JSONErrorCode = 50084 // Invalid thread notification settings JSONErrorValueIsEarlierThanTheThreadCreationDate JSONErrorCode = 50085 // value is earlier than the thread creation date JSONErrorCommunityServerChannelsMustBeTextChannels JSONErrorCode = 50086 // Community server channels must be text channels JSONErrorThisServerIsNotAvailableInYourLocation JSONErrorCode = 50095 // This server is not available in your location JSONErrorThisServerNeedsMonetizationEnabledInOrderToPerformThisAction JSONErrorCode = 50097 // This server needs monetization enabled in order to perform this action JSONErrorThisServerNeedsMoreBoostsToPerformThisAction JSONErrorCode = 50101 // This server needs more boosts to perform this action JSONErrorTheRequestBodyContainsInvalidJSON JSONErrorCode = 50109 // The request body contains invalid JSON. JSONErrorTwoFactorIsRequiredForThisOperation JSONErrorCode = 60003 // Two factor is required for this operation JSONErrorNoUsersWithDiscordTagExist JSONErrorCode = 80004 // No users with DiscordTag exist JSONErrorReactionWasBlocked JSONErrorCode = 90001 // Reaction was blocked JSONErrorAPIResourceIsCurrentlyOverloaded JSONErrorCode = 130000 // API resource is currently overloaded. Try again a little later JSONErrorTheStageIsAlreadyOpen JSONErrorCode = 150006 // The Stage is already open JSONErrorCannotReplyWithoutPermissionToReadMessageHistory JSONErrorCode = 160002 // Cannot reply without permission to read message history JSONErrorAThreadHasAlreadyBeenCreatedForThisMessage JSONErrorCode = 160004 // A thread has already been created for this message JSONErrorThreadIsLocked JSONErrorCode = 160005 // Thread is locked JSONErrorMaximumNumberOfActiveThreadsReached JSONErrorCode = 160006 // Maximum number of active threads reached JSONErrorMaximumNumberOfActiveAnnouncementThreadsReached JSONErrorCode = 160007 // Maximum number of active announcement threads reached JSONErrorInvalidJSONForUploadedLottieFile JSONErrorCode = 170001 // Invalid JSON for uploaded Lottie file JSONErrorUploadedLottiesCannotContainRasterizedImagesSuchAsPNGOrJPEG JSONErrorCode = 170002 // Uploaded Lotties cannot contain rasterized images such as PNG or JPEG JSONErrorStickerMaximumFramerateExceeded JSONErrorCode = 170003 // Sticker maximum framerate exceeded JSONErrorStickerFrameCountExceedsMaximumOf1000Frames JSONErrorCode = 170004 // Sticker frame count exceeds maximum of 1000 frames JSONErrorLottieAnimationMaximumDimensionsExceeded JSONErrorCode = 170005 // Lottie animation maximum dimensions exceeded JSONErrorStickerFrameRateIsEitherTooSmallOrTooLarge JSONErrorCode = 170006 // Sticker frame rate is either too small or too large JSONErrorStickerAnimationDurationExceedsMaximumOf5Seconds JSONErrorCode = 170007 // Sticker animation duration exceeds maximum of 5 seconds JSONErrorCannotUpdateAFinishedEvent JSONErrorCode = 180000 // Cannot update a finished event JSONErrorFailedToCreateStageNeededForStageEvent JSONErrorCode = 180002 // Failed to create stage needed for stage event )
func (JSONErrorCode) String ¶ added in v0.1.5
func (i JSONErrorCode) String() string
type MembershipFieldType ¶
type MembershipFieldType string
const (
MembershipFieldTypeTerms MembershipFieldType = "TERMS"
)
type MembershipScreening ¶
type MembershipScreening struct { Version Time `json:"version"` FormFields []*MembershipScreeningField `json:"form_fields"` Description string `json:"description,omitempty"` }
type MembershipScreeningField ¶
type MembershipScreeningField struct { FieldType MembershipFieldType `json:"field_type"` Label string `json:"label"` Values []string `json:"values,omitempty"` Required bool `json:"required"` }
type Mentionable ¶ added in v0.1.0
type Mentionable interface {
Mention() string
}
type Message ¶
type Message struct { DiscordBaseObject ChannelID Snowflake `json:"channel_id"` GuildID Snowflake `json:"guild_id,omitempty"` Author *User `json:"author"` Member *GuildMember `json:"member,omitempty"` Content string `json:"content"` Timestamp Time `json:"timestamp"` EditedTimestamp Time `json:"edited_timestamp"` TTS bool `json:"tts"` MentionEveryone bool `json:"mention_everyone"` Mentions []*User `json:"mentions,omitempty"` MentionRoles []Snowflake `json:"mention_roles,omitempty"` MentionChannels []*ChannelMention `json:"mention_channels,omitempty"` Attachments []*Attachment `json:"attachments,omitempty"` 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 MessageType `json:"type"` Activity *MessageActivity `json:"activity,omitempty"` Application *MessageApplication `json:"application,omitempty"` ApplicationID Snowflake `json:"application_id"` MessageReference *MessageReference `json:"message_reference,omitempty"` Flags MessageFlag `json:"flags,omitempty"` ReferencedMessage *Message `json:"referenced_message,omitempty"` Interaction *MessageInteraction `json:"interaction,omitempty"` Thread *Channel `json:"thread,omitempty"` Components []*Component `json:"components,omitempty"` StickerItems []*StickerItem `json:"sticker_items"` Stickers []*Sticker `json:"stickers,omitempty"` }
type MessageActivity ¶
type MessageActivity struct { Type MessageActivityType `json:"type"` PartyID string `json:"party_id,omitempty"` }
type MessageActivityType ¶
type MessageActivityType uint
const ( MessageActivityTypeJoin MessageActivityType = iota + 1 MessageActivityTypeSpectate MessageActivityTypeListen MessageActivityTypeJoinRequest )
func (MessageActivityType) String ¶ added in v0.1.0
func (i MessageActivityType) String() string
type MessageApplication ¶
type MessageApplication struct { DiscordBaseObject CoverImage string `json:"cover_image,omitempty"` Description string `json:"description"` Icon string `json:"icon,omitempty"` Name string `json:"name"` }
type MessageCreate ¶ added in v0.0.15
type MessageCreate struct {
*Message
}
type MessageDelete ¶ added in v0.0.15
type MessageDeleteBulk ¶ added in v0.0.15
type MessageFlag ¶
type MessageFlag uint
const ( MsgFlagCrossposted MessageFlag = 1 << iota MsgFlagIsCrosspost MsgFlagSupressEmbeds MsgFlagSourceMessageDeleted MsgFlagUrgent MsgFlagEphemeral MsgFlagLoading )
func (MessageFlag) String ¶ added in v0.1.0
func (i MessageFlag) String() string
type MessageInteraction ¶
type MessageInteraction struct { DiscordBaseObject Type InteractionType `json:"type"` Name string `json:"name"` User *User `json:"user"` }
type MessageNotificationsLevel ¶
type MessageNotificationsLevel uint
const ( MessageNotificationsLevelAll MessageNotificationsLevel = iota MessageNotificationsLevelOnlyMentions )
func (MessageNotificationsLevel) String ¶ added in v0.1.0
func (i MessageNotificationsLevel) String() string
type MessageReactionAdd ¶ added in v0.0.15
type MessageReactionRemove ¶ added in v0.0.15
type MessageReactionRemoveAll ¶ added in v0.0.15
type MessageReactionRemoveEmoji ¶ added in v0.0.15
type MessageReference ¶
type MessageStickerFormat ¶
type MessageStickerFormat uint
const ( PNGStickerFormat MessageStickerFormat = iota + 1 APNGStickerFormat LottieStickerFormat )
func (MessageStickerFormat) String ¶ added in v0.1.0
func (i MessageStickerFormat) String() string
type MessageType ¶
type MessageType uint
const ( MessageTypeDefault MessageType = iota MessageTypeRecipientAdd MessageTypeRecipientRemove MessageTypeCall MessageTypeChannelNameChange MessageTypeChannelIconChange MessageTypeChannelPinnedMessage MessageTypeGuildMemberJoin MessageTypeUserPremiumGuildSubscription MessageTypeUserPremiumGuildSubscriptionTier1 MessageTypeUserPremiumGuildSubscriptionTier2 MessageTypeUserPremiumGuildSubscriptionTier3 MessageTypeChannelFollowAdd MessageTypeGuildDiscoveryDisqualified MessageTypeGuildDiscoveryRequalified MessageTypeGuildDiscoveryGracePeriodInitialWarning MessageTypeGuildDiscoveryGracePeriodFinalWarning MessageTypeReply MessageTypeApplicationCommand )
func (MessageType) String ¶ added in v0.1.0
func (i MessageType) String() string
type MessageUpdate ¶ added in v0.0.15
type MessageUpdate struct {
*Message
}
type PermissionOverwrite ¶
type PremiumTierLevel ¶
type PremiumTierLevel uint
const ( PremiumTierNone PremiumTierLevel = iota PremiumTier1 PremiumTier2 PremiumTier3 )
func (PremiumTierLevel) String ¶ added in v0.1.0
func (i PremiumTierLevel) String() string
type PremiumType ¶
type PremiumType uint
const ( PremiumTypeNone PremiumType = iota NitroClassic Nitro )
func (PremiumType) String ¶ added in v0.1.0
func (i PremiumType) String() string
type PresenceUpdate ¶
type PresenceUpdate struct { User *User `json:"user"` GuildID Snowflake `json:"guild_id"` Status string `json:"status"` Activities []*Activity `json:"activities"` ClientStatus *ClientStatus `json:"client_status"` }
type PrivacyLevel ¶ added in v0.0.15
type PrivacyLevel int
const ( PrivacyLevelPublic PrivacyLevel = iota + 1 PrivacyLevelGuildOnly )
func (PrivacyLevel) String ¶ added in v0.1.0
func (i PrivacyLevel) String() string
type ResponseType ¶
type ResponseType int
const ( ResponsePong ResponseType = iota + 1 ResponseChannelMessageWithSource ResponseDeferredChannelMessageWithSource ResponseDeferredMessageUpdate // buttons only ResponseUpdateMessage ResponseCommandAutocompleteResult ResponseModal )
Response types
func (ResponseType) String ¶ added in v0.1.0
func (i ResponseType) String() string
type Role ¶
type Role struct { DiscordBaseObject Name string `json:"name"` Color int `json:"color"` Hoist bool `json:"hoist"` Icon string `json:"icon"` UnicodeEmoji string `json:"unicode_emoji"` Position int `json:"position"` Permissions permissions.PermissionBit `json:"permissions"` Managed bool `json:"managed"` Mentionable bool `json:"mentionable"` Tags RoleTags `json:"tags"` }
type RoleTags ¶ added in v0.1.0
type RoleTags struct { BotID Snowflake `json:"bot_id"` IntegrationID Snowflake `json:"integration_id"` PremiumSubscriber bool }
func (*RoleTags) UnmarshalJSON ¶ added in v0.1.0
type SelectOptions ¶
type Snowflake ¶
type Snowflake uint64
func SnowflakeFromString ¶ added in v0.1.0
func (Snowflake) CreatedAt ¶
CreatedAt returns a time.Time representing the time a Snowflake was created
func (Snowflake) MarshalJSON ¶
func (*Snowflake) UnmarshalJSON ¶
type SnowflakeObject ¶ added in v0.1.0
type SnowflakeObject interface {
GetID() Snowflake
}
type StageInstance ¶ added in v0.0.15
type StageInstance struct { DiscordBaseObject GuildID Snowflake `json:"guild_id"` ChannelID Snowflake `json:"channel_id"` Topic string `json:"topic"` PrivacyLevel PrivacyLevel `json:"privacy_level"` DiscoverableDisabled bool `json:"discoverable_disabled"` }
type StageInstanceCreate ¶ added in v0.0.15
type StageInstanceCreate struct {
*StageInstance
}
type StageInstanceDelete ¶ added in v0.0.15
type StageInstanceDelete struct {
*StageInstance
}
type StageInstanceUpdate ¶ added in v0.0.15
type StageInstanceUpdate struct {
*StageInstance
}
type Sticker ¶ added in v0.1.0
type Sticker struct { StickerItem PackID Snowflake `json:"pack_id"` Description string `json:"description"` Tags string `json:"tags"` Type StickerType `json:"type"` Available bool `json:"available,omitempty"` GuildID Snowflake `json:"guild_id,omitempty"` User *User `json:"user,omitempty"` SortValue *int `json:"sort_value,omitempty"` }
type StickerFormatType ¶ added in v0.1.0
type StickerFormatType int
const ( StickerFormatTypePNG StickerFormatType = iota + 1 StickerFormatTypeAPNG StickerFormatTypeLOTTIE )
func (StickerFormatType) String ¶ added in v0.1.0
func (i StickerFormatType) String() string
type StickerItem ¶ added in v0.1.0
type StickerItem struct { DiscordBaseObject Name string `json:"name"` FormatType StickerFormatType `json:"format_type"` }
type StickerPack ¶ added in v0.1.0
type StickerTags ¶ added in v0.1.0
type StickerTags []string
func (StickerTags) MarshalJSON ¶ added in v0.1.0
func (t StickerTags) MarshalJSON() ([]byte, error)
func (StickerTags) UnmarshalJSON ¶ added in v0.1.0
func (t StickerTags) UnmarshalJSON(bytes []byte) error
type StickerType ¶ added in v0.1.0
type StickerType int
const ( StickerTypeStandard StickerType = iota + 1 StickerTypeGuild )
func (StickerType) String ¶ added in v0.1.0
func (i StickerType) String() string
type SystemChannelFlags ¶
type SystemChannelFlags uint
const ( FlagSupressJoinNotifications SystemChannelFlags = 1 << iota FlagSupressPremiumSubscriptions )
func (SystemChannelFlags) String ¶ added in v0.1.0
func (i SystemChannelFlags) String() string
type Team ¶ added in v0.0.15
type Team struct { DiscordBaseObject Icon string `json:"icon"` Members []*TeamMember `json:"members"` Name string `json:"name"` OwnerUserID Snowflake `json:"owner_user_id"` }
type TeamMember ¶ added in v0.0.15
type TeamMember struct { MembershipState TeamMembershipState `json:"membership_state"` Permissions []string `json:"permissions"` TeamID Snowflake `json:"team_id"` User *User `json:"user"` }
type TeamMembershipState ¶ added in v0.0.15
type TeamMembershipState int
const ( TeamMembershipStateInvited TeamMembershipState = iota + 1 TeamMembershipStateAccepted )
func (TeamMembershipState) String ¶ added in v0.1.0
func (i TeamMembershipState) String() string
type Template ¶
type Template struct { Code string `json:"code"` Name string `json:"name"` Description string `json:"description"` UsageCount int `json:"usage_count"` CreatorID Snowflake `json:"creator_id"` Creator *User `json:"creator"` CreatedAt Time `json:"created_at"` UpdatedAt Time `json:"updated_at"` SourceGuildID Snowflake `json:"source_guild_id"` SerializedSourceGuild Snowflake `json:"serialized_source_guild"` IsDirty bool `json:"is_dirty"` }
type ThreadCreate ¶ added in v0.0.15
type ThreadCreate struct { *Channel *ThreadMember }
type ThreadDelete ¶ added in v0.0.15
type ThreadDelete struct {
*Channel
}
type ThreadListSync ¶ added in v0.0.15
type ThreadListSync struct { GuildID Snowflake `json:"guild_id"` ChannelIDs []Snowflake `json:"channel_ids"` Threads []*Channel `json:"threads"` Members []*ThreadMember `json:"members"` }
type ThreadMember ¶
type ThreadMember struct { DiscordBaseObject UserID Snowflake `json:"user_id"` JoinedAt Time `json:"join_timestamp"` Flags uint `json:"flags"` }
type ThreadMemberUpdate ¶ added in v0.0.15
type ThreadMemberUpdate struct {
*ThreadMember
}
type ThreadMembersUpdate ¶ added in v0.0.15
type ThreadMembersUpdate struct { ID Snowflake `json:"id"` GuildID Snowflake `json:"guild_id"` MemberCount int `json:"member_count"` AddedMembers []*ThreadMember `json:"added_members"` RemovedMemberIDs []Snowflake `json:"removed_member_ids"` }
type ThreadMetadata ¶ added in v0.0.14
type ThreadUpdate ¶ added in v0.0.15
type ThreadUpdate struct {
*Channel
}
type Time ¶
func (*Time) Format ¶ added in v0.1.0
func (t *Time) Format(style TimestampStyle) string
func (*Time) LongDateTime ¶ added in v0.1.0
func (*Time) MarshalJSON ¶
func (*Time) ShortDateTime ¶ added in v0.1.0
func (*Time) UnmarshalJSON ¶
type TimestampStyle ¶ added in v0.1.0
type TimestampStyle string
const ( StyleShortTime TimestampStyle = "t" StyleLongTime TimestampStyle = "T" StyleShortDate TimestampStyle = "d" StyleLongDate TimestampStyle = "D" StyleShortDateTime TimestampStyle = "f" StyleLongDateTime TimestampStyle = "F" StyleRelative TimestampStyle = "R" )
type Timestamps ¶
type TypingStart ¶ added in v0.0.15
type TypingStart struct { ChannelID Snowflake `json:"channel_id"` GuildID Snowflake `json:"guild_id"` UserID Snowflake `json:"user_id"` Timestamp int `json:"timestamp"` Member *GuildMember `json:"member"` }
type UnavailableGuild ¶ added in v0.1.0
type UnavailableGuild struct {}
type User ¶
type User struct { DiscordBaseObject 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 int `json:"accent_color"` Locale string `json:"locale,omitempty"` Verified bool `json:"verified,omitempty"` Email string `json:"email,omitempty"` Flags UserFlags `json:"flags"` PremiumType PremiumType `json:"premium_type,omitempty"` PublicFlags UserFlags `json:"public_flags,omitempty"` }
type UserUpdate ¶ added in v0.0.15
type UserUpdate struct {
*User
}
type VerificationLevel ¶
type VerificationLevel uint
const ( VerificationLevelNone VerificationLevel = iota VerificationLevelLow VerificationLevelMedium VerificationLevelHigh VerificationLevelVeryHigh )
func (VerificationLevel) String ¶ added in v0.1.0
func (i VerificationLevel) String() string
type Visibility ¶
type Visibility uint
const ( VisibilityNone Visibility = iota VisibilityEveryone )
type VoiceRegion ¶
type VoiceServerUpdate ¶ added in v0.0.15
type VoiceState ¶
type VoiceState struct { GuildID Snowflake `json:"guild_id,omitempty"` ChannelID Snowflake `json:"channel_id,omitempty"` UserID Snowflake `json:"user_id"` Member *GuildMember `json:"guild_member,omitempty"` SessionID string `json:"session_id"` Deaf bool `json:"deaf"` Mute bool `json:"mute"` SelfDeaf bool `json:"self_deaf"` SelfMute bool `json:"self_mute"` SelfStream bool `json:"self_stream,omitempty"` SelfVideo bool `json:"self_video"` Suppress bool `json:"suppress"` }
type VoiceStateUpdate ¶ added in v0.0.15
type VoiceStateUpdate struct {
*VoiceState
}
type Webhook ¶
type Webhook struct { DiscordBaseObject // the type of the webhook Type WebhookType `json:"type"` // the guild id this webhook is for GuildID Snowflake `json:"guild_id,omitempty"` // the channel id this webhook is for ChannelID Snowflake `json:"channel_id"` // the user this webhook was created by (not returned when getting a webhook with its token) User *User `json:"user,omitempty"` // the default name of the webhook Name string `json:"name,omitempty"` // the default avatar of the webhook Avatar string `json:"avatar,omitempty"` // the secure token of the webhook (returned for Incoming Webhooks) Token string `json:"token,omitempty"` // the bot/OAuth2 application that created this webhook ApplicationID Snowflake `json:"application_id,omitempty"` }
https://discord.com/developers/docs/resources/invite#invite-object-invite-structure
type WebhookType ¶
type WebhookType uint
https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types
const ( IncomingWebhook WebhookType = iota + 1 ChannelFollowWebhook )
func (WebhookType) String ¶ added in v0.1.0
func (i WebhookType) String() string
type WebhooksUpdate ¶ added in v0.0.15
type WelcomeChannel ¶
type WelcomeScreen ¶
type WelcomeScreen struct { Description string `json:"description,omitempty"` WelcomeChannels []*WelcomeChannel `json:"welcome_channels"` }
type WidgetUser ¶
type WidgetUser struct { DiscordBaseObject Username string `json:"username"` Discriminator string `json:"discriminator"` Status string `json:"status"` AvatarURL string `json:"avatar_url"` }
Source Files ¶
- application.go
- application_string.go
- audit_log.go
- audit_log_string.go
- base.go
- channel.go
- channel_string.go
- embed.go
- emoji.go
- errors.go
- errors_string.go
- files.go
- gateway.go
- guild.go
- guild_member.go
- guild_scheduled_event.go
- guild_scheduled_event_string.go
- guild_string.go
- integration.go
- integration_string.go
- interactions.go
- interactions_string.go
- invite.go
- invite_string.go
- message.go
- message_string.go
- ratelimit.go
- role.go
- snowflake.go
- stage.go
- stage_string.go
- sticker.go
- sticker_string.go
- time.go
- user.go
- user_string.go
- voice.go
- webhook.go
- webhook_string.go