Documentation
¶
Index ¶
- Constants
- Variables
- func GuildAllChannelsID(guild string) (id string, err error)
- func MultipartBodyWithJSON(data interface{}, files []*File) (string, []byte, error)
- func SnowflakeTimestamp(ID string) (time.Time, error)
- func VerifyInteraction(r *http.Request, key ed25519.PublicKey) bool
- type APIErrorMessage
- type ActionsRow
- type Activity
- type ActivityType
- type AddedThreadMember
- type AllowedMentionType
- type Application
- type ApplicationCommand
- type ApplicationCommandInteractionData
- type ApplicationCommandInteractionDataOption
- func (o ApplicationCommandInteractionDataOption) BoolValue() bool
- func (o ApplicationCommandInteractionDataOption) ChannelValue(s *Session) *Channel
- func (o ApplicationCommandInteractionDataOption) FloatValue() float64
- func (o ApplicationCommandInteractionDataOption) GetOption(name string) (option *ApplicationCommandInteractionDataOption)
- func (o ApplicationCommandInteractionDataOption) IntValue() int64
- func (o ApplicationCommandInteractionDataOption) RoleValue(s *Session, gID string) *Role
- func (o ApplicationCommandInteractionDataOption) StringValue() string
- func (o ApplicationCommandInteractionDataOption) UintValue() uint64
- func (o ApplicationCommandInteractionDataOption) UserValue(s *Session) *User
- type ApplicationCommandInteractionDataResolved
- type ApplicationCommandOption
- type ApplicationCommandOptionChoice
- type ApplicationCommandOptionType
- type ApplicationCommandPermissionType
- type ApplicationCommandPermissions
- type ApplicationCommandPermissionsList
- type ApplicationCommandPermissionsUpdate
- type ApplicationCommandType
- type ApplicationInstallParams
- type ApplicationIntegrationType
- type ApplicationIntegrationTypeConfig
- type ApplicationRoleConnection
- type ApplicationRoleConnectionMetadata
- type ApplicationRoleConnectionMetadataType
- type Asset
- type Assets
- type AuditLogAction
- type AuditLogChange
- type AuditLogChangeKey
- type AuditLogEntry
- type AuditLogOptions
- type AuditLogOptionsType
- type AutoModerationAction
- type AutoModerationActionExecution
- type AutoModerationActionMetadata
- type AutoModerationActionType
- type AutoModerationKeywordPreset
- type AutoModerationRule
- type AutoModerationRuleCreate
- type AutoModerationRuleDelete
- type AutoModerationRuleEventType
- type AutoModerationRuleTriggerType
- type AutoModerationRuleUpdate
- type AutoModerationTriggerMetadata
- type Bucket
- type Button
- type ButtonStyle
- type Channel
- type ChannelCreate
- type ChannelDelete
- type ChannelEdit
- type ChannelFlags
- type ChannelFollow
- type ChannelPinsUpdate
- type ChannelType
- type ChannelUpdate
- type ClientStatus
- type ComponentEmoji
- type ComponentType
- type Connect
- type Disconnect
- type EmbedType
- type Emoji
- type EmojiParams
- type Entitlement
- type EntitlementCreate
- type EntitlementDelete
- type EntitlementFilterOptions
- type EntitlementOwnerType
- type EntitlementTest
- type EntitlementType
- type EntitlementUpdate
- type Event
- type EventHandler
- type EventInterfaceProvider
- type ExpireBehavior
- type ExplicitContentFilterLevel
- type File
- type ForumDefaultReaction
- type ForumLayout
- type ForumSortOrderType
- type ForumTag
- type GatewayBotResponse
- type GatewayStatusUpdate
- type Guild
- type GuildApplicationCommandPermissions
- type GuildAuditLog
- type GuildAuditLogEntryCreate
- type GuildBan
- type GuildBanAdd
- type GuildBanRemove
- type GuildChannelCreateData
- type GuildCreate
- type GuildDelete
- type GuildEmbed
- type GuildEmojisUpdate
- type GuildFeature
- type GuildIntegrationsUpdate
- type GuildMemberAdd
- type GuildMemberAddParams
- type GuildMemberParams
- type GuildMemberRemove
- type GuildMemberUpdate
- type GuildMembersChunk
- type GuildNSFWLevel
- type GuildOnboarding
- type GuildOnboardingMode
- type GuildOnboardingPrompt
- type GuildOnboardingPromptOption
- type GuildOnboardingPromptType
- type GuildParams
- type GuildPreview
- type GuildRole
- type GuildRoleCreate
- type GuildRoleDelete
- type GuildRoleUpdate
- type GuildScheduledEvent
- type GuildScheduledEventCreate
- type GuildScheduledEventDelete
- type GuildScheduledEventEntityMetadata
- type GuildScheduledEventEntityType
- type GuildScheduledEventParams
- type GuildScheduledEventPrivacyLevel
- type GuildScheduledEventStatus
- type GuildScheduledEventUpdate
- type GuildScheduledEventUser
- type GuildScheduledEventUserAdd
- type GuildScheduledEventUserRemove
- type GuildTemplate
- type GuildTemplateParams
- type GuildUpdate
- type Identify
- type IdentifyProperties
- type Integration
- type IntegrationAccount
- type IntegrationCreate
- type IntegrationDelete
- type IntegrationUpdate
- type Intent
- type Interaction
- type InteractionContextType
- type InteractionCreate
- type InteractionData
- type InteractionResponse
- type InteractionResponseData
- type InteractionResponseType
- type InteractionType
- type Invite
- type InviteCreate
- type InviteDelete
- type InviteTargetType
- type Locale
- type Member
- type MemberFlags
- type MembershipState
- type Message
- func (m *Message) ContentWithMentionsReplaced() (content string)
- func (m *Message) ContentWithMoreMentionsReplaced(s *Session) (content string, err error)
- func (m *Message) Forward() *MessageReference
- func (m *Message) GetCustomEmojis() []*Emoji
- func (m *Message) Reference() *MessageReference
- func (m *Message) SoftReference() *MessageReference
- func (m *Message) UnmarshalJSON(data []byte) error
- type MessageActivity
- type MessageActivityType
- type MessageAllowedMentions
- type MessageApplication
- type MessageAttachment
- type MessageComponent
- type MessageComponentInteractionData
- type MessageComponentInteractionDataResolved
- type MessageCreate
- type MessageDelete
- type MessageDeleteBulk
- type MessageEdit
- type MessageEmbed
- type MessageEmbedAuthor
- type MessageEmbedField
- type MessageEmbedFooter
- type MessageEmbedImage
- type MessageEmbedProvider
- type MessageEmbedThumbnail
- type MessageEmbedVideo
- type MessageFlags
- type MessageInteraction
- type MessageInteractionMetadata
- type MessageNotifications
- type MessagePollVoteAdd
- type MessagePollVoteRemove
- type MessageReaction
- type MessageReactionAdd
- type MessageReactionRemove
- type MessageReactionRemoveAll
- type MessageReactions
- type MessageReference
- type MessageReferenceType
- type MessageSend
- type MessageSnapshot
- type MessageType
- type MessageUpdate
- type MfaLevel
- type ModalSubmitInteractionData
- type Packet
- type Party
- type PermissionOverwrite
- type PermissionOverwriteType
- type Poll
- type PollAnswer
- type PollAnswerCount
- type PollLayoutType
- type PollMedia
- type PollResults
- type PremiumTier
- type Presence
- type PresenceUpdate
- type PresencesReplace
- type RESTError
- type RateLimit
- type RateLimitError
- type RateLimiter
- type ReadState
- type Ready
- type RecurrenceRule
- type RecurrenceRuleFrequency
- type RecurrenceRuleMonth
- type RecurrenceRuleNWeekDay
- type RecurrenceRuleWeekday
- type RequestConfig
- type RequestOption
- func WithAuditLogReason(reason string) RequestOption
- func WithClient(client *http.Client) RequestOption
- func WithContext(ctx context.Context) RequestOption
- func WithHeader(key, value string) RequestOption
- func WithLocale(locale Locale) RequestOption
- func WithRestRetries(max int) RequestOption
- func WithRetryOnRatelimit(retry bool) RequestOption
- type Resumed
- type Role
- type RoleFlags
- type RoleParams
- type Roles
- type SKU
- type SKUFlags
- type SKUType
- type Secrets
- type SelectMenu
- type SelectMenuDefaultValue
- type SelectMenuDefaultValueType
- type SelectMenuOption
- type SelectMenuType
- type Session
- func (s *Session) AddHandler(handler interface{}) func()
- func (s *Session) AddHandlerOnce(handler interface{}) func()
- func (s *Session) Application(appID string) (st *Application, err error)
- func (s *Session) ApplicationAssets(appID string) (ass []*Asset, err error)
- func (s *Session) ApplicationBotCreate(appID string) (st *User, err error)
- func (s *Session) ApplicationCommand(appID, guildID, cmdID string, options ...RequestOption) (cmd *ApplicationCommand, err error)
- func (s *Session) ApplicationCommandBulkOverwrite(appID string, guildID string, commands []*ApplicationCommand, ...) (createdCommands []*ApplicationCommand, err error)
- func (s *Session) ApplicationCommandCreate(appID string, guildID string, cmd *ApplicationCommand, ...) (ccmd *ApplicationCommand, err error)
- func (s *Session) ApplicationCommandDelete(appID, guildID, cmdID string, options ...RequestOption) error
- func (s *Session) ApplicationCommandEdit(appID, guildID, cmdID string, cmd *ApplicationCommand, ...) (updated *ApplicationCommand, err error)
- func (s *Session) ApplicationCommandPermissions(appID, guildID, cmdID string, options ...RequestOption) (permissions *GuildApplicationCommandPermissions, err error)
- func (s *Session) ApplicationCommandPermissionsBatchEdit(appID, guildID string, permissions []*GuildApplicationCommandPermissions, ...) (err error)
- func (s *Session) ApplicationCommandPermissionsEdit(appID, guildID, cmdID string, permissions *ApplicationCommandPermissionsList, ...) (err error)
- func (s *Session) ApplicationCommands(appID, guildID string, options ...RequestOption) (cmd []*ApplicationCommand, err error)
- func (s *Session) ApplicationCreate(ap *Application) (st *Application, err error)
- func (s *Session) ApplicationDelete(appID string) (err error)
- func (s *Session) ApplicationEmoji(appID, emojiID string, options ...RequestOption) (emoji *Emoji, err error)
- func (s *Session) ApplicationEmojiCreate(appID string, data *EmojiParams, options ...RequestOption) (emoji *Emoji, err error)
- func (s *Session) ApplicationEmojiDelete(appID, emojiID string, options ...RequestOption) (err error)
- func (s *Session) ApplicationEmojiEdit(appID string, emojiID string, data *EmojiParams, options ...RequestOption) (emoji *Emoji, err error)
- func (s *Session) ApplicationEmojis(appID string, options ...RequestOption) (emojis []*Emoji, err error)
- func (s *Session) ApplicationRoleConnectionMetadata(appID string) (st []*ApplicationRoleConnectionMetadata, err error)
- func (s *Session) ApplicationRoleConnectionMetadataUpdate(appID string, metadata []*ApplicationRoleConnectionMetadata) (st []*ApplicationRoleConnectionMetadata, err error)
- func (s *Session) ApplicationUpdate(appID string, ap *Application) (st *Application, err error)
- func (s *Session) Applications() (st []*Application, err error)
- func (s *Session) AutoModerationRule(guildID, ruleID string, options ...RequestOption) (st *AutoModerationRule, err error)
- func (s *Session) AutoModerationRuleCreate(guildID string, rule *AutoModerationRule, options ...RequestOption) (st *AutoModerationRule, err error)
- func (s *Session) AutoModerationRuleDelete(guildID, ruleID string, options ...RequestOption) (err error)
- func (s *Session) AutoModerationRuleEdit(guildID, ruleID string, rule *AutoModerationRule, options ...RequestOption) (st *AutoModerationRule, err error)
- func (s *Session) AutoModerationRules(guildID string, options ...RequestOption) (st []*AutoModerationRule, err error)
- func (s *Session) Channel(channelID string, options ...RequestOption) (st *Channel, err error)
- func (s *Session) ChannelDelete(channelID string, options ...RequestOption) (st *Channel, err error)
- func (s *Session) ChannelEdit(channelID string, data *ChannelEdit, options ...RequestOption) (st *Channel, err error)
- func (s *Session) ChannelEditComplex(channelID string, data *ChannelEdit, options ...RequestOption) (st *Channel, err error)
- func (s *Session) ChannelFileSend(channelID, name string, r io.Reader, options ...RequestOption) (*Message, error)
- func (s *Session) ChannelFileSendWithMessage(channelID, content string, name string, r io.Reader, options ...RequestOption) (*Message, error)
- func (s *Session) ChannelInviteCreate(channelID string, i Invite, options ...RequestOption) (st *Invite, err error)
- func (s *Session) ChannelInvites(channelID string, options ...RequestOption) (st []*Invite, err error)
- func (s *Session) ChannelMessage(channelID, messageID string, options ...RequestOption) (st *Message, err error)
- func (s *Session) ChannelMessageCrosspost(channelID, messageID string, options ...RequestOption) (st *Message, err error)
- func (s *Session) ChannelMessageDelete(channelID, messageID string, options ...RequestOption) (err error)
- func (s *Session) ChannelMessageEdit(channelID, messageID, content string, options ...RequestOption) (*Message, error)
- func (s *Session) ChannelMessageEditComplex(m *MessageEdit, options ...RequestOption) (st *Message, err error)
- func (s *Session) ChannelMessageEditEmbed(channelID, messageID string, embed *MessageEmbed, options ...RequestOption) (*Message, error)
- func (s *Session) ChannelMessageEditEmbeds(channelID, messageID string, embeds []*MessageEmbed, options ...RequestOption) (*Message, error)
- func (s *Session) ChannelMessagePin(channelID, messageID string, options ...RequestOption) (err error)
- func (s *Session) ChannelMessageSend(channelID string, content string, options ...RequestOption) (*Message, error)
- func (s *Session) ChannelMessageSendComplex(channelID string, data *MessageSend, options ...RequestOption) (st *Message, err error)
- func (s *Session) ChannelMessageSendEmbed(channelID string, embed *MessageEmbed, options ...RequestOption) (*Message, error)
- func (s *Session) ChannelMessageSendEmbedReply(channelID string, embed *MessageEmbed, reference *MessageReference, ...) (*Message, error)
- func (s *Session) ChannelMessageSendEmbeds(channelID string, embeds []*MessageEmbed, options ...RequestOption) (*Message, error)
- func (s *Session) ChannelMessageSendEmbedsReply(channelID string, embeds []*MessageEmbed, reference *MessageReference, ...) (*Message, error)
- func (s *Session) ChannelMessageSendReply(channelID string, content string, reference *MessageReference, ...) (*Message, error)
- func (s *Session) ChannelMessageSendTTS(channelID string, content string, options ...RequestOption) (*Message, error)
- func (s *Session) ChannelMessageUnpin(channelID, messageID string, options ...RequestOption) (err error)
- func (s *Session) ChannelMessages(channelID string, limit int, beforeID, afterID, aroundID string, ...) (st []*Message, err error)
- func (s *Session) ChannelMessagesBulkDelete(channelID string, messages []string, options ...RequestOption) (err error)
- func (s *Session) ChannelMessagesPinned(channelID string, options ...RequestOption) (st []*Message, err error)
- func (s *Session) ChannelNewsFollow(channelID, targetID string, options ...RequestOption) (st *ChannelFollow, err error)
- func (s *Session) ChannelPermissionDelete(channelID, targetID string, options ...RequestOption) (err error)
- func (s *Session) ChannelPermissionSet(channelID, targetID string, targetType PermissionOverwriteType, ...) (err error)
- func (s *Session) ChannelTyping(channelID string, options ...RequestOption) (err error)
- func (s *Session) ChannelVoiceJoin(gID, cID string, mute, deaf bool) (voice *VoiceConnection, err error)
- func (s *Session) ChannelVoiceJoinManual(gID, cID string, mute, deaf bool) (err error)
- func (s *Session) ChannelWebhooks(channelID string, options ...RequestOption) (st []*Webhook, err error)
- func (s *Session) Close() error
- func (s *Session) CloseWithCode(closeCode int) (err error)
- func (s *Session) EntitlementConsume(appID, entitlementID string, options ...RequestOption) (err error)
- func (s *Session) EntitlementTestCreate(appID string, data *EntitlementTest, options ...RequestOption) (err error)
- func (s *Session) EntitlementTestDelete(appID, entitlementID string, options ...RequestOption) (err error)
- func (s *Session) Entitlements(appID string, filterOptions *EntitlementFilterOptions, ...) (entitlements []*Entitlement, err error)
- func (s *Session) FollowupMessageCreate(interaction *Interaction, wait bool, data *WebhookParams, ...) (*Message, error)
- func (s *Session) FollowupMessageDelete(interaction *Interaction, messageID string, options ...RequestOption) error
- func (s *Session) FollowupMessageEdit(interaction *Interaction, messageID string, data *WebhookEdit, ...) (*Message, error)
- func (s *Session) ForumThreadStart(channelID, name string, archiveDuration ThreadArchiveDuration, content string, ...) (th *Channel, err error)
- func (s *Session) ForumThreadStartComplex(channelID string, threadData *ThreadStart, messageData *MessageSend, ...) (th *Channel, err error)
- func (s *Session) ForumThreadStartEmbed(channelID, name string, archiveDuration ThreadArchiveDuration, ...) (th *Channel, err error)
- func (s *Session) ForumThreadStartEmbeds(channelID, name string, archiveDuration ThreadArchiveDuration, ...) (th *Channel, err error)
- func (s *Session) Gateway(options ...RequestOption) (gateway string, err error)
- func (s *Session) GatewayBot(options ...RequestOption) (st *GatewayBotResponse, err error)
- func (s *Session) GatewayWriteStruct(data interface{}) (err error)
- func (s *Session) Guild(guildID string, options ...RequestOption) (st *Guild, err error)
- func (s *Session) GuildApplicationCommandsPermissions(appID, guildID string, options ...RequestOption) (permissions []*GuildApplicationCommandPermissions, err error)
- func (s *Session) GuildAuditLog(guildID, userID, beforeID string, actionType, limit int, ...) (st *GuildAuditLog, err error)
- func (s *Session) GuildBan(guildID, userID string, options ...RequestOption) (st *GuildBan, err error)
- func (s *Session) GuildBanCreate(guildID, userID string, days int, options ...RequestOption) (err error)
- func (s *Session) GuildBanCreateWithReason(guildID, userID, reason string, days int, options ...RequestOption) (err error)
- func (s *Session) GuildBanDelete(guildID, userID string, options ...RequestOption) (err error)
- func (s *Session) GuildBans(guildID string, limit int, beforeID, afterID string, options ...RequestOption) (st []*GuildBan, err error)
- func (s *Session) GuildChannelCreate(guildID, name string, ctype ChannelType, options ...RequestOption) (st *Channel, err error)
- func (s *Session) GuildChannelCreateComplex(guildID string, data GuildChannelCreateData, options ...RequestOption) (st *Channel, err error)
- func (s *Session) GuildChannels(guildID string, options ...RequestOption) (st []*Channel, err error)
- func (s *Session) GuildChannelsReorder(guildID string, channels []*Channel, options ...RequestOption) (err error)
- func (s *Session) GuildCreate(name string, options ...RequestOption) (st *Guild, err error)
- func (s *Session) GuildCreateWithTemplate(templateCode, name, icon string, options ...RequestOption) (st *Guild, err error)
- func (s *Session) GuildDelete(guildID string, options ...RequestOption) (err error)
- func (s *Session) GuildEdit(guildID string, g *GuildParams, options ...RequestOption) (st *Guild, err error)
- func (s *Session) GuildEmbed(guildID string, options ...RequestOption) (st *GuildEmbed, err error)
- func (s *Session) GuildEmbedEdit(guildID string, data *GuildEmbed, options ...RequestOption) (err error)
- func (s *Session) GuildEmoji(guildID, emojiID string, options ...RequestOption) (emoji *Emoji, err error)
- func (s *Session) GuildEmojiCreate(guildID string, data *EmojiParams, options ...RequestOption) (emoji *Emoji, err error)
- func (s *Session) GuildEmojiDelete(guildID, emojiID string, options ...RequestOption) (err error)
- func (s *Session) GuildEmojiEdit(guildID, emojiID string, data *EmojiParams, options ...RequestOption) (emoji *Emoji, err error)
- func (s *Session) GuildEmojis(guildID string, options ...RequestOption) (emoji []*Emoji, err error)
- func (s *Session) GuildIcon(guildID string, options ...RequestOption) (img image.Image, err error)
- func (s *Session) GuildIntegrationCreate(guildID, integrationType, integrationID string, options ...RequestOption) (err error)
- func (s *Session) GuildIntegrationDelete(guildID, integrationID string, options ...RequestOption) (err error)
- func (s *Session) GuildIntegrationEdit(guildID, integrationID string, expireBehavior, expireGracePeriod int, ...) (err error)
- func (s *Session) GuildIntegrations(guildID string, options ...RequestOption) (st []*Integration, err error)
- func (s *Session) GuildInvites(guildID string, options ...RequestOption) (st []*Invite, err error)
- func (s *Session) GuildLeave(guildID string, options ...RequestOption) (err error)
- func (s *Session) GuildMember(guildID, userID string, options ...RequestOption) (st *Member, err error)
- func (s *Session) GuildMemberAdd(guildID, userID string, data *GuildMemberAddParams, options ...RequestOption) (err error)
- func (s *Session) GuildMemberDeafen(guildID string, userID string, deaf bool, options ...RequestOption) (err error)
- func (s *Session) GuildMemberDelete(guildID, userID string, options ...RequestOption) (err error)
- func (s *Session) GuildMemberDeleteWithReason(guildID, userID, reason string, options ...RequestOption) (err error)
- func (s *Session) GuildMemberEdit(guildID, userID string, data *GuildMemberParams, options ...RequestOption) (st *Member, err error)
- func (s *Session) GuildMemberEditComplex(guildID, userID string, data *GuildMemberParams, options ...RequestOption) (st *Member, err error)
- func (s *Session) GuildMemberMove(guildID string, userID string, channelID *string, options ...RequestOption) (err error)
- func (s *Session) GuildMemberMute(guildID string, userID string, mute bool, options ...RequestOption) (err error)
- func (s *Session) GuildMemberNickname(guildID, userID, nickname string, options ...RequestOption) (err error)
- func (s *Session) GuildMemberRoleAdd(guildID, userID, roleID string, options ...RequestOption) (err error)
- func (s *Session) GuildMemberRoleRemove(guildID, userID, roleID string, options ...RequestOption) (err error)
- func (s *Session) GuildMemberTimeout(guildID string, userID string, until *time.Time, options ...RequestOption) (err error)
- func (s *Session) GuildMembers(guildID string, after string, limit int, options ...RequestOption) (st []*Member, err error)
- func (s *Session) GuildMembersSearch(guildID, query string, limit int, options ...RequestOption) (st []*Member, err error)
- func (s *Session) GuildOnboarding(guildID string, options ...RequestOption) (onboarding *GuildOnboarding, err error)
- func (s *Session) GuildOnboardingEdit(guildID string, o *GuildOnboarding, options ...RequestOption) (onboarding *GuildOnboarding, err error)
- func (s *Session) GuildPreview(guildID string, options ...RequestOption) (st *GuildPreview, err error)
- func (s *Session) GuildPrune(guildID string, days uint32, options ...RequestOption) (count uint32, err error)
- func (s *Session) GuildPruneCount(guildID string, days uint32, options ...RequestOption) (count uint32, err error)
- func (s *Session) GuildRoleCreate(guildID string, data *RoleParams, options ...RequestOption) (st *Role, err error)
- func (s *Session) GuildRoleDelete(guildID, roleID string, options ...RequestOption) (err error)
- func (s *Session) GuildRoleEdit(guildID, roleID string, data *RoleParams, options ...RequestOption) (st *Role, err error)
- func (s *Session) GuildRoleReorder(guildID string, roles []*Role, options ...RequestOption) (st []*Role, err error)
- func (s *Session) GuildRoles(guildID string, options ...RequestOption) (st []*Role, err error)
- func (s *Session) GuildScheduledEvent(guildID, eventID string, userCount bool, options ...RequestOption) (st *GuildScheduledEvent, err error)
- func (s *Session) GuildScheduledEventCreate(guildID string, event *GuildScheduledEventParams, options ...RequestOption) (st *GuildScheduledEvent, err error)
- func (s *Session) GuildScheduledEventDelete(guildID, eventID string, options ...RequestOption) (err error)
- func (s *Session) GuildScheduledEventEdit(guildID, eventID string, event *GuildScheduledEventParams, ...) (st *GuildScheduledEvent, err error)
- func (s *Session) GuildScheduledEventUsers(guildID, eventID string, limit int, withMember bool, beforeID, afterID string, ...) (st []*GuildScheduledEventUser, err error)
- func (s *Session) GuildScheduledEvents(guildID string, userCount bool, options ...RequestOption) (st []*GuildScheduledEvent, err error)
- func (s *Session) GuildSplash(guildID string, options ...RequestOption) (img image.Image, err error)
- func (s *Session) GuildTemplate(templateCode string, options ...RequestOption) (st *GuildTemplate, err error)
- func (s *Session) GuildTemplateCreate(guildID string, data *GuildTemplateParams, options ...RequestOption) (st *GuildTemplate)
- func (s *Session) GuildTemplateDelete(guildID, templateCode string, options ...RequestOption) (err error)
- func (s *Session) GuildTemplateEdit(guildID, templateCode string, data *GuildTemplateParams, ...) (st *GuildTemplate, err error)
- func (s *Session) GuildTemplateSync(guildID, templateCode string, options ...RequestOption) (err error)
- func (s *Session) GuildTemplates(guildID string, options ...RequestOption) (st []*GuildTemplate, err error)
- func (s *Session) GuildThreadsActive(guildID string, options ...RequestOption) (threads *ThreadsList, err error)
- func (s *Session) GuildWebhooks(guildID string, options ...RequestOption) (st []*Webhook, err error)
- func (s *Session) GuildWithCounts(guildID string, options ...RequestOption) (st *Guild, err error)
- func (s *Session) HeartbeatLatency() time.Duration
- func (s *Session) InteractionRespond(interaction *Interaction, resp *InteractionResponse, options ...RequestOption) error
- func (s *Session) InteractionResponse(interaction *Interaction, options ...RequestOption) (*Message, error)
- func (s *Session) InteractionResponseDelete(interaction *Interaction, options ...RequestOption) error
- func (s *Session) InteractionResponseEdit(interaction *Interaction, newresp *WebhookEdit, options ...RequestOption) (*Message, error)
- func (s *Session) Invite(inviteID string, options ...RequestOption) (st *Invite, err error)
- func (s *Session) InviteAccept(inviteID string, options ...RequestOption) (st *Invite, err error)
- func (s *Session) InviteComplex(inviteID, guildScheduledEventID string, withCounts, withExpiration bool, ...) (st *Invite, err error)
- func (s *Session) InviteDelete(inviteID string, options ...RequestOption) (st *Invite, err error)
- func (s *Session) InviteWithCounts(inviteID string, options ...RequestOption) (st *Invite, err error)
- func (s *Session) MessageReactionAdd(channelID, messageID, emojiID string, options ...RequestOption) error
- func (s *Session) MessageReactionRemove(channelID, messageID, emojiID, userID string, options ...RequestOption) error
- func (s *Session) MessageReactions(channelID, messageID, emojiID string, limit int, beforeID, afterID string, ...) (st []*User, err error)
- func (s *Session) MessageReactionsRemoveAll(channelID, messageID string, options ...RequestOption) error
- func (s *Session) MessageReactionsRemoveEmoji(channelID, messageID, emojiID string, options ...RequestOption) error
- func (s *Session) MessageThreadStart(channelID, messageID string, name string, ...) (ch *Channel, err error)
- func (s *Session) MessageThreadStartComplex(channelID, messageID string, data *ThreadStart, options ...RequestOption) (ch *Channel, err error)
- func (s *Session) Open() error
- func (s *Session) PollAnswerVoters(channelID, messageID string, answerID int) (voters []*User, err error)
- func (s *Session) PollExpire(channelID, messageID string) (msg *Message, err error)
- func (s *Session) Request(method, urlStr string, data interface{}, options ...RequestOption) (response []byte, err error)
- func (s *Session) RequestGuildMembers(guildID, query string, limit int, nonce string, presences bool) error
- func (s *Session) RequestGuildMembersBatch(guildIDs []string, query string, limit int, nonce string, presences bool) (err error)
- func (s *Session) RequestGuildMembersBatchList(guildIDs []string, userIDs []string, limit int, nonce string, presences bool) (err error)
- func (s *Session) RequestGuildMembersList(guildID string, userIDs []string, limit int, nonce string, presences bool) error
- func (s *Session) RequestWithBucketID(method, urlStr string, data interface{}, bucketID string, ...) (response []byte, err error)
- func (s *Session) RequestWithLockedBucket(method, urlStr, contentType string, b []byte, bucket *Bucket, sequence int, ...) (response []byte, err error)
- func (s *Session) SKUs(appID string) (skus []*SKU, err error)
- func (s *Session) StageInstance(channelID string, options ...RequestOption) (si *StageInstance, err error)
- func (s *Session) StageInstanceCreate(data *StageInstanceParams, options ...RequestOption) (si *StageInstance, err error)
- func (s *Session) StageInstanceDelete(channelID string, options ...RequestOption) (err error)
- func (s *Session) StageInstanceEdit(channelID string, data *StageInstanceParams, options ...RequestOption) (si *StageInstance, err error)
- func (s *Session) Subscription(skuID, subscriptionID, userID string, options ...RequestOption) (subscription *Subscription, err error)
- func (s *Session) Subscriptions(skuID string, userID string, before, after *time.Time, limit int, ...) (subscriptions []*Subscription, err error)
- func (s *Session) ThreadJoin(id string, options ...RequestOption) error
- func (s *Session) ThreadLeave(id string, options ...RequestOption) error
- func (s *Session) ThreadMember(threadID, memberID string, withMember bool, options ...RequestOption) (member *ThreadMember, err error)
- func (s *Session) ThreadMemberAdd(threadID, memberID string, options ...RequestOption) error
- func (s *Session) ThreadMemberRemove(threadID, memberID string, options ...RequestOption) error
- func (s *Session) ThreadMembers(threadID string, limit int, withMember bool, afterID string, ...) (members []*ThreadMember, err error)
- func (s *Session) ThreadStart(channelID, name string, typ ChannelType, archiveDuration ThreadArchiveDuration, ...) (ch *Channel, err error)
- func (s *Session) ThreadStartComplex(channelID string, data *ThreadStart, options ...RequestOption) (ch *Channel, err error)
- func (s *Session) ThreadsActive(channelID string, options ...RequestOption) (threads *ThreadsList, err error)
- func (s *Session) ThreadsArchived(channelID string, before *time.Time, limit int, options ...RequestOption) (threads *ThreadsList, err error)
- func (s *Session) ThreadsPrivateArchived(channelID string, before *time.Time, limit int, options ...RequestOption) (threads *ThreadsList, err error)
- func (s *Session) ThreadsPrivateJoinedArchived(channelID string, before *time.Time, limit int, options ...RequestOption) (threads *ThreadsList, err error)
- func (s *Session) UpdateCustomStatus(state string) (err error)
- func (s *Session) UpdateGameStatus(idle int, name string) (err error)
- func (s *Session) UpdateListeningStatus(name string) (err error)
- func (s *Session) UpdateStatusComplex(usd UpdateStatusData) (err error)
- func (s *Session) UpdateStreamingStatus(idle int, name string, url string) (err error)
- func (s *Session) UpdateWatchStatus(idle int, name string) (err error)
- func (s *Session) User(userID string, options ...RequestOption) (st *User, err error)
- func (s *Session) UserApplicationRoleConnection(appID string) (st *ApplicationRoleConnection, err error)
- func (s *Session) UserApplicationRoleConnectionUpdate(appID string, rconn *ApplicationRoleConnection) (st *ApplicationRoleConnection, err error)
- func (s *Session) UserAvatar(userID string, options ...RequestOption) (img image.Image, err error)
- func (s *Session) UserAvatarDecode(u *User, options ...RequestOption) (img image.Image, err error)
- func (s *Session) UserChannelCreate(recipientID string, options ...RequestOption) (st *Channel, err error)
- func (s *Session) UserChannelPermissions(userID, channelID string, fetchOptions ...RequestOption) (apermissions int64, err error)
- func (s *Session) UserConnections(options ...RequestOption) (conn []*UserConnection, err error)
- func (s *Session) UserGuildMember(guildID string, options ...RequestOption) (st *Member, err error)
- func (s *Session) UserGuilds(limit int, beforeID, afterID string, withCounts bool, options ...RequestOption) (st []*UserGuild, err error)
- func (s *Session) UserUpdate(username, avatar, banner string, options ...RequestOption) (st *User, err error)
- func (s *Session) VoiceRegions(options ...RequestOption) (st []*VoiceRegion, err error)
- func (s *Session) Webhook(webhookID string, options ...RequestOption) (st *Webhook, err error)
- func (s *Session) WebhookCreate(channelID, name, avatar string, options ...RequestOption) (st *Webhook, err error)
- func (s *Session) WebhookDelete(webhookID string, options ...RequestOption) (err error)
- func (s *Session) WebhookDeleteWithToken(webhookID, token string, options ...RequestOption) (st *Webhook, err error)
- func (s *Session) WebhookEdit(webhookID, name, avatar, channelID string, options ...RequestOption) (st *Webhook, err error)
- func (s *Session) WebhookEditWithToken(webhookID, token, name, avatar string, options ...RequestOption) (st *Webhook, err error)
- func (s *Session) WebhookExecute(webhookID, token string, wait bool, data *WebhookParams, ...) (st *Message, err error)
- func (s *Session) WebhookMessage(webhookID, token, messageID string, options ...RequestOption) (message *Message, err error)
- func (s *Session) WebhookMessageDelete(webhookID, token, messageID string, options ...RequestOption) (err error)
- func (s *Session) WebhookMessageEdit(webhookID, token, messageID string, data *WebhookEdit, ...) (st *Message, err error)
- func (s *Session) WebhookThreadExecute(webhookID, token string, wait bool, threadID string, data *WebhookParams, ...) (st *Message, err error)
- func (s *Session) WebhookWithToken(webhookID, token string, options ...RequestOption) (st *Webhook, err error)
- type SessionInformation
- type StageInstance
- type StageInstanceEventCreate
- type StageInstanceEventDelete
- type StageInstanceEventUpdate
- type StageInstanceParams
- type StageInstancePrivacyLevel
- type State
- func (s *State) Channel(channelID string) (*Channel, error)
- func (s *State) ChannelAdd(channel *Channel) error
- func (s *State) ChannelRemove(channel *Channel) error
- func (s *State) Emoji(guildID, emojiID string) (*Emoji, error)
- func (s *State) EmojiAdd(guildID string, emoji *Emoji) error
- func (s *State) EmojisAdd(guildID string, emojis []*Emoji) error
- func (s *State) Guild(guildID string) (*Guild, error)
- func (s *State) GuildAdd(guild *Guild) error
- func (s *State) GuildRemove(guild *Guild) error
- func (s *State) Member(guildID, userID string) (*Member, error)
- func (s *State) MemberAdd(member *Member) error
- func (s *State) MemberRemove(member *Member) error
- func (s *State) Message(channelID, messageID string) (*Message, error)
- func (s *State) MessageAdd(message *Message) error
- func (s *State) MessageColor(message *Message) int
- func (s *State) MessagePermissions(message *Message) (apermissions int64, err error)
- func (s *State) MessageRemove(message *Message) error
- func (s *State) OnInterface(se *Session, i interface{}) (err error)
- func (s *State) Presence(guildID, userID string) (*Presence, error)
- func (s *State) PresenceAdd(guildID string, presence *Presence) error
- func (s *State) PresenceRemove(guildID string, presence *Presence) error
- func (s *State) Role(guildID, roleID string) (*Role, error)
- func (s *State) RoleAdd(guildID string, role *Role) error
- func (s *State) RoleRemove(guildID, roleID string) error
- func (s *State) ThreadListSync(tls *ThreadListSync) error
- func (s *State) ThreadMemberUpdate(mu *ThreadMemberUpdate) error
- func (s *State) ThreadMembersUpdate(tmu *ThreadMembersUpdate) error
- func (s *State) UserChannelPermissions(userID, channelID string) (apermissions int64, err error)
- func (s *State) UserColor(userID, channelID string) int
- func (s *State) VoiceState(guildID, userID string) (*VoiceState, error)
- type Status
- type Sticker
- type StickerFormat
- type StickerItem
- type StickerPack
- type StickerType
- type Subscription
- type SubscriptionCreate
- type SubscriptionDelete
- type SubscriptionStatus
- type SubscriptionUpdate
- type SystemChannelFlag
- type Team
- type TeamMember
- type TextInput
- type TextInputStyle
- type ThreadArchiveDuration
- type ThreadCreate
- type ThreadDelete
- type ThreadListSync
- type ThreadMember
- type ThreadMemberUpdate
- type ThreadMembersUpdate
- type ThreadMetadata
- type ThreadStart
- type ThreadUpdate
- type ThreadsList
- type TimeStamps
- type TooManyRequests
- type TypingStart
- type UpdateStatusData
- type User
- type UserConnection
- type UserFlags
- type UserGuild
- type UserPremiumType
- type UserUpdate
- type VerificationLevel
- type VoiceConnection
- type VoiceRegion
- type VoiceServerUpdate
- type VoiceSpeakingUpdate
- type VoiceSpeakingUpdateHandler
- type VoiceState
- type VoiceStateUpdate
- type Webhook
- type WebhookEdit
- type WebhookParams
- type WebhookType
- type WebhooksUpdate
Constants ¶
View Source
const ( StringSelectMenu = SelectMenuType(SelectMenuComponent) UserSelectMenu = SelectMenuType(UserSelectMenuComponent) RoleSelectMenu = SelectMenuType(RoleSelectMenuComponent) MentionableSelectMenu = SelectMenuType(MentionableSelectMenuComponent) ChannelSelectMenu = SelectMenuType(ChannelSelectMenuComponent) )
View Source
const ( LogError int = iota LogWarning LogInformational LogDebug )
View Source
const ( ThreadArchiveDurationOneHour = 60 ThreadArchiveDurationOneDay = 1440 ThreadArchiveDurationThreeDays = 4320 ThreadArchiveDurationOneWeek = 10080 )
View Source
const ( SubscriptionStatusActive = 0 SubscriptionStatusEnding = 1 SubscriptionStatusInactive = 2 )
View Source
const ( EntitlementTypePurchase = 1 EntitlementTypePremiumSubscription = 2 EntitlementTypeDeveloperGift = 3 EntitlementTypeTestModePurchase = 4 EntitlementTypeFreePurchase = 5 EntitlementTypeUserGift = 6 EntitlementTypePremiumPurchase = 7 EntitlementTypeApplicationSubscription = 8 )
View Source
const ( PermissionReadMessages = 1 << 10 PermissionSendMessages = 1 << 11 PermissionSendTTSMessages = 1 << 12 PermissionManageMessages = 1 << 13 PermissionEmbedLinks = 1 << 14 PermissionAttachFiles = 1 << 15 PermissionReadMessageHistory = 1 << 16 PermissionMentionEveryone = 1 << 17 PermissionUseExternalEmojis = 1 << 18 PermissionUseSlashCommands = 1 << 31 PermissionUseApplicationCommands = 1 << 31 PermissionManageThreads = 1 << 34 PermissionCreatePublicThreads = 1 << 35 PermissionCreatePrivateThreads = 1 << 36 PermissionUseExternalStickers = 1 << 37 PermissionSendMessagesInThreads = 1 << 38 PermissionSendVoiceMessages = 1 << 46 PermissionSendPolls = 1 << 49 PermissionUseExternalApps = 1 << 50 )
View Source
const ( PermissionVoicePrioritySpeaker = 1 << 8 PermissionVoiceStreamVideo = 1 << 9 PermissionVoiceConnect = 1 << 20 PermissionVoiceSpeak = 1 << 21 PermissionVoiceMuteMembers = 1 << 22 PermissionVoiceDeafenMembers = 1 << 23 PermissionVoiceMoveMembers = 1 << 24 PermissionVoiceUseVAD = 1 << 25 PermissionVoiceRequestToSpeak = 1 << 32 PermissionUseActivities = 1 << 39 PermissionUseEmbeddedActivities = 1 << 39 PermissionUseSoundboard = 1 << 42 PermissionUseExternalSounds = 1 << 45 )
View Source
const ( PermissionChangeNickname = 1 << 26 PermissionManageNicknames = 1 << 27 PermissionManageRoles = 1 << 28 PermissionManageWebhooks = 1 << 29 PermissionManageEmojis = 1 << 30 PermissionManageGuildExpressions = 1 << 30 PermissionManageEvents = 1 << 33 PermissionViewCreatorMonetizationAnalytics = 1 << 41 PermissionCreateGuildExpressions = 1 << 43 PermissionCreateEvents = 1 << 44 )
View Source
const ( PermissionCreateInstantInvite = 1 << 0 PermissionKickMembers = 1 << 1 PermissionBanMembers = 1 << 2 PermissionAdministrator = 1 << 3 PermissionManageChannels = 1 << 4 PermissionManageServer = 1 << 5 PermissionManageGuild = 1 << 5 PermissionAddReactions = 1 << 6 PermissionViewAuditLogs = 1 << 7 PermissionViewChannel = 1 << 10 PermissionViewGuildInsights = 1 << 19 PermissionModerateMembers = 1 << 40 PermissionAllText = PermissionViewChannel | PermissionSendMessages | PermissionSendTTSMessages | PermissionManageMessages | PermissionEmbedLinks | PermissionAttachFiles | PermissionReadMessageHistory | PermissionMentionEveryone PermissionAllVoice = PermissionViewChannel | PermissionVoiceConnect | PermissionVoiceSpeak | PermissionVoiceMuteMembers | PermissionVoiceDeafenMembers | PermissionVoiceMoveMembers | PermissionVoiceUseVAD | PermissionVoicePrioritySpeaker PermissionAllChannel = PermissionAllText | PermissionAllVoice | PermissionCreateInstantInvite | PermissionManageRoles | PermissionManageChannels | PermissionAddReactions | PermissionViewAuditLogs PermissionAll = PermissionAllChannel | PermissionKickMembers | PermissionBanMembers | PermissionManageServer | PermissionAdministrator | PermissionManageWebhooks | PermissionManageEmojis )
View Source
const ( ErrCodeGeneralError = 0 ErrCodeUnknownAccount = 10001 ErrCodeUnknownApplication = 10002 ErrCodeUnknownChannel = 10003 ErrCodeUnknownGuild = 10004 ErrCodeUnknownIntegration = 10005 ErrCodeUnknownInvite = 10006 ErrCodeUnknownMember = 10007 ErrCodeUnknownMessage = 10008 ErrCodeUnknownOverwrite = 10009 ErrCodeUnknownProvider = 10010 ErrCodeUnknownRole = 10011 ErrCodeUnknownToken = 10012 ErrCodeUnknownUser = 10013 ErrCodeUnknownEmoji = 10014 ErrCodeUnknownWebhook = 10015 ErrCodeUnknownWebhookService = 10016 ErrCodeUnknownSession = 10020 ErrCodeUnknownBan = 10026 ErrCodeUnknownSKU = 10027 ErrCodeUnknownStoreListing = 10028 ErrCodeUnknownEntitlement = 10029 ErrCodeUnknownBuild = 10030 ErrCodeUnknownLobby = 10031 ErrCodeUnknownBranch = 10032 ErrCodeUnknownStoreDirectoryLayout = 10033 ErrCodeUnknownRedistributable = 10036 ErrCodeUnknownGiftCode = 10038 ErrCodeUnknownStream = 10049 ErrCodeUnknownPremiumServerSubscribeCooldown = 10050 ErrCodeUnknownGuildTemplate = 10057 ErrCodeUnknownDiscoveryCategory = 10059 ErrCodeUnknownSticker = 10060 ErrCodeUnknownInteraction = 10062 ErrCodeUnknownApplicationCommand = 10063 ErrCodeUnknownApplicationCommandPermissions = 10066 ErrCodeUnknownStageInstance = 10067 ErrCodeUnknownGuildMemberVerificationForm = 10068 ErrCodeUnknownGuildWelcomeScreen = 10069 ErrCodeUnknownGuildScheduledEvent = 10070 ErrCodeUnknownGuildScheduledEventUser = 10071 ErrUnknownTag = 10087 ErrCodeBotsCannotUseEndpoint = 20001 ErrCodeOnlyBotsCanUseEndpoint = 20002 ErrCodeExplicitContentCannotBeSentToTheDesiredRecipients = 20009 ErrCodeYouAreNotAuthorizedToPerformThisActionOnThisApplication = 20012 ErrCodeThisActionCannotBePerformedDueToSlowmodeRateLimit = 20016 ErrCodeOnlyTheOwnerOfThisAccountCanPerformThisAction = 20018 ErrCodeMessageCannotBeEditedDueToAnnouncementRateLimits = 20022 ErrCodeChannelHasHitWriteRateLimit = 20028 ErrCodeTheWriteActionYouArePerformingOnTheServerHasHitTheWriteRateLimit = 20029 ErrCodeStageTopicContainsNotAllowedWordsForPublicStages = 20031 ErrCodeGuildPremiumSubscriptionLevelTooLow = 20035 ErrCodeMaximumGuildsReached = 30001 ErrCodeMaximumPinsReached = 30003 ErrCodeMaximumNumberOfRecipientsReached = 30004 ErrCodeMaximumGuildRolesReached = 30005 ErrCodeMaximumNumberOfWebhooksReached = 30007 ErrCodeMaximumNumberOfEmojisReached = 30008 ErrCodeTooManyReactions = 30010 ErrCodeMaximumNumberOfGuildChannelsReached = 30013 ErrCodeMaximumNumberOfAttachmentsInAMessageReached = 30015 ErrCodeMaximumNumberOfInvitesReached = 30016 ErrCodeMaximumNumberOfAnimatedEmojisReached = 30018 ErrCodeMaximumNumberOfServerMembersReached = 30019 ErrCodeMaximumNumberOfGuildDiscoverySubcategoriesReached = 30030 ErrCodeGuildAlreadyHasATemplate = 30031 ErrCodeMaximumNumberOfThreadParticipantsReached = 30033 ErrCodeMaximumNumberOfBansForNonGuildMembersHaveBeenExceeded = 30035 ErrCodeMaximumNumberOfBansFetchesHasBeenReached = 30037 ErrCodeMaximumNumberOfUncompletedGuildScheduledEventsReached = 30038 ErrCodeMaximumNumberOfStickersReached = 30039 ErrCodeMaximumNumberOfPruneRequestsHasBeenReached = 30040 ErrCodeMaximumNumberOfGuildWidgetSettingsUpdatesHasBeenReached = 30042 ErrCodeMaximumNumberOfEditsToMessagesOlderThanOneHourReached = 30046 ErrCodeMaximumNumberOfPinnedThreadsInForumChannelHasBeenReached = 30047 ErrCodeMaximumNumberOfTagsInForumChannelHasBeenReached = 30048 ErrCodeActionRequiredVerifiedAccount = 40002 ErrCodeOpeningDirectMessagesTooFast = 40003 ErrCodeSendMessagesHasBeenTemporarilyDisabled = 40004 ErrCodeRequestEntityTooLarge = 40005 ErrCodeFeatureTemporarilyDisabledServerSide = 40006 ErrCodeUserIsBannedFromThisGuild = 40007 ErrCodeTargetIsNotConnectedToVoice = 40032 ErrCodeMessageAlreadyCrossposted = 40033 ErrCodeAnApplicationWithThatNameAlreadyExists = 40041 ErrCodeInteractionHasAlreadyBeenAcknowledged = 40060 ErrCodeTagNamesMustBeUnique = 40061 ErrCodeMissingAccess = 50001 ErrCodeInvalidAccountType = 50002 ErrCodeCannotExecuteActionOnDMChannel = 50003 ErrCodeEmbedDisabled = 50004 ErrCodeGuildWidgetDisabled = 50004 ErrCodeCannotEditFromAnotherUser = 50005 ErrCodeCannotSendEmptyMessage = 50006 ErrCodeCannotSendMessagesToThisUser = 50007 ErrCodeCannotSendMessagesInVoiceChannel = 50008 ErrCodeChannelVerificationLevelTooHigh = 50009 ErrCodeOAuth2ApplicationDoesNotHaveBot = 50010 ErrCodeOAuth2ApplicationLimitReached = 50011 ErrCodeInvalidOAuthState = 50012 ErrCodeMissingPermissions = 50013 ErrCodeInvalidAuthenticationToken = 50014 ErrCodeTooFewOrTooManyMessagesToDelete = 50016 ErrCodeCanOnlyPinMessageToOriginatingChannel = 50019 ErrCodeInviteCodeWasEitherInvalidOrTaken = 50020 ErrCodeCannotExecuteActionOnSystemMessage = 50021 ErrCodeCannotExecuteActionOnThisChannelType = 50024 ErrCodeInvalidOAuth2AccessTokenProvided = 50025 ErrCodeMissingRequiredOAuth2Scope = 50026 ErrCodeInvalidWebhookTokenProvided = 50027 ErrCodeInvalidRole = 50028 ErrCodeInvalidRecipients = 50033 ErrCodeMessageProvidedTooOldForBulkDelete = 50034 ErrCodeInvalidFormBody = 50035 ErrCodeInviteAcceptedToGuildApplicationsBotNotIn = 50036 ErrCodeInvalidAPIVersionProvided = 50041 ErrCodeFileUploadedExceedsTheMaximumSize = 50045 ErrCodeInvalidFileUploaded = 50046 ErrCodeInvalidGuild = 50055 ErrCodeInvalidMessageType = 50068 ErrCodeCannotDeleteAChannelRequiredForCommunityGuilds = 50074 ErrCodeInvalidStickerSent = 50081 ErrCodePerformedOperationOnArchivedThread = 50083 ErrCodeBeforeValueIsEarlierThanThreadCreationDate = 50085 ErrCodeCommunityServerChannelsMustBeTextChannels = 50086 ErrCodeThisServerIsNotAvailableInYourLocation = 50095 ErrCodeThisServerNeedsMonetizationEnabledInOrderToPerformThisAction = 50097 ErrCodeThisServerNeedsMoreBoostsToPerformThisAction = 50101 ErrCodeTheRequestBodyContainsInvalidJSON = 50109 ErrCodeNoUsersWithDiscordTagExist = 80004 ErrCodeReactionBlocked = 90001 ErrCodeAPIResourceIsCurrentlyOverloaded = 130000 ErrCodeTheStageIsAlreadyOpen = 150006 ErrCodeCannotReplyWithoutPermissionToReadMessageHistory = 160002 ErrCodeThreadAlreadyCreatedForThisMessage = 160004 ErrCodeThreadIsLocked = 160005 ErrCodeMaximumNumberOfActiveThreadsReached = 160006 ErrCodeMaximumNumberOfActiveAnnouncementThreadsReached = 160007 ErrCodeInvalidJSONForUploadedLottieFile = 170001 ErrCodeUploadedLottiesCannotContainRasterizedImages = 170002 ErrCodeStickerMaximumFramerateExceeded = 170003 ErrCodeStickerFrameCountExceedsMaximumOfOneThousandFrames = 170004 ErrCodeLottieAnimationMaximumDimensionsExceeded = 170005 ErrCodeStickerFrameRateOutOfRange = 170006 ErrCodeStickerAnimationDurationExceedsMaximumOfFiveSeconds = 170007 ErrCodeCannotUpdateAFinishedEvent = 180000 ErrCodeFailedToCreateStageNeededForStageEvent = 180002 ErrCodeCannotEnableOnboardingRequirementsAreNotMet = 350000 ErrCodeCannotUpdateOnboardingWhileBelowRequirements = 350001 )
View Source
const FailedHeartbeatAcks time.Duration = 5 * time.Millisecond
View Source
const InteractionDeadline = time.Second * 3
View Source
const VERSION = "0.30.7"
Variables ¶
View Source
var ( EndpointStatus = "https://status.discord.com/api/v2/" EndpointSm = EndpointStatus + "scheduled-maintenances/" EndpointSmActive = EndpointSm + "active.json" EndpointSmUpcoming = EndpointSm + "upcoming.json" EndpointDiscord = "https://discord.com/" EndpointAPI = EndpointDiscord + "api/v" + APIVersion + "/" EndpointGuilds = EndpointAPI + "guilds/" EndpointChannels = EndpointAPI + "channels/" EndpointUsers = EndpointAPI + "users/" EndpointGateway = EndpointAPI + "gateway" EndpointGatewayBot = EndpointGateway + "/bot" EndpointWebhooks = EndpointAPI + "webhooks/" EndpointStickers = EndpointAPI + "stickers/" EndpointStageInstances = EndpointAPI + "stage-instances" EndpointSKUs = EndpointAPI + "skus" EndpointCDN = "https://cdn.discordapp.com/" EndpointCDNAttachments = EndpointCDN + "attachments/" EndpointCDNAvatars = EndpointCDN + "avatars/" EndpointCDNIcons = EndpointCDN + "icons/" EndpointCDNSplashes = EndpointCDN + "splashes/" EndpointCDNChannelIcons = EndpointCDN + "channel-icons/" EndpointCDNBanners = EndpointCDN + "banners/" EndpointCDNGuilds = EndpointCDN + "guilds/" EndpointCDNRoleIcons = EndpointCDN + "role-icons/" EndpointVoice = EndpointAPI + "/voice/" EndpointVoiceRegions = EndpointVoice + "regions" EndpointUser = func(uID string) string { return EndpointUsers + uID } EndpointUserAvatar = func(uID, aID string) string { return EndpointCDNAvatars + uID + "/" + aID + ".png" } EndpointUserAvatarAnimated = func(uID, aID string) string { return EndpointCDNAvatars + uID + "/" + aID + ".gif" } EndpointDefaultUserAvatar = func(idx int) string { return EndpointCDN + "embed/avatars/" + strconv.Itoa(idx) + ".png" } EndpointUserBanner = func(uID, cID string) string { return EndpointCDNBanners + uID + "/" + cID + ".png" } EndpointUserBannerAnimated = func(uID, cID string) string { return EndpointCDNBanners + uID + "/" + cID + ".gif" } EndpointUserGuilds = func(uID string) string { return EndpointUsers + uID + "/guilds" } EndpointUserGuild = func(uID, gID string) string { return EndpointUsers + uID + "/guilds/" + gID } EndpointUserGuildMember = func(uID, gID string) string { return EndpointUserGuild(uID, gID) + "/member" } EndpointUserChannels = func(uID string) string { return EndpointUsers + uID + "/channels" } EndpointUserApplicationRoleConnection = func(aID string) string { return EndpointUsers + "@me/applications/" + aID + "/role-connection" } EndpointUserConnections = func(uID string) string { return EndpointUsers + uID + "/connections" } EndpointGuild = func(gID string) string { return EndpointGuilds + gID } EndpointGuildAutoModeration = func(gID string) string { return EndpointGuild(gID) + "/auto-moderation" } EndpointGuildAutoModerationRules = func(gID string) string { return EndpointGuildAutoModeration(gID) + "/rules" } EndpointGuildAutoModerationRule = func(gID, rID string) string { return EndpointGuildAutoModerationRules(gID) + "/" + rID } EndpointGuildThreads = func(gID string) string { return EndpointGuild(gID) + "/threads" } EndpointGuildActiveThreads = func(gID string) string { return EndpointGuildThreads(gID) + "/active" } EndpointGuildPreview = func(gID string) string { return EndpointGuilds + gID + "/preview" } EndpointGuildChannels = func(gID string) string { return EndpointGuilds + gID + "/channels" } EndpointGuildMembers = func(gID string) string { return EndpointGuilds + gID + "/members" } EndpointGuildMembersSearch = func(gID string) string { return EndpointGuildMembers(gID) + "/search" } EndpointGuildMember = func(gID, uID string) string { return EndpointGuilds + gID + "/members/" + uID } EndpointGuildMemberRole = func(gID, uID, rID string) string { return EndpointGuilds + gID + "/members/" + uID + "/roles/" + rID } EndpointGuildBans = func(gID string) string { return EndpointGuilds + gID + "/bans" } EndpointGuildBan = func(gID, uID string) string { return EndpointGuilds + gID + "/bans/" + uID } EndpointGuildIntegrations = func(gID string) string { return EndpointGuilds + gID + "/integrations" } EndpointGuildIntegration = func(gID, iID string) string { return EndpointGuilds + gID + "/integrations/" + iID } EndpointGuildRoles = func(gID string) string { return EndpointGuilds + gID + "/roles" } EndpointGuildRole = func(gID, rID string) string { return EndpointGuilds + gID + "/roles/" + rID } EndpointGuildInvites = func(gID string) string { return EndpointGuilds + gID + "/invites" } EndpointGuildWidget = func(gID string) string { return EndpointGuilds + gID + "/widget" } EndpointGuildEmbed = EndpointGuildWidget EndpointGuildPrune = func(gID string) string { return EndpointGuilds + gID + "/prune" } EndpointGuildIcon = func(gID, hash string) string { return EndpointCDNIcons + gID + "/" + hash + ".png" } EndpointGuildIconAnimated = func(gID, hash string) string { return EndpointCDNIcons + gID + "/" + hash + ".gif" } EndpointGuildSplash = func(gID, hash string) string { return EndpointCDNSplashes + gID + "/" + hash + ".png" } EndpointGuildWebhooks = func(gID string) string { return EndpointGuilds + gID + "/webhooks" } EndpointGuildAuditLogs = func(gID string) string { return EndpointGuilds + gID + "/audit-logs" } EndpointGuildEmojis = func(gID string) string { return EndpointGuilds + gID + "/emojis" } EndpointGuildEmoji = func(gID, eID string) string { return EndpointGuilds + gID + "/emojis/" + eID } EndpointGuildBanner = func(gID, hash string) string { return EndpointCDNBanners + gID + "/" + hash + ".png" } EndpointGuildBannerAnimated = func(gID, hash string) string { return EndpointCDNBanners + gID + "/" + hash + ".gif" } EndpointGuildStickers = func(gID string) string { return EndpointGuilds + gID + "/stickers" } EndpointGuildSticker = func(gID, sID string) string { return EndpointGuilds + gID + "/stickers/" + sID } EndpointStageInstance = func(cID string) string { return EndpointStageInstances + "/" + cID } EndpointGuildScheduledEvents = func(gID string) string { return EndpointGuilds + gID + "/scheduled-events" } EndpointGuildScheduledEvent = func(gID, eID string) string { return EndpointGuilds + gID + "/scheduled-events/" + eID } EndpointGuildScheduledEventUsers = func(gID, eID string) string { return EndpointGuildScheduledEvent(gID, eID) + "/users" } EndpointGuildOnboarding = func(gID string) string { return EndpointGuilds + gID + "/onboarding" } EndpointGuildTemplate = func(tID string) string { return EndpointGuilds + "templates/" + tID } EndpointGuildTemplates = func(gID string) string { return EndpointGuilds + gID + "/templates" } EndpointGuildTemplateSync = func(gID, tID string) string { return EndpointGuilds + gID + "/templates/" + tID } EndpointGuildMemberAvatar = func(gId, uID, aID string) string { return EndpointCDNGuilds + gId + "/users/" + uID + "/avatars/" + aID + ".png" } EndpointGuildMemberAvatarAnimated = func(gId, uID, aID string) string { return EndpointCDNGuilds + gId + "/users/" + uID + "/avatars/" + aID + ".gif" } EndpointGuildMemberBanner = func(gId, uID, hash string) string { return EndpointCDNGuilds + gId + "/users/" + uID + "/banners/" + hash + ".png" } EndpointGuildMemberBannerAnimated = func(gId, uID, hash string) string { return EndpointCDNGuilds + gId + "/users/" + uID + "/banners/" + hash + ".gif" } EndpointRoleIcon = func(rID, hash string) string { return EndpointCDNRoleIcons + rID + "/" + hash + ".png" } EndpointChannel = func(cID string) string { return EndpointChannels + cID } EndpointChannelThreads = func(cID string) string { return EndpointChannel(cID) + "/threads" } EndpointChannelActiveThreads = func(cID string) string { return EndpointChannelThreads(cID) + "/active" } EndpointChannelPublicArchivedThreads = func(cID string) string { return EndpointChannelThreads(cID) + "/archived/public" } EndpointChannelPrivateArchivedThreads = func(cID string) string { return EndpointChannelThreads(cID) + "/archived/private" } EndpointChannelJoinedPrivateArchivedThreads = func(cID string) string { return EndpointChannel(cID) + "/users/@me/threads/archived/private" } EndpointChannelPermissions = func(cID string) string { return EndpointChannels + cID + "/permissions" } EndpointChannelPermission = func(cID, tID string) string { return EndpointChannels + cID + "/permissions/" + tID } EndpointChannelInvites = func(cID string) string { return EndpointChannels + cID + "/invites" } EndpointChannelTyping = func(cID string) string { return EndpointChannels + cID + "/typing" } EndpointChannelMessages = func(cID string) string { return EndpointChannels + cID + "/messages" } EndpointChannelMessage = func(cID, mID string) string { return EndpointChannels + cID + "/messages/" + mID } EndpointChannelMessageThread = func(cID, mID string) string { return EndpointChannelMessage(cID, mID) + "/threads" } EndpointChannelMessagesBulkDelete = func(cID string) string { return EndpointChannel(cID) + "/messages/bulk-delete" } EndpointChannelMessagesPins = func(cID string) string { return EndpointChannel(cID) + "/pins" } EndpointChannelMessagePin = func(cID, mID string) string { return EndpointChannel(cID) + "/pins/" + mID } EndpointChannelMessageCrosspost = func(cID, mID string) string { return EndpointChannel(cID) + "/messages/" + mID + "/crosspost" } EndpointChannelFollow = func(cID string) string { return EndpointChannel(cID) + "/followers" } EndpointThreadMembers = func(tID string) string { return EndpointChannel(tID) + "/thread-members" } EndpointThreadMember = func(tID, mID string) string { return EndpointThreadMembers(tID) + "/" + mID } EndpointGroupIcon = func(cID, hash string) string { return EndpointCDNChannelIcons + cID + "/" + hash + ".png" } EndpointSticker = func(sID string) string { return EndpointStickers + sID } EndpointNitroStickersPacks = EndpointAPI + "/sticker-packs" EndpointChannelWebhooks = func(cID string) string { return EndpointChannel(cID) + "/webhooks" } EndpointWebhook = func(wID string) string { return EndpointWebhooks + wID } EndpointWebhookToken = func(wID, token string) string { return EndpointWebhooks + wID + "/" + token } EndpointWebhookMessage = func(wID, token, messageID string) string { return EndpointWebhookToken(wID, token) + "/messages/" + messageID } EndpointMessageReactionsAll = func(cID, mID string) string { return EndpointChannelMessage(cID, mID) + "/reactions" } EndpointMessageReactions = func(cID, mID, eID string) string { return EndpointChannelMessage(cID, mID) + "/reactions/" + eID } EndpointMessageReaction = func(cID, mID, eID, uID string) string { return EndpointMessageReactions(cID, mID, eID) + "/" + uID } EndpointPoll = func(cID, mID string) string { return EndpointChannel(cID) + "/polls/" + mID } EndpointPollAnswerVoters = func(cID, mID string, aID int) string { return EndpointPoll(cID, mID) + "/answers/" + strconv.Itoa(aID) } EndpointPollExpire = func(cID, mID string) string { return EndpointPoll(cID, mID) + "/expire" } EndpointApplicationSKUs = func(aID string) string { return EndpointApplication(aID) + "/skus" } EndpointEntitlements = func(aID string) string { return EndpointApplication(aID) + "/entitlements" } EndpointEntitlement = func(aID, eID string) string { return EndpointEntitlements(aID) + "/" + eID } EndpointEntitlementConsume = func(aID, eID string) string { return EndpointEntitlement(aID, eID) + "/consume" } EndpointSubscriptions = func(skuID string) string { return EndpointSKUs + "/" + skuID + "/subscriptions" } EndpointSubscription = func(skuID, subID string) string { return EndpointSubscriptions(skuID) + "/" + subID } EndpointApplicationGlobalCommands = func(aID string) string { return EndpointApplication(aID) + "/commands" } EndpointApplicationGlobalCommand = func(aID, cID string) string { return EndpointApplicationGlobalCommands(aID) + "/" + cID } EndpointApplicationGuildCommands = func(aID, gID string) string { return EndpointApplication(aID) + "/guilds/" + gID + "/commands" } EndpointApplicationGuildCommand = func(aID, gID, cID string) string { return EndpointApplicationGuildCommands(aID, gID) + "/" + cID } EndpointApplicationCommandPermissions = func(aID, gID, cID string) string { return EndpointApplicationGuildCommand(aID, gID, cID) + "/permissions" } EndpointApplicationCommandsGuildPermissions = func(aID, gID string) string { return EndpointApplicationGuildCommands(aID, gID) + "/permissions" } EndpointInteraction = func(aID, iToken string) string { return EndpointAPI + "interactions/" + aID + "/" + iToken } EndpointInteractionResponse = func(iID, iToken string) string { return EndpointInteraction(iID, iToken) + "/callback" } EndpointInteractionResponseActions = func(aID, iToken string) string { return EndpointWebhookMessage(aID, iToken, "@original") } EndpointFollowupMessage = func(aID, iToken string) string { return EndpointWebhookToken(aID, iToken) } EndpointFollowupMessageActions = func(aID, iToken, mID string) string { return EndpointWebhookMessage(aID, iToken, mID) } EndpointGuildCreate = EndpointAPI + "guilds" EndpointInvite = func(iID string) string { return EndpointAPI + "invites/" + iID } EndpointEmoji = func(eID string) string { return EndpointCDN + "emojis/" + eID + ".png" } EndpointEmojiAnimated = func(eID string) string { return EndpointCDN + "emojis/" + eID + ".gif" } EndpointApplications = EndpointAPI + "applications" EndpointApplication = func(aID string) string { return EndpointApplications + "/" + aID } EndpointApplicationRoleConnectionMetadata = func(aID string) string { return EndpointApplication(aID) + "/role-connections/metadata" } EndpointApplicationEmojis = func(aID string) string { return EndpointApplication(aID) + "/emojis" } EndpointApplicationEmoji = func(aID, eID string) string { return EndpointApplication(aID) + "/emojis/" + eID } EndpointOAuth2 = EndpointAPI + "oauth2/" EndpointOAuth2Applications = EndpointOAuth2 + "applications" EndpointOAuth2Application = func(aID string) string { return EndpointOAuth2Applications + "/" + aID } EndpointOAuth2ApplicationsBot = func(aID string) string { return EndpointOAuth2Applications + "/" + aID + "/bot" } EndpointOAuth2ApplicationAssets = func(aID string) string { return EndpointOAuth2Applications + "/" + aID + "/assets" } EndpointOauth2 = EndpointOAuth2 EndpointOauth2Applications = EndpointOAuth2Applications EndpointOauth2Application = EndpointOAuth2Application EndpointOauth2ApplicationsBot = EndpointOAuth2ApplicationsBot EndpointOauth2ApplicationAssets = EndpointOAuth2ApplicationAssets )
View Source
var ( ErrWSAlreadyOpen = errors.New("websocket connection is already open, cannot open a new connection while the current one is active") ErrWSNotFound = errors.New("no active websocket connection found, please establish a connection before attempting this action") ErrWSShardBounds = errors.New("invalid ShardID or ShardCount: ShardID must be less than ShardCount") ErrNilState = errors.New("state not found, please ensure that the session is properly initialized using discordgo.New() or manually assign Session.State") ErrStateNotFound = errors.New("state cache not found, the session might not be initialized correctly or might have expired") ErrMessageIncompletePermissions = errors.New("message incomplete: unable to determine permissions for this action due to missing information") ErrJSONUnmarshal = errors.New("failed to unmarshal JSON, the provided data may not match the expected structure") ErrStatusOffline = errors.New("cannot set status to offline: the system does not support setting an offline status") ErrVerificationLevelBounds = errors.New("invalid verification level: it must be a value between 0 and 3 (inclusive)") ErrPruneDaysBounds = errors.New("invalid prune days value: it must be at least 1 day") ErrGuildNoIcon = errors.New("guild does not have an icon set, ensure the guild has an icon before proceeding") ErrGuildNoSplash = errors.New("guild does not have a splash image set, ensure the guild has a splash image before proceeding") )
View Source
var ( Marshal func(v interface{}) ([]byte, error) = json.Marshal Unmarshal func(src []byte, v interface{}) error = json.Unmarshal )
View Source
var APIVersion = "9"
View Source
var EmojiRegex = regexp.MustCompile(`<(a|):[A-Za-z0-9_~]+:[0-9]{18,20}>`)
View Source
var Locales = map[Locale]string{ EnglishUS: "English (United States)", EnglishGB: "English (Great Britain)", Bulgarian: "Bulgarian", ChineseCN: "Chinese (China)", ChineseTW: "Chinese (Taiwan)", Croatian: "Croatian", Czech: "Czech", Danish: "Danish", Dutch: "Dutch", Finnish: "Finnish", French: "French", German: "German", Greek: "Greek", Hindi: "Hindi", Hungarian: "Hungarian", Italian: "Italian", Japanese: "Japanese", Korean: "Korean", Lithuanian: "Lithuanian", Norwegian: "Norwegian", Polish: "Polish", PortugueseBR: "Portuguese (Brazil)", Romanian: "Romanian", Russian: "Russian", SpanishES: "Spanish (Spain)", SpanishLATAM: "Spanish (LATAM)", Swedish: "Swedish", Thai: "Thai", Turkish: "Turkish", Ukrainian: "Ukrainian", Vietnamese: "Vietnamese", Unknown: "unknown", }
View Source
var Logger func(msgL, caller int, format string, a ...interface{})
Functions ¶
func GuildAllChannelsID ¶
func MultipartBodyWithJSON ¶
Types ¶
type APIErrorMessage ¶
type ActionsRow ¶
type ActionsRow struct {
Components []MessageComponent `json:"components"`
}
func (ActionsRow) MarshalJSON ¶
func (r ActionsRow) MarshalJSON() ([]byte, error)
func (ActionsRow) Type ¶
func (r ActionsRow) Type() ComponentType
func (*ActionsRow) UnmarshalJSON ¶
func (r *ActionsRow) UnmarshalJSON(data []byte) error
type Activity ¶
type Activity struct { Name string `json:"name"` Type ActivityType `json:"type"` URL string `json:"url,omitempty"` CreatedAt time.Time `json:"created_at"` ApplicationID string `json:"application_id,omitempty"` State string `json:"state,omitempty"` Details string `json:"details,omitempty"` Timestamps TimeStamps `json:"timestamps,omitempty"` Emoji Emoji `json:"emoji,omitempty"` Party Party `json:"party,omitempty"` Assets Assets `json:"assets,omitempty"` Secrets Secrets `json:"secrets,omitempty"` Instance bool `json:"instance,omitempty"` Flags int `json:"flags,omitempty"` SyncID string `json:"sync_id,omitempty"` }
func (*Activity) UnmarshalJSON ¶
type ActivityType ¶
type ActivityType int
const ( ActivityTypeGame ActivityType = 0 ActivityTypeStreaming ActivityType = 1 ActivityTypeListening ActivityType = 2 ActivityTypeWatching ActivityType = 3 ActivityTypeCustom ActivityType = 4 ActivityTypeCompeting ActivityType = 5 )
type AddedThreadMember ¶
type AddedThreadMember struct { *ThreadMember Member *Member `json:"member"` Presence *Presence `json:"presence"` }
type AllowedMentionType ¶
type AllowedMentionType string
const ( AllowedMentionTypeRoles AllowedMentionType = "roles" AllowedMentionTypeUsers AllowedMentionType = "users" AllowedMentionTypeEveryone AllowedMentionType = "everyone" )
type Application ¶
type Application struct { ID string `json:"id,omitempty"` Name string `json:"name"` Icon string `json:"icon,omitempty"` Description string `json:"description,omitempty"` RPCOrigins []string `json:"rpc_origins,omitempty"` BotPublic bool `json:"bot_public,omitempty"` BotRequireCodeGrant bool `json:"bot_require_code_grant,omitempty"` TermsOfServiceURL string `json:"terms_of_service_url"` PrivacyProxyURL string `json:"privacy_policy_url"` Owner *User `json:"owner"` Summary string `json:"summary"` VerifyKey string `json:"verify_key"` Team *Team `json:"team"` GuildID string `json:"guild_id"` PrimarySKUID string `json:"primary_sku_id"` Slug string `json:"slug"` CoverImage string `json:"cover_image"` Flags int `json:"flags,omitempty"` IntegrationTypesConfig map[ApplicationIntegrationType]*ApplicationIntegrationTypeConfig `json:"integration_types,omitempty"` }
type ApplicationCommand ¶
type ApplicationCommand struct { ID string `json:"id,omitempty"` ApplicationID string `json:"application_id,omitempty"` GuildID string `json:"guild_id,omitempty"` Version string `json:"version,omitempty"` Type ApplicationCommandType `json:"type,omitempty"` Name string `json:"name"` NameLocalizations *map[Locale]string `json:"name_localizations,omitempty"` DefaultPermission *bool `json:"default_permission,omitempty"` DefaultMemberPermissions *int64 `json:"default_member_permissions,string,omitempty"` NSFW *bool `json:"nsfw,omitempty"` DMPermission *bool `json:"dm_permission,omitempty"` Contexts *[]InteractionContextType `json:"contexts,omitempty"` IntegrationTypes *[]ApplicationIntegrationType `json:"integration_types,omitempty"` Description string `json:"description,omitempty"` DescriptionLocalizations *map[Locale]string `json:"description_localizations,omitempty"` Options []*ApplicationCommandOption `json:"options"` }
type ApplicationCommandInteractionData ¶
type ApplicationCommandInteractionData struct { ID string `json:"id"` Name string `json:"name"` CommandType ApplicationCommandType `json:"type"` Resolved *ApplicationCommandInteractionDataResolved `json:"resolved"` Options []*ApplicationCommandInteractionDataOption `json:"options"` TargetID string `json:"target_id"` }
func (ApplicationCommandInteractionData) GetOption ¶
func (d ApplicationCommandInteractionData) GetOption(name string) (option *ApplicationCommandInteractionDataOption)
func (ApplicationCommandInteractionData) Type ¶
func (ApplicationCommandInteractionData) Type() InteractionType
type ApplicationCommandInteractionDataOption ¶
type ApplicationCommandInteractionDataOption struct { Name string `json:"name"` Type ApplicationCommandOptionType `json:"type"` Value interface{} `json:"value,omitempty"` Options []*ApplicationCommandInteractionDataOption `json:"options,omitempty"` Focused bool `json:"focused,omitempty"` }
func (ApplicationCommandInteractionDataOption) BoolValue ¶
func (o ApplicationCommandInteractionDataOption) BoolValue() bool
func (ApplicationCommandInteractionDataOption) ChannelValue ¶
func (o ApplicationCommandInteractionDataOption) ChannelValue(s *Session) *Channel
func (ApplicationCommandInteractionDataOption) FloatValue ¶
func (o ApplicationCommandInteractionDataOption) FloatValue() float64
func (ApplicationCommandInteractionDataOption) GetOption ¶
func (o ApplicationCommandInteractionDataOption) GetOption(name string) (option *ApplicationCommandInteractionDataOption)
func (ApplicationCommandInteractionDataOption) IntValue ¶
func (o ApplicationCommandInteractionDataOption) IntValue() int64
func (ApplicationCommandInteractionDataOption) RoleValue ¶
func (o ApplicationCommandInteractionDataOption) RoleValue(s *Session, gID string) *Role
func (ApplicationCommandInteractionDataOption) StringValue ¶
func (o ApplicationCommandInteractionDataOption) StringValue() string
func (ApplicationCommandInteractionDataOption) UintValue ¶
func (o ApplicationCommandInteractionDataOption) UintValue() uint64
func (ApplicationCommandInteractionDataOption) UserValue ¶
func (o ApplicationCommandInteractionDataOption) UserValue(s *Session) *User
type ApplicationCommandInteractionDataResolved ¶
type ApplicationCommandInteractionDataResolved struct { Users map[string]*User `json:"users"` Members map[string]*Member `json:"members"` Roles map[string]*Role `json:"roles"` Channels map[string]*Channel `json:"channels"` Messages map[string]*Message `json:"messages"` Attachments map[string]*MessageAttachment `json:"attachments"` }
type ApplicationCommandOption ¶
type ApplicationCommandOption struct { Type ApplicationCommandOptionType `json:"type"` Name string `json:"name"` NameLocalizations map[Locale]string `json:"name_localizations,omitempty"` Description string `json:"description,omitempty"` DescriptionLocalizations map[Locale]string `json:"description_localizations,omitempty"` ChannelTypes []ChannelType `json:"channel_types"` Required bool `json:"required"` Options []*ApplicationCommandOption `json:"options"` Autocomplete bool `json:"autocomplete"` Choices []*ApplicationCommandOptionChoice `json:"choices"` MinValue *float64 `json:"min_value,omitempty"` MaxValue float64 `json:"max_value,omitempty"` MinLength *int `json:"min_length,omitempty"` MaxLength int `json:"max_length,omitempty"` }
type ApplicationCommandOptionType ¶
type ApplicationCommandOptionType uint8
const ( ApplicationCommandOptionSubCommand ApplicationCommandOptionType = 1 ApplicationCommandOptionSubCommandGroup ApplicationCommandOptionType = 2 ApplicationCommandOptionString ApplicationCommandOptionType = 3 ApplicationCommandOptionInteger ApplicationCommandOptionType = 4 ApplicationCommandOptionBoolean ApplicationCommandOptionType = 5 ApplicationCommandOptionUser ApplicationCommandOptionType = 6 ApplicationCommandOptionChannel ApplicationCommandOptionType = 7 ApplicationCommandOptionRole ApplicationCommandOptionType = 8 ApplicationCommandOptionMentionable ApplicationCommandOptionType = 9 ApplicationCommandOptionNumber ApplicationCommandOptionType = 10 ApplicationCommandOptionAttachment ApplicationCommandOptionType = 11 )
func (ApplicationCommandOptionType) String ¶
func (t ApplicationCommandOptionType) String() string
type ApplicationCommandPermissionType ¶
type ApplicationCommandPermissionType uint8
const ( ApplicationCommandPermissionTypeRole ApplicationCommandPermissionType = 1 ApplicationCommandPermissionTypeUser ApplicationCommandPermissionType = 2 ApplicationCommandPermissionTypeChannel ApplicationCommandPermissionType = 3 )
type ApplicationCommandPermissions ¶
type ApplicationCommandPermissions struct { ID string `json:"id"` Type ApplicationCommandPermissionType `json:"type"` Permission bool `json:"permission"` }
type ApplicationCommandPermissionsList ¶
type ApplicationCommandPermissionsList struct {
Permissions []*ApplicationCommandPermissions `json:"permissions"`
}
type ApplicationCommandPermissionsUpdate ¶
type ApplicationCommandPermissionsUpdate struct {
*GuildApplicationCommandPermissions
}
type ApplicationCommandType ¶
type ApplicationCommandType uint8
const ( ChatApplicationCommand ApplicationCommandType = 1 UserApplicationCommand ApplicationCommandType = 2 MessageApplicationCommand ApplicationCommandType = 3 )
type ApplicationIntegrationType ¶
type ApplicationIntegrationType uint
const ( ApplicationIntegrationGuildInstall ApplicationIntegrationType = 0 ApplicationIntegrationUserInstall ApplicationIntegrationType = 1 )
type ApplicationIntegrationTypeConfig ¶
type ApplicationIntegrationTypeConfig struct {
OAuth2InstallParams *ApplicationInstallParams `json:"oauth2_install_params,omitempty"`
}
type ApplicationRoleConnectionMetadata ¶
type ApplicationRoleConnectionMetadata struct { Type ApplicationRoleConnectionMetadataType `json:"type"` Key string `json:"key"` Name string `json:"name"` NameLocalizations map[Locale]string `json:"name_localizations"` Description string `json:"description"` DescriptionLocalizations map[Locale]string `json:"description_localizations"` }
type ApplicationRoleConnectionMetadataType ¶
type ApplicationRoleConnectionMetadataType int
const ( ApplicationRoleConnectionMetadataIntegerLessThanOrEqual ApplicationRoleConnectionMetadataType = 1 ApplicationRoleConnectionMetadataIntegerGreaterThanOrEqual ApplicationRoleConnectionMetadataType = 2 ApplicationRoleConnectionMetadataIntegerEqual ApplicationRoleConnectionMetadataType = 3 ApplicationRoleConnectionMetadataIntegerNotEqual ApplicationRoleConnectionMetadataType = 4 ApplicationRoleConnectionMetadataDatetimeLessThanOrEqual ApplicationRoleConnectionMetadataType = 5 ApplicationRoleConnectionMetadataDatetimeGreaterThanOrEqual ApplicationRoleConnectionMetadataType = 6 ApplicationRoleConnectionMetadataBooleanEqual ApplicationRoleConnectionMetadataType = 7 ApplicationRoleConnectionMetadataBooleanNotEqual ApplicationRoleConnectionMetadataType = 8 )
type AuditLogAction ¶
type AuditLogAction int
const ( AuditLogActionGuildUpdate AuditLogAction = 1 AuditLogActionChannelCreate AuditLogAction = 10 AuditLogActionChannelUpdate AuditLogAction = 11 AuditLogActionChannelDelete AuditLogAction = 12 AuditLogActionChannelOverwriteCreate AuditLogAction = 13 AuditLogActionChannelOverwriteUpdate AuditLogAction = 14 AuditLogActionChannelOverwriteDelete AuditLogAction = 15 AuditLogActionMemberKick AuditLogAction = 20 AuditLogActionMemberPrune AuditLogAction = 21 AuditLogActionMemberBanAdd AuditLogAction = 22 AuditLogActionMemberBanRemove AuditLogAction = 23 AuditLogActionMemberUpdate AuditLogAction = 24 AuditLogActionMemberRoleUpdate AuditLogAction = 25 AuditLogActionMemberMove AuditLogAction = 26 AuditLogActionMemberDisconnect AuditLogAction = 27 AuditLogActionBotAdd AuditLogAction = 28 AuditLogActionRoleCreate AuditLogAction = 30 AuditLogActionRoleUpdate AuditLogAction = 31 AuditLogActionRoleDelete AuditLogAction = 32 AuditLogActionInviteCreate AuditLogAction = 40 AuditLogActionInviteUpdate AuditLogAction = 41 AuditLogActionInviteDelete AuditLogAction = 42 AuditLogActionWebhookCreate AuditLogAction = 50 AuditLogActionWebhookUpdate AuditLogAction = 51 AuditLogActionWebhookDelete AuditLogAction = 52 AuditLogActionEmojiCreate AuditLogAction = 60 AuditLogActionEmojiUpdate AuditLogAction = 61 AuditLogActionEmojiDelete AuditLogAction = 62 AuditLogActionMessageDelete AuditLogAction = 72 AuditLogActionMessageBulkDelete AuditLogAction = 73 AuditLogActionMessagePin AuditLogAction = 74 AuditLogActionMessageUnpin AuditLogAction = 75 AuditLogActionIntegrationCreate AuditLogAction = 80 AuditLogActionIntegrationUpdate AuditLogAction = 81 AuditLogActionIntegrationDelete AuditLogAction = 82 AuditLogActionStageInstanceCreate AuditLogAction = 83 AuditLogActionStageInstanceUpdate AuditLogAction = 84 AuditLogActionStageInstanceDelete AuditLogAction = 85 AuditLogActionStickerCreate AuditLogAction = 90 AuditLogActionStickerUpdate AuditLogAction = 91 AuditLogActionStickerDelete AuditLogAction = 92 AuditLogGuildScheduledEventCreate AuditLogAction = 100 AuditLogGuildScheduledEventUpdate AuditLogAction = 101 AuditLogGuildScheduledEventDelete AuditLogAction = 102 AuditLogActionThreadCreate AuditLogAction = 110 AuditLogActionThreadUpdate AuditLogAction = 111 AuditLogActionThreadDelete AuditLogAction = 112 AuditLogActionApplicationCommandPermissionUpdate AuditLogAction = 121 AuditLogActionAutoModerationRuleCreate AuditLogAction = 140 AuditLogActionAutoModerationRuleUpdate AuditLogAction = 141 AuditLogActionAutoModerationRuleDelete AuditLogAction = 142 AuditLogActionAutoModerationBlockMessage AuditLogAction = 143 AuditLogActionAutoModerationFlagToChannel AuditLogAction = 144 AuditLogActionAutoModerationUserCommunicationDisabled AuditLogAction = 145 AuditLogActionCreatorMonetizationRequestCreated AuditLogAction = 150 AuditLogActionCreatorMonetizationTermsAccepted AuditLogAction = 151 AuditLogActionOnboardingPromptCreate AuditLogAction = 163 AuditLogActionOnboardingPromptUpdate AuditLogAction = 164 AuditLogActionOnboardingPromptDelete AuditLogAction = 165 AuditLogActionOnboardingCreate AuditLogAction = 166 AuditLogActionOnboardingUpdate AuditLogAction = 167 AuditLogActionHomeSettingsCreate = 190 AuditLogActionHomeSettingsUpdate = 191 )
type AuditLogChange ¶
type AuditLogChange struct { NewValue interface{} `json:"new_value"` OldValue interface{} `json:"old_value"` Key *AuditLogChangeKey `json:"key"` }
type AuditLogChangeKey ¶
type AuditLogChangeKey string
const ( AuditLogChangeKeyAfkChannelID AuditLogChangeKey = "afk_channel_id" AuditLogChangeKeyAfkTimeout AuditLogChangeKey = "afk_timeout" AuditLogChangeKeyAllow AuditLogChangeKey = "allow" AuditLogChangeKeyApplicationID AuditLogChangeKey = "application_id" AuditLogChangeKeyArchived AuditLogChangeKey = "archived" AuditLogChangeKeyAsset AuditLogChangeKey = "asset" AuditLogChangeKeyAutoArchiveDuration AuditLogChangeKey = "auto_archive_duration" AuditLogChangeKeyAvailable AuditLogChangeKey = "available" AuditLogChangeKeyAvatarHash AuditLogChangeKey = "avatar_hash" AuditLogChangeKeyBannerHash AuditLogChangeKey = "banner_hash" AuditLogChangeKeyBitrate AuditLogChangeKey = "bitrate" AuditLogChangeKeyChannelID AuditLogChangeKey = "channel_id" AuditLogChangeKeyCode AuditLogChangeKey = "code" AuditLogChangeKeyColor AuditLogChangeKey = "color" AuditLogChangeKeyCommunicationDisabledUntil AuditLogChangeKey = "communication_disabled_until" AuditLogChangeKeyDeaf AuditLogChangeKey = "deaf" AuditLogChangeKeyDefaultAutoArchiveDuration AuditLogChangeKey = "default_auto_archive_duration" AuditLogChangeKeyDefaultMessageNotification AuditLogChangeKey = "default_message_notifications" AuditLogChangeKeyDeny AuditLogChangeKey = "deny" AuditLogChangeKeyDescription AuditLogChangeKey = "description" AuditLogChangeKeyDiscoverySplashHash AuditLogChangeKey = "discovery_splash_hash" AuditLogChangeKeyEnableEmoticons AuditLogChangeKey = "enable_emoticons" AuditLogChangeKeyEntityType AuditLogChangeKey = "entity_type" AuditLogChangeKeyExpireBehavior AuditLogChangeKey = "expire_behavior" AuditLogChangeKeyExpireGracePeriod AuditLogChangeKey = "expire_grace_period" AuditLogChangeKeyExplicitContentFilter AuditLogChangeKey = "explicit_content_filter" AuditLogChangeKeyFormatType AuditLogChangeKey = "format_type" AuditLogChangeKeyGuildID AuditLogChangeKey = "guild_id" AuditLogChangeKeyHoist AuditLogChangeKey = "hoist" AuditLogChangeKeyIconHash AuditLogChangeKey = "icon_hash" AuditLogChangeKeyID AuditLogChangeKey = "id" AuditLogChangeKeyInvitable AuditLogChangeKey = "invitable" AuditLogChangeKeyInviterID AuditLogChangeKey = "inviter_id" AuditLogChangeKeyLocation AuditLogChangeKey = "location" AuditLogChangeKeyLocked AuditLogChangeKey = "locked" AuditLogChangeKeyMaxAge AuditLogChangeKey = "max_age" AuditLogChangeKeyMaxUses AuditLogChangeKey = "max_uses" AuditLogChangeKeyMentionable AuditLogChangeKey = "mentionable" AuditLogChangeKeyMfaLevel AuditLogChangeKey = "mfa_level" AuditLogChangeKeyMute AuditLogChangeKey = "mute" AuditLogChangeKeyName AuditLogChangeKey = "name" AuditLogChangeKeyNick AuditLogChangeKey = "nick" AuditLogChangeKeyNSFW AuditLogChangeKey = "nsfw" AuditLogChangeKeyOwnerID AuditLogChangeKey = "owner_id" AuditLogChangeKeyPermissionOverwrite AuditLogChangeKey = "permission_overwrites" AuditLogChangeKeyPermissions AuditLogChangeKey = "permissions" AuditLogChangeKeyPosition AuditLogChangeKey = "position" AuditLogChangeKeyPreferredLocale AuditLogChangeKey = "preferred_locale" AuditLogChangeKeyPrivacylevel AuditLogChangeKey = "privacy_level" AuditLogChangeKeyPruneDeleteDays AuditLogChangeKey = "prune_delete_days" AuditLogChangeKeyPublicUpdatesChannelID AuditLogChangeKey = "public_updates_channel_id" AuditLogChangeKeyRateLimitPerUser AuditLogChangeKey = "rate_limit_per_user" AuditLogChangeKeyRegion AuditLogChangeKey = "region" AuditLogChangeKeyRulesChannelID AuditLogChangeKey = "rules_channel_id" AuditLogChangeKeySplashHash AuditLogChangeKey = "splash_hash" AuditLogChangeKeyStatus AuditLogChangeKey = "status" AuditLogChangeKeySystemChannelID AuditLogChangeKey = "system_channel_id" AuditLogChangeKeyTags AuditLogChangeKey = "tags" AuditLogChangeKeyTemporary AuditLogChangeKey = "temporary" AuditLogChangeKeyTempoary = AuditLogChangeKeyTemporary AuditLogChangeKeyTopic AuditLogChangeKey = "topic" AuditLogChangeKeyType AuditLogChangeKey = "type" AuditLogChangeKeyUnicodeEmoji AuditLogChangeKey = "unicode_emoji" AuditLogChangeKeyUserLimit AuditLogChangeKey = "user_limit" AuditLogChangeKeyUses AuditLogChangeKey = "uses" AuditLogChangeKeyVanityURLCode AuditLogChangeKey = "vanity_url_code" AuditLogChangeKeyVerificationLevel AuditLogChangeKey = "verification_level" AuditLogChangeKeyWidgetChannelID AuditLogChangeKey = "widget_channel_id" AuditLogChangeKeyWidgetEnabled AuditLogChangeKey = "widget_enabled" AuditLogChangeKeyRoleAdd AuditLogChangeKey = "$add" AuditLogChangeKeyRoleRemove AuditLogChangeKey = "$remove" )
type AuditLogEntry ¶
type AuditLogEntry struct { TargetID string `json:"target_id"` Changes []*AuditLogChange `json:"changes"` UserID string `json:"user_id"` ID string `json:"id"` ActionType *AuditLogAction `json:"action_type"` Options *AuditLogOptions `json:"options"` Reason string `json:"reason"` }
type AuditLogOptions ¶
type AuditLogOptions struct { DeleteMemberDays string `json:"delete_member_days"` MembersRemoved string `json:"members_removed"` ChannelID string `json:"channel_id"` MessageID string `json:"message_id"` Count string `json:"count"` ID string `json:"id"` Type *AuditLogOptionsType `json:"type"` RoleName string `json:"role_name"` ApplicationID string `json:"application_id"` AutoModerationRuleName string `json:"auto_moderation_rule_name"` AutoModerationRuleTriggerType string `json:"auto_moderation_rule_trigger_type"` IntegrationType string `json:"integration_type"` }
type AuditLogOptionsType ¶
type AuditLogOptionsType string
const ( AuditLogOptionsTypeRole AuditLogOptionsType = "0" AuditLogOptionsTypeMember AuditLogOptionsType = "1" )
type AutoModerationAction ¶
type AutoModerationAction struct { Type AutoModerationActionType `json:"type"` Metadata *AutoModerationActionMetadata `json:"metadata,omitempty"` }
type AutoModerationActionExecution ¶
type AutoModerationActionExecution struct { GuildID string `json:"guild_id"` Action AutoModerationAction `json:"action"` RuleID string `json:"rule_id"` RuleTriggerType AutoModerationRuleTriggerType `json:"rule_trigger_type"` UserID string `json:"user_id"` ChannelID string `json:"channel_id"` MessageID string `json:"message_id"` AlertSystemMessageID string `json:"alert_system_message_id"` Content string `json:"content"` MatchedKeyword string `json:"matched_keyword"` MatchedContent string `json:"matched_content"` }
type AutoModerationActionType ¶
type AutoModerationActionType int
const ( AutoModerationRuleActionBlockMessage AutoModerationActionType = 1 AutoModerationRuleActionSendAlertMessage AutoModerationActionType = 2 AutoModerationRuleActionTimeout AutoModerationActionType = 3 )
type AutoModerationKeywordPreset ¶
type AutoModerationKeywordPreset uint
const ( AutoModerationKeywordPresetProfanity AutoModerationKeywordPreset = 1 AutoModerationKeywordPresetSexualContent AutoModerationKeywordPreset = 2 AutoModerationKeywordPresetSlurs AutoModerationKeywordPreset = 3 )
type AutoModerationRule ¶
type AutoModerationRule struct { ID string `json:"id,omitempty"` GuildID string `json:"guild_id,omitempty"` Name string `json:"name,omitempty"` CreatorID string `json:"creator_id,omitempty"` EventType AutoModerationRuleEventType `json:"event_type,omitempty"` TriggerType AutoModerationRuleTriggerType `json:"trigger_type,omitempty"` TriggerMetadata *AutoModerationTriggerMetadata `json:"trigger_metadata,omitempty"` Actions []AutoModerationAction `json:"actions,omitempty"` Enabled *bool `json:"enabled,omitempty"` ExemptRoles *[]string `json:"exempt_roles,omitempty"` ExemptChannels *[]string `json:"exempt_channels,omitempty"` }
type AutoModerationRuleCreate ¶
type AutoModerationRuleCreate struct {
*AutoModerationRule
}
type AutoModerationRuleDelete ¶
type AutoModerationRuleDelete struct {
*AutoModerationRule
}
type AutoModerationRuleEventType ¶
type AutoModerationRuleEventType int
const (
AutoModerationEventMessageSend AutoModerationRuleEventType = 1
)
type AutoModerationRuleTriggerType ¶
type AutoModerationRuleTriggerType int
const ( AutoModerationEventTriggerKeyword AutoModerationRuleTriggerType = 1 AutoModerationEventTriggerHarmfulLink AutoModerationRuleTriggerType = 2 AutoModerationEventTriggerSpam AutoModerationRuleTriggerType = 3 AutoModerationEventTriggerKeywordPreset AutoModerationRuleTriggerType = 4 )
type AutoModerationRuleUpdate ¶
type AutoModerationRuleUpdate struct {
*AutoModerationRule
}
type AutoModerationTriggerMetadata ¶
type AutoModerationTriggerMetadata struct { KeywordFilter []string `json:"keyword_filter,omitempty"` RegexPatterns []string `json:"regex_patterns,omitempty"` Presets []AutoModerationKeywordPreset `json:"presets,omitempty"` AllowList *[]string `json:"allow_list,omitempty"` MentionTotalLimit int `json:"mention_total_limit,omitempty"` }
type Bucket ¶
type Button ¶
type Button struct { Label string `json:"label"` Style ButtonStyle `json:"style"` Disabled bool `json:"disabled"` Emoji *ComponentEmoji `json:"emoji,omitempty"` URL string `json:"url,omitempty"` CustomID string `json:"custom_id,omitempty"` SKUID string `json:"sku_id,omitempty"` }
func (Button) MarshalJSON ¶
func (Button) Type ¶
func (Button) Type() ComponentType
type ButtonStyle ¶
type ButtonStyle uint
const ( PrimaryButton ButtonStyle = 1 SecondaryButton ButtonStyle = 2 SuccessButton ButtonStyle = 3 DangerButton ButtonStyle = 4 LinkButton ButtonStyle = 5 PremiumButton ButtonStyle = 6 )
type Channel ¶
type Channel struct { ID string `json:"id"` GuildID string `json:"guild_id"` Name string `json:"name"` Topic string `json:"topic"` Type ChannelType `json:"type"` LastMessageID string `json:"last_message_id"` LastPinTimestamp *time.Time `json:"last_pin_timestamp"` MessageCount int `json:"message_count"` MemberCount int `json:"member_count"` NSFW bool `json:"nsfw"` Icon string `json:"icon"` Position int `json:"position"` Bitrate int `json:"bitrate"` Recipients []*User `json:"recipients"` Messages []*Message `json:"-"` PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites"` UserLimit int `json:"user_limit"` ParentID string `json:"parent_id"` RateLimitPerUser int `json:"rate_limit_per_user"` OwnerID string `json:"owner_id"` ApplicationID string `json:"application_id"` ThreadMetadata *ThreadMetadata `json:"thread_metadata,omitempty"` Member *ThreadMember `json:"thread_member"` Members []*ThreadMember `json:"-"` Flags ChannelFlags `json:"flags"` AvailableTags []ForumTag `json:"available_tags"` AppliedTags []string `json:"applied_tags"` DefaultReactionEmoji ForumDefaultReaction `json:"default_reaction_emoji"` DefaultThreadRateLimitPerUser int `json:"default_thread_rate_limit_per_user"` DefaultSortOrder *ForumSortOrderType `json:"default_sort_order"` DefaultForumLayout ForumLayout `json:"default_forum_layout"` }
type ChannelCreate ¶
type ChannelCreate struct {
*Channel
}
type ChannelDelete ¶
type ChannelDelete struct {
*Channel
}
type ChannelEdit ¶
type ChannelEdit struct { Name string `json:"name,omitempty"` Topic string `json:"topic,omitempty"` NSFW *bool `json:"nsfw,omitempty"` Position *int `json:"position,omitempty"` Bitrate int `json:"bitrate,omitempty"` UserLimit int `json:"user_limit,omitempty"` PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites,omitempty"` ParentID string `json:"parent_id,omitempty"` RateLimitPerUser *int `json:"rate_limit_per_user,omitempty"` Flags *ChannelFlags `json:"flags,omitempty"` DefaultThreadRateLimitPerUser *int `json:"default_thread_rate_limit_per_user,omitempty"` Archived *bool `json:"archived,omitempty"` AutoArchiveDuration ThreadArchiveDuration `json:"auto_archive_duration,omitempty"` Locked *bool `json:"locked,omitempty"` Invitable *bool `json:"invitable,omitempty"` AvailableTags *[]ForumTag `json:"available_tags,omitempty"` DefaultReactionEmoji *ForumDefaultReaction `json:"default_reaction_emoji,omitempty"` DefaultSortOrder *ForumSortOrderType `json:"default_sort_order,omitempty"` DefaultForumLayout *ForumLayout `json:"default_forum_layout,omitempty"` AppliedTags *[]string `json:"applied_tags,omitempty"` }
type ChannelFlags ¶
type ChannelFlags int
const ( ChannelFlagPinned ChannelFlags = 1 << 1 ChannelFlagRequireTag ChannelFlags = 1 << 4 )
type ChannelFollow ¶
type ChannelPinsUpdate ¶
type ChannelType ¶
type ChannelType int
const ( ChannelTypeGuildText ChannelType = 0 ChannelTypeDM ChannelType = 1 ChannelTypeGuildVoice ChannelType = 2 ChannelTypeGroupDM ChannelType = 3 ChannelTypeGuildCategory ChannelType = 4 ChannelTypeGuildNews ChannelType = 5 ChannelTypeGuildStore ChannelType = 6 ChannelTypeGuildNewsThread ChannelType = 10 ChannelTypeGuildPublicThread ChannelType = 11 ChannelTypeGuildPrivateThread ChannelType = 12 ChannelTypeGuildStageVoice ChannelType = 13 ChannelTypeGuildDirectory ChannelType = 14 ChannelTypeGuildForum ChannelType = 15 ChannelTypeGuildMedia ChannelType = 16 )
type ChannelUpdate ¶
type ClientStatus ¶
type ComponentEmoji ¶
type ComponentType ¶
type ComponentType uint
const ( ActionsRowComponent ComponentType = 1 ButtonComponent ComponentType = 2 SelectMenuComponent ComponentType = 3 TextInputComponent ComponentType = 4 UserSelectMenuComponent ComponentType = 5 RoleSelectMenuComponent ComponentType = 6 MentionableSelectMenuComponent ComponentType = 7 ChannelSelectMenuComponent ComponentType = 8 )
type Disconnect ¶
type Disconnect struct{}
type Emoji ¶
type Emoji struct { ID string `json:"id"` Name string `json:"name"` Roles []string `json:"roles"` User *User `json:"user"` RequireColons bool `json:"require_colons"` Managed bool `json:"managed"` Animated bool `json:"animated"` Available bool `json:"available"` }
func (*Emoji) MessageFormat ¶
type EmojiParams ¶
type Entitlement ¶
type Entitlement struct { ID string `json:"id"` SKUID string `json:"sku_id"` ApplicationID string `json:"application_id"` UserID string `json:"user_id,omitempty"` Type EntitlementType `json:"type"` Deleted bool `json:"deleted"` StartsAt *time.Time `json:"starts_at,omitempty"` EndsAt *time.Time `json:"ends_at,omitempty"` GuildID string `json:"guild_id,omitempty"` Consumed *bool `json:"consumed,omitempty"` SubscriptionID string `json:"subscription_id,omitempty"` }
type EntitlementCreate ¶
type EntitlementCreate struct {
*Entitlement
}
type EntitlementDelete ¶
type EntitlementDelete struct {
*Entitlement
}
type EntitlementOwnerType ¶
type EntitlementOwnerType int
const ( EntitlementOwnerTypeGuildSubscription EntitlementOwnerType = 1 EntitlementOwnerTypeUserSubscription EntitlementOwnerType = 2 )
type EntitlementTest ¶
type EntitlementTest struct { SKUID string `json:"sku_id"` OwnerID string `json:"owner_id"` OwnerType EntitlementOwnerType `json:"owner_type"` }
type EntitlementType ¶
type EntitlementType int
type EntitlementUpdate ¶
type EntitlementUpdate struct {
*Entitlement
}
type Event ¶
type Event struct { Operation int `json:"op"` Sequence int64 `json:"s"` Type string `json:"t"` RawData json.RawMessage `json:"d"` Struct interface{} `json:"-"` }
type EventHandler ¶
type EventInterfaceProvider ¶
type EventInterfaceProvider interface { Type() string New() interface{} }
type ExpireBehavior ¶
type ExpireBehavior int
const ( ExpireBehaviorRemoveRole ExpireBehavior = 0 ExpireBehaviorKick ExpireBehavior = 1 )
type ExplicitContentFilterLevel ¶
type ExplicitContentFilterLevel int
const ( ExplicitContentFilterDisabled ExplicitContentFilterLevel = 0 ExplicitContentFilterMembersWithoutRoles ExplicitContentFilterLevel = 1 ExplicitContentFilterAllMembers ExplicitContentFilterLevel = 2 )
type ForumDefaultReaction ¶
type ForumLayout ¶
type ForumLayout int
const ( ForumLayoutNotSet ForumLayout = 0 ForumLayoutListView ForumLayout = 1 ForumLayoutGalleryView ForumLayout = 2 )
type ForumSortOrderType ¶
type ForumSortOrderType int
const ( ForumSortOrderLatestActivity ForumSortOrderType = 0 ForumSortOrderCreationDate ForumSortOrderType = 1 )
type GatewayBotResponse ¶
type GatewayBotResponse struct { URL string `json:"url"` Shards int `json:"shards"` SessionStartLimit SessionInformation `json:"session_start_limit"` }
type GatewayStatusUpdate ¶
type Guild ¶
type Guild struct { ID string `json:"id"` Name string `json:"name"` Icon string `json:"icon"` Region string `json:"region"` AfkChannelID string `json:"afk_channel_id"` OwnerID string `json:"owner_id"` Owner bool `json:"owner"` JoinedAt time.Time `json:"joined_at"` DiscoverySplash string `json:"discovery_splash"` Splash string `json:"splash"` AfkTimeout int `json:"afk_timeout"` MemberCount int `json:"member_count"` VerificationLevel VerificationLevel `json:"verification_level"` Large bool `json:"large"` DefaultMessageNotifications MessageNotifications `json:"default_message_notifications"` Roles []*Role `json:"roles"` Emojis []*Emoji `json:"emojis"` Stickers []*Sticker `json:"stickers"` Members []*Member `json:"members"` Presences []*Presence `json:"presences"` MaxPresences int `json:"max_presences"` MaxMembers int `json:"max_members"` Channels []*Channel `json:"channels"` Threads []*Channel `json:"threads"` VoiceStates []*VoiceState `json:"voice_states"` ExplicitContentFilter ExplicitContentFilterLevel `json:"explicit_content_filter"` NSFWLevel GuildNSFWLevel `json:"nsfw_level"` Features []GuildFeature `json:"features"` MfaLevel MfaLevel `json:"mfa_level"` ApplicationID string `json:"application_id"` WidgetEnabled bool `json:"widget_enabled"` WidgetChannelID string `json:"widget_channel_id"` SystemChannelID string `json:"system_channel_id"` SystemChannelFlags SystemChannelFlag `json:"system_channel_flags"` RulesChannelID string `json:"rules_channel_id"` VanityURLCode string `json:"vanity_url_code"` Description string `json:"description"` Banner string `json:"banner"` PremiumTier PremiumTier `json:"premium_tier"` PremiumSubscriptionCount int `json:"premium_subscription_count"` PreferredLocale string `json:"preferred_locale"` PublicUpdatesChannelID string `json:"public_updates_channel_id"` MaxVideoChannelUsers int `json:"max_video_channel_users"` ApproximateMemberCount int `json:"approximate_member_count"` ApproximatePresenceCount int `json:"approximate_presence_count"` Permissions int64 `json:"permissions,string"` StageInstances []*StageInstance `json:"stage_instances"` }
type GuildApplicationCommandPermissions ¶
type GuildApplicationCommandPermissions struct { ID string `json:"id"` ApplicationID string `json:"application_id"` GuildID string `json:"guild_id"` Permissions []*ApplicationCommandPermissions `json:"permissions"` }
type GuildAuditLog ¶
type GuildAuditLog struct { Webhooks []*Webhook `json:"webhooks,omitempty"` Users []*User `json:"users,omitempty"` AuditLogEntries []*AuditLogEntry `json:"audit_log_entries"` Integrations []*Integration `json:"integrations"` }
type GuildAuditLogEntryCreate ¶
type GuildAuditLogEntryCreate struct { *AuditLogEntry GuildID string `json:"guild_id"` }
type GuildBanAdd ¶
type GuildBanRemove ¶
type GuildChannelCreateData ¶
type GuildChannelCreateData struct { Name string `json:"name"` Type ChannelType `json:"type"` Topic string `json:"topic,omitempty"` Bitrate int `json:"bitrate,omitempty"` UserLimit int `json:"user_limit,omitempty"` RateLimitPerUser int `json:"rate_limit_per_user,omitempty"` Position int `json:"position,omitempty"` PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites,omitempty"` ParentID string `json:"parent_id,omitempty"` NSFW bool `json:"nsfw,omitempty"` }
type GuildCreate ¶
type GuildCreate struct {
*Guild
}
type GuildDelete ¶
type GuildEmbed ¶
type GuildEmojisUpdate ¶
type GuildFeature ¶
type GuildFeature string
const ( GuildFeatureAnimatedBanner GuildFeature = "ANIMATED_BANNER" GuildFeatureAnimatedIcon GuildFeature = "ANIMATED_ICON" GuildFeatureAutoModeration GuildFeature = "AUTO_MODERATION" GuildFeatureBanner GuildFeature = "BANNER" 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" GuildFeatureTicketedEventsEnabled GuildFeature = "TICKETED_EVENTS_ENABLED" GuildFeatureVanityURL GuildFeature = "VANITY_URL" GuildFeatureVerified GuildFeature = "VERIFIED" GuildFeatureVipRegions GuildFeature = "VIP_REGIONS" GuildFeatureWelcomeScreenEnabled GuildFeature = "WELCOME_SCREEN_ENABLED" )
type GuildIntegrationsUpdate ¶
type GuildIntegrationsUpdate struct {
GuildID string `json:"guild_id"`
}
type GuildMemberAdd ¶
type GuildMemberAdd struct {
*Member
}
type GuildMemberAddParams ¶
type GuildMemberParams ¶
type GuildMemberParams struct { Nick string `json:"nick,omitempty"` Roles *[]string `json:"roles,omitempty"` ChannelID *string `json:"channel_id,omitempty"` Mute *bool `json:"mute,omitempty"` Deaf *bool `json:"deaf,omitempty"` CommunicationDisabledUntil *time.Time `json:"communication_disabled_until,omitempty"` }
func (GuildMemberParams) MarshalJSON ¶
func (p GuildMemberParams) MarshalJSON() (res []byte, err error)
type GuildMemberRemove ¶
type GuildMemberRemove struct {
*Member
}
type GuildMemberUpdate ¶
type GuildMembersChunk ¶
type GuildMembersChunk struct { GuildID string `json:"guild_id"` Members []*Member `json:"members"` ChunkIndex int `json:"chunk_index"` ChunkCount int `json:"chunk_count"` NotFound []string `json:"not_found,omitempty"` Presences []*Presence `json:"presences,omitempty"` Nonce string `json:"nonce,omitempty"` }
type GuildNSFWLevel ¶
type GuildNSFWLevel int
const ( GuildNSFWLevelDefault GuildNSFWLevel = 0 GuildNSFWLevelExplicit GuildNSFWLevel = 1 GuildNSFWLevelSafe GuildNSFWLevel = 2 GuildNSFWLevelAgeRestricted GuildNSFWLevel = 3 )
type GuildOnboarding ¶
type GuildOnboarding struct { GuildID string `json:"guild_id,omitempty"` Prompts *[]GuildOnboardingPrompt `json:"prompts,omitempty"` DefaultChannelIDs []string `json:"default_channel_ids,omitempty"` Enabled *bool `json:"enabled,omitempty"` Mode *GuildOnboardingMode `json:"mode,omitempty"` }
type GuildOnboardingMode ¶
type GuildOnboardingMode int
const ( GuildOnboardingModeDefault GuildOnboardingMode = 0 GuildOnboardingModeAdvanced GuildOnboardingMode = 1 )
type GuildOnboardingPrompt ¶
type GuildOnboardingPrompt struct { ID string `json:"id,omitempty"` Type GuildOnboardingPromptType `json:"type"` Options []GuildOnboardingPromptOption `json:"options"` Title string `json:"title"` SingleSelect bool `json:"single_select"` Required bool `json:"required"` InOnboarding bool `json:"in_onboarding"` }
type GuildOnboardingPromptOption ¶
type GuildOnboardingPromptOption struct { ID string `json:"id,omitempty"` ChannelIDs []string `json:"channel_ids"` RoleIDs []string `json:"role_ids"` Emoji *Emoji `json:"emoji,omitempty"` Title string `json:"title"` Description string `json:"description"` EmojiID string `json:"emoji_id,omitempty"` EmojiName string `json:"emoji_name,omitempty"` EmojiAnimated *bool `json:"emoji_animated,omitempty"` }
type GuildOnboardingPromptType ¶
type GuildOnboardingPromptType int
const ( GuildOnboardingPromptTypeMultipleChoice GuildOnboardingPromptType = 0 GuildOnboardingPromptTypeDropdown GuildOnboardingPromptType = 1 )
type GuildParams ¶
type GuildParams struct { Name string `json:"name,omitempty"` Region string `json:"region,omitempty"` VerificationLevel *VerificationLevel `json:"verification_level,omitempty"` DefaultMessageNotifications int `json:"default_message_notifications,omitempty"` ExplicitContentFilter int `json:"explicit_content_filter,omitempty"` AfkChannelID string `json:"afk_channel_id,omitempty"` AfkTimeout int `json:"afk_timeout,omitempty"` Icon string `json:"icon,omitempty"` OwnerID string `json:"owner_id,omitempty"` Splash string `json:"splash,omitempty"` DiscoverySplash string `json:"discovery_splash,omitempty"` Banner string `json:"banner,omitempty"` SystemChannelID string `json:"system_channel_id,omitempty"` SystemChannelFlags SystemChannelFlag `json:"system_channel_flags,omitempty"` RulesChannelID string `json:"rules_channel_id,omitempty"` PublicUpdatesChannelID string `json:"public_updates_channel_id,omitempty"` PreferredLocale Locale `json:"preferred_locale,omitempty"` Features []GuildFeature `json:"features,omitempty"` Description string `json:"description,omitempty"` PremiumProgressBarEnabled *bool `json:"premium_progress_bar_enabled,omitempty"` }
type GuildPreview ¶
type GuildPreview struct { ID string `json:"id"` Name string `json:"name"` Icon string `json:"icon"` Splash string `json:"splash"` DiscoverySplash string `json:"discovery_splash"` Emojis []*Emoji `json:"emojis"` Features []string `json:"features"` ApproximateMemberCount int `json:"approximate_member_count"` ApproximatePresenceCount int `json:"approximate_presence_count"` Description string `json:"description"` }
func (*GuildPreview) IconURL ¶
func (g *GuildPreview) IconURL(size string) string
type GuildRoleCreate ¶
type GuildRoleCreate struct {
*GuildRole
}
type GuildRoleDelete ¶
type GuildRoleUpdate ¶
type GuildRoleUpdate struct {
*GuildRole
}
type GuildScheduledEvent ¶
type GuildScheduledEvent struct { ID string `json:"id"` GuildID string `json:"guild_id"` ChannelID string `json:"channel_id"` CreatorID string `json:"creator_id"` Name string `json:"name"` Description string `json:"description"` ScheduledStartTime time.Time `json:"scheduled_start_time"` ScheduledEndTime *time.Time `json:"scheduled_end_time"` PrivacyLevel GuildScheduledEventPrivacyLevel `json:"privacy_level"` Status GuildScheduledEventStatus `json:"status"` EntityType GuildScheduledEventEntityType `json:"entity_type"` EntityID string `json:"entity_id"` EntityMetadata GuildScheduledEventEntityMetadata `json:"entity_metadata"` Creator *User `json:"creator"` UserCount int `json:"user_count"` Image string `json:"image"` RecurrenceRule RecurrenceRule `json:"recurrence_rule,omitempty"` }
type GuildScheduledEventCreate ¶
type GuildScheduledEventCreate struct {
*GuildScheduledEvent
}
type GuildScheduledEventDelete ¶
type GuildScheduledEventDelete struct {
*GuildScheduledEvent
}
type GuildScheduledEventEntityMetadata ¶
type GuildScheduledEventEntityMetadata struct {
Location string `json:"location"`
}
type GuildScheduledEventEntityType ¶
type GuildScheduledEventEntityType int
const ( GuildScheduledEventEntityTypeStageInstance GuildScheduledEventEntityType = 1 GuildScheduledEventEntityTypeVoice GuildScheduledEventEntityType = 2 GuildScheduledEventEntityTypeExternal GuildScheduledEventEntityType = 3 )
type GuildScheduledEventParams ¶
type GuildScheduledEventParams struct { ChannelID string `json:"channel_id,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` ScheduledStartTime *time.Time `json:"scheduled_start_time,omitempty"` ScheduledEndTime *time.Time `json:"scheduled_end_time,omitempty"` PrivacyLevel GuildScheduledEventPrivacyLevel `json:"privacy_level,omitempty"` Status GuildScheduledEventStatus `json:"status,omitempty"` EntityType GuildScheduledEventEntityType `json:"entity_type,omitempty"` EntityMetadata *GuildScheduledEventEntityMetadata `json:"entity_metadata,omitempty"` Image string `json:"image,omitempty"` }
func (GuildScheduledEventParams) MarshalJSON ¶
func (p GuildScheduledEventParams) MarshalJSON() ([]byte, error)
type GuildScheduledEventPrivacyLevel ¶
type GuildScheduledEventPrivacyLevel int
const (
GuildScheduledEventPrivacyLevelGuildOnly GuildScheduledEventPrivacyLevel = 2
)
type GuildScheduledEventStatus ¶
type GuildScheduledEventStatus int
const ( GuildScheduledEventStatusScheduled GuildScheduledEventStatus = 1 GuildScheduledEventStatusActive GuildScheduledEventStatus = 2 GuildScheduledEventStatusCompleted GuildScheduledEventStatus = 3 GuildScheduledEventStatusCanceled GuildScheduledEventStatus = 4 )
type GuildScheduledEventUpdate ¶
type GuildScheduledEventUpdate struct {
*GuildScheduledEvent
}
type GuildScheduledEventUser ¶
type GuildTemplate ¶
type GuildTemplate struct { Code string `json:"code"` Name string `json:"name,omitempty"` Description *string `json:"description,omitempty"` UsageCount int `json:"usage_count"` CreatorID string `json:"creator_id"` Creator *User `json:"creator"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` SourceGuildID string `json:"source_guild_id"` SerializedSourceGuild *Guild `json:"serialized_source_guild"` IsDirty bool `json:"is_dirty"` }
type GuildTemplateParams ¶
type GuildUpdate ¶
type GuildUpdate struct {
*Guild
}
type Identify ¶
type Identify struct { Token string `json:"token"` Properties IdentifyProperties `json:"properties"` Compress bool `json:"compress"` LargeThreshold int `json:"large_threshold"` Shard *[2]int `json:"shard,omitempty"` Presence GatewayStatusUpdate `json:"presence,omitempty"` Intents Intent `json:"intents"` }
type IdentifyProperties ¶
type Integration ¶
type Integration struct { ID string `json:"id"` Name string `json:"name"` Type string `json:"type"` Enabled bool `json:"enabled"` Syncing bool `json:"syncing"` RoleID string `json:"role_id"` EnableEmoticons bool `json:"enable_emoticons"` ExpireBehavior ExpireBehavior `json:"expire_behavior"` ExpireGracePeriod int `json:"expire_grace_period"` User *User `json:"user"` Account IntegrationAccount `json:"account"` SyncedAt time.Time `json:"synced_at"` }
type IntegrationAccount ¶
type IntegrationCreate ¶
type IntegrationCreate struct { *Integration GuildID string `json:"guild_id"` }
type IntegrationDelete ¶
type IntegrationUpdate ¶
type IntegrationUpdate struct { *Integration GuildID string `json:"guild_id"` }
type Intent ¶
type Intent int
const ( IntentGuilds Intent = 1 << 0 IntentGuildMembers Intent = 1 << 1 IntentGuildModeration Intent = 1 << 2 IntentGuildEmojis Intent = 1 << 3 IntentGuildIntegrations Intent = 1 << 4 IntentGuildWebhooks Intent = 1 << 5 IntentGuildInvites Intent = 1 << 6 IntentGuildVoiceStates Intent = 1 << 7 IntentGuildPresences Intent = 1 << 8 IntentGuildMessages Intent = 1 << 9 IntentGuildMessageReactions Intent = 1 << 10 IntentGuildMessageTyping Intent = 1 << 11 IntentDirectMessages Intent = 1 << 12 IntentDirectMessageReactions Intent = 1 << 13 IntentDirectMessageTyping Intent = 1 << 14 IntentMessageContent Intent = 1 << 15 IntentGuildScheduledEvents Intent = 1 << 16 IntentAutoModerationConfiguration Intent = 1 << 20 IntentAutoModerationExecution Intent = 1 << 21 IntentGuildMessagePolls Intent = 1 << 24 IntentDirectMessagePolls Intent = 1 << 25 IntentGuildBans Intent = IntentGuildModeration IntentsGuilds Intent = 1 << 0 IntentsGuildMembers Intent = 1 << 1 IntentsGuildBans Intent = 1 << 2 IntentsGuildEmojis Intent = 1 << 3 IntentsGuildIntegrations Intent = 1 << 4 IntentsGuildWebhooks Intent = 1 << 5 IntentsGuildInvites Intent = 1 << 6 IntentsGuildVoiceStates Intent = 1 << 7 IntentsGuildPresences Intent = 1 << 8 IntentsGuildMessages Intent = 1 << 9 IntentsGuildMessageReactions Intent = 1 << 10 IntentsGuildMessageTyping Intent = 1 << 11 IntentsDirectMessages Intent = 1 << 12 IntentsDirectMessageReactions Intent = 1 << 13 IntentsDirectMessageTyping Intent = 1 << 14 IntentsMessageContent Intent = 1 << 15 IntentsGuildScheduledEvents Intent = 1 << 16 IntentsAllWithoutPrivileged = IntentGuilds | IntentGuildBans | IntentGuildEmojis | IntentGuildIntegrations | IntentGuildWebhooks | IntentGuildInvites | IntentGuildVoiceStates | IntentGuildMessages | IntentGuildMessageReactions | IntentGuildMessageTyping | IntentDirectMessages | IntentDirectMessageReactions | IntentDirectMessageTyping | IntentGuildScheduledEvents | IntentAutoModerationConfiguration | IntentAutoModerationExecution IntentsAll = IntentsAllWithoutPrivileged | IntentGuildMembers | IntentGuildPresences | IntentMessageContent IntentsNone Intent = 0 )
func MakeIntent ¶
type Interaction ¶
type Interaction struct { ID string `json:"id"` AppID string `json:"application_id"` Type InteractionType `json:"type"` Data InteractionData `json:"data"` GuildID string `json:"guild_id"` ChannelID string `json:"channel_id"` Message *Message `json:"message"` AppPermissions int64 `json:"app_permissions,string"` Member *Member `json:"member"` User *User `json:"user"` Locale Locale `json:"locale"` GuildLocale *Locale `json:"guild_locale"` Context InteractionContextType `json:"context"` AuthorizingIntegrationOwners map[ApplicationIntegrationType]string `json:"authorizing_integration_owners"` Token string `json:"token"` Version int `json:"version"` Entitlements []*Entitlement `json:"entitlements"` }
func (Interaction) ApplicationCommandData ¶
func (i Interaction) ApplicationCommandData() (data ApplicationCommandInteractionData)
func (Interaction) MessageComponentData ¶
func (i Interaction) MessageComponentData() (data MessageComponentInteractionData)
func (Interaction) ModalSubmitData ¶
func (i Interaction) ModalSubmitData() (data ModalSubmitInteractionData)
func (*Interaction) UnmarshalJSON ¶
func (i *Interaction) UnmarshalJSON(raw []byte) error
type InteractionContextType ¶
type InteractionContextType uint
const ( InteractionContextGuild InteractionContextType = 0 InteractionContextBotDM InteractionContextType = 1 InteractionContextPrivateChannel InteractionContextType = 2 )
type InteractionCreate ¶
type InteractionCreate struct {
*Interaction
}
func (*InteractionCreate) UnmarshalJSON ¶
func (i *InteractionCreate) UnmarshalJSON(b []byte) error
type InteractionData ¶
type InteractionData interface {
Type() InteractionType
}
type InteractionResponse ¶
type InteractionResponse struct { Type InteractionResponseType `json:"type,omitempty"` Data *InteractionResponseData `json:"data,omitempty"` }
type InteractionResponseData ¶
type InteractionResponseData struct { TTS bool `json:"tts"` Content string `json:"content"` Components []MessageComponent `json:"components"` Embeds []*MessageEmbed `json:"embeds"` AllowedMentions *MessageAllowedMentions `json:"allowed_mentions,omitempty"` Files []*File `json:"-"` Attachments *[]*MessageAttachment `json:"attachments,omitempty"` Poll *Poll `json:"poll,omitempty"` Flags MessageFlags `json:"flags,omitempty"` Choices []*ApplicationCommandOptionChoice `json:"choices,omitempty"` CustomID string `json:"custom_id,omitempty"` Title string `json:"title,omitempty"` }
type InteractionResponseType ¶
type InteractionResponseType uint8
const ( InteractionResponsePong InteractionResponseType = 1 InteractionResponseChannelMessageWithSource InteractionResponseType = 4 InteractionResponseDeferredChannelMessageWithSource InteractionResponseType = 5 InteractionResponseDeferredMessageUpdate InteractionResponseType = 6 InteractionResponseUpdateMessage InteractionResponseType = 7 InteractionApplicationCommandAutocompleteResult InteractionResponseType = 8 InteractionResponseModal InteractionResponseType = 9 )
type InteractionType ¶
type InteractionType uint8
const ( InteractionPing InteractionType = 1 InteractionApplicationCommand InteractionType = 2 InteractionMessageComponent InteractionType = 3 InteractionApplicationCommandAutocomplete InteractionType = 4 InteractionModalSubmit InteractionType = 5 )
func (InteractionType) String ¶
func (t InteractionType) String() string
type Invite ¶
type Invite struct { Guild *Guild `json:"guild"` Channel *Channel `json:"channel"` Inviter *User `json:"inviter"` Code string `json:"code"` CreatedAt time.Time `json:"created_at"` MaxAge int `json:"max_age"` Uses int `json:"uses"` MaxUses int `json:"max_uses"` Revoked bool `json:"revoked"` Temporary bool `json:"temporary"` Unique bool `json:"unique"` TargetUser *User `json:"target_user"` TargetType InviteTargetType `json:"target_type"` TargetApplication *Application `json:"target_application"` ApproximatePresenceCount int `json:"approximate_presence_count"` ApproximateMemberCount int `json:"approximate_member_count"` ExpiresAt *time.Time `json:"expires_at"` }
type InviteCreate ¶
type InviteDelete ¶
type InviteTargetType ¶
type InviteTargetType uint8
const ( InviteTargetStream InviteTargetType = 1 InviteTargetEmbeddedApplication InviteTargetType = 2 )
type Locale ¶
type Locale string
const ( EnglishUS Locale = "en-US" EnglishGB Locale = "en-GB" Bulgarian Locale = "bg" ChineseCN Locale = "zh-CN" ChineseTW Locale = "zh-TW" Croatian Locale = "hr" Czech Locale = "cs" Danish Locale = "da" Dutch Locale = "nl" Finnish Locale = "fi" French Locale = "fr" German Locale = "de" Greek Locale = "el" Hindi Locale = "hi" Hungarian Locale = "hu" Italian Locale = "it" Japanese Locale = "ja" Korean Locale = "ko" Lithuanian Locale = "lt" Norwegian Locale = "no" Polish Locale = "pl" PortugueseBR Locale = "pt-BR" Romanian Locale = "ro" Russian Locale = "ru" SpanishES Locale = "es-ES" SpanishLATAM Locale = "es-419" Swedish Locale = "sv-SE" Thai Locale = "th" Turkish Locale = "tr" Ukrainian Locale = "uk" Vietnamese Locale = "vi" Unknown Locale = "" )
type Member ¶
type Member struct { GuildID string `json:"guild_id"` JoinedAt time.Time `json:"joined_at"` Nick string `json:"nick"` Deaf bool `json:"deaf"` Mute bool `json:"mute"` Avatar string `json:"avatar"` Banner string `json:"banner"` User *User `json:"user"` Roles []string `json:"roles"` PremiumSince *time.Time `json:"premium_since"` Flags MemberFlags `json:"flags"` Pending bool `json:"pending"` Permissions int64 `json:"permissions,string"` CommunicationDisabledUntil *time.Time `json:"communication_disabled_until"` }
func (*Member) DisplayName ¶
type MemberFlags ¶
type MemberFlags int
const ( MemberFlagDidRejoin MemberFlags = 1 << 0 MemberFlagCompletedOnboarding MemberFlags = 1 << 1 MemberFlagBypassesVerification MemberFlags = 1 << 2 MemberFlagStartedOnboarding MemberFlags = 1 << 3 )
type MembershipState ¶
type MembershipState int
const ( MembershipStateInvited MembershipState = 1 MembershipStateAccepted MembershipState = 2 )
type Message ¶
type Message struct { ID string `json:"id"` ChannelID string `json:"channel_id"` GuildID string `json:"guild_id,omitempty"` Content string `json:"content"` Timestamp time.Time `json:"timestamp"` EditedTimestamp *time.Time `json:"edited_timestamp"` MentionRoles []string `json:"mention_roles"` TTS bool `json:"tts"` MentionEveryone bool `json:"mention_everyone"` Author *User `json:"author"` Attachments []*MessageAttachment `json:"attachments"` Components []MessageComponent `json:"-"` Embeds []*MessageEmbed `json:"embeds"` Mentions []*User `json:"mentions"` Reactions []*MessageReactions `json:"reactions"` Pinned bool `json:"pinned"` Type MessageType `json:"type"` WebhookID string `json:"webhook_id"` Member *Member `json:"member"` MentionChannels []*Channel `json:"mention_channels"` Activity *MessageActivity `json:"activity"` Application *MessageApplication `json:"application"` MessageReference *MessageReference `json:"message_reference"` ReferencedMessage *Message `json:"referenced_message"` MessageSnapshots []MessageSnapshot `json:"message_snapshots"` Interaction *MessageInteraction `json:"interaction"` InteractionMetadata *MessageInteractionMetadata `json:"interaction_metadata"` Flags MessageFlags `json:"flags"` Thread *Channel `json:"thread,omitempty"` StickerItems []*StickerItem `json:"sticker_items"` Poll *Poll `json:"poll"` }
func (*Message) ContentWithMentionsReplaced ¶
func (*Message) ContentWithMoreMentionsReplaced ¶
func (*Message) Forward ¶
func (m *Message) Forward() *MessageReference
func (*Message) GetCustomEmojis ¶
func (*Message) Reference ¶
func (m *Message) Reference() *MessageReference
func (*Message) SoftReference ¶
func (m *Message) SoftReference() *MessageReference
func (*Message) UnmarshalJSON ¶
type MessageActivity ¶
type MessageActivity struct { Type MessageActivityType `json:"type"` PartyID string `json:"party_id"` }
type MessageActivityType ¶
type MessageActivityType int
const ( MessageActivityTypeJoin MessageActivityType = 1 MessageActivityTypeSpectate MessageActivityType = 2 MessageActivityTypeListen MessageActivityType = 3 MessageActivityTypeJoinRequest MessageActivityType = 5 )
type MessageAllowedMentions ¶
type MessageAllowedMentions struct { Parse []AllowedMentionType `json:"parse"` Roles []string `json:"roles,omitempty"` Users []string `json:"users,omitempty"` RepliedUser bool `json:"replied_user"` }
type MessageApplication ¶
type MessageAttachment ¶
type MessageComponent ¶
type MessageComponent interface { json.Marshaler Type() ComponentType }
func MessageComponentFromJSON ¶
func MessageComponentFromJSON(b []byte) (MessageComponent, error)
type MessageComponentInteractionData ¶
type MessageComponentInteractionData struct { CustomID string `json:"custom_id"` ComponentType ComponentType `json:"component_type"` Resolved MessageComponentInteractionDataResolved `json:"resolved"` Values []string `json:"values"` }
func (MessageComponentInteractionData) Type ¶
func (MessageComponentInteractionData) Type() InteractionType
type MessageCreate ¶
type MessageCreate struct {
*Message
}
func (*MessageCreate) UnmarshalJSON ¶
func (m *MessageCreate) UnmarshalJSON(b []byte) error
type MessageDelete ¶
func (*MessageDelete) UnmarshalJSON ¶
func (m *MessageDelete) UnmarshalJSON(b []byte) error
type MessageDeleteBulk ¶
type MessageEdit ¶
type MessageEdit struct { Content *string `json:"content,omitempty"` Components *[]MessageComponent `json:"components,omitempty"` Embeds *[]*MessageEmbed `json:"embeds,omitempty"` AllowedMentions *MessageAllowedMentions `json:"allowed_mentions,omitempty"` Flags MessageFlags `json:"flags,omitempty"` Files []*File `json:"-"` Attachments *[]*MessageAttachment `json:"attachments,omitempty"` ID string Channel string Embed *MessageEmbed `json:"-"` }
func NewMessageEdit ¶
func NewMessageEdit(channelID string, messageID string) *MessageEdit
func (*MessageEdit) SetContent ¶
func (m *MessageEdit) SetContent(str string) *MessageEdit
func (*MessageEdit) SetEmbed ¶
func (m *MessageEdit) SetEmbed(embed *MessageEmbed) *MessageEdit
func (*MessageEdit) SetEmbeds ¶
func (m *MessageEdit) SetEmbeds(embeds []*MessageEmbed) *MessageEdit
type MessageEmbed ¶
type MessageEmbed struct { URL string `json:"url,omitempty"` Type EmbedType `json:"type,omitempty"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Timestamp string `json:"timestamp,omitempty"` Color int `json:"color,omitempty"` Image *MessageEmbedImage `json:"image,omitempty"` Thumbnail *MessageEmbedThumbnail `json:"thumbnail,omitempty"` Video *MessageEmbedVideo `json:"video,omitempty"` Provider *MessageEmbedProvider `json:"provider,omitempty"` Author *MessageEmbedAuthor `json:"author,omitempty"` Fields []*MessageEmbedField `json:"fields,omitempty"` }
type MessageEmbedAuthor ¶
type MessageEmbedField ¶
type MessageEmbedFooter ¶
type MessageEmbedFooter struct {}
type MessageEmbedImage ¶
type MessageEmbedProvider ¶
type MessageEmbedThumbnail ¶
type MessageEmbedVideo ¶
type MessageFlags ¶
type MessageFlags int
const ( MessageFlagsCrossPosted MessageFlags = 1 << 0 MessageFlagsIsCrossPosted MessageFlags = 1 << 1 MessageFlagsSuppressEmbeds MessageFlags = 1 << 2 MessageFlagsSupressEmbeds MessageFlags = 1 << 2 MessageFlagsSourceMessageDeleted MessageFlags = 1 << 3 MessageFlagsUrgent MessageFlags = 1 << 4 MessageFlagsHasThread MessageFlags = 1 << 5 MessageFlagsEphemeral MessageFlags = 1 << 6 MessageFlagsLoading MessageFlags = 1 << 7 MessageFlagsFailedToMentionSomeRolesInThread MessageFlags = 1 << 8 MessageFlagsSuppressNotifications MessageFlags = 1 << 12 MessageFlagsIsVoiceMessage MessageFlags = 1 << 13 )
type MessageInteraction ¶
type MessageInteraction struct { ID string `json:"id"` Type InteractionType `json:"type"` Name string `json:"name"` User *User `json:"user"` Member *Member `json:"member"` }
type MessageInteractionMetadata ¶
type MessageInteractionMetadata struct { ID string `json:"id"` Type InteractionType `json:"type"` User *User `json:"user"` AuthorizingIntegrationOwners map[ApplicationIntegrationType]string `json:"authorizing_integration_owners"` OriginalResponseMessageID string `json:"original_response_message_id,omitempty"` InteractedMessageID string `json:"interacted_message_id,omitempty"` TriggeringInteractionMetadata *MessageInteractionMetadata `json:"triggering_interaction_metadata,omitempty"` }
type MessageNotifications ¶
type MessageNotifications int
const ( MessageNotificationsAllMessages MessageNotifications = 0 MessageNotificationsOnlyMentions MessageNotifications = 1 )
type MessagePollVoteAdd ¶
type MessagePollVoteRemove ¶
type MessageReaction ¶
type MessageReactionAdd ¶
type MessageReactionAdd struct { *MessageReaction Member *Member `json:"member,omitempty"` }
type MessageReactionRemove ¶
type MessageReactionRemove struct {
*MessageReaction
}
type MessageReactionRemoveAll ¶
type MessageReactionRemoveAll struct {
*MessageReaction
}
type MessageReactions ¶
type MessageReference ¶
type MessageReference struct { Type MessageReferenceType `json:"type,omitempty"` MessageID string `json:"message_id"` ChannelID string `json:"channel_id,omitempty"` GuildID string `json:"guild_id,omitempty"` FailIfNotExists *bool `json:"fail_if_not_exists,omitempty"` }
type MessageReferenceType ¶
type MessageReferenceType int
const ( MessageReferenceTypeDefault MessageReferenceType = 0 MessageReferenceTypeForward MessageReferenceType = 1 )
type MessageSend ¶
type MessageSend struct { Content string `json:"content,omitempty"` Embeds []*MessageEmbed `json:"embeds"` TTS bool `json:"tts"` Components []MessageComponent `json:"components"` Files []*File `json:"-"` AllowedMentions *MessageAllowedMentions `json:"allowed_mentions,omitempty"` Reference *MessageReference `json:"message_reference,omitempty"` StickerIDs []string `json:"sticker_ids"` Flags MessageFlags `json:"flags,omitempty"` Poll *Poll `json:"poll,omitempty"` File *File `json:"-"` Embed *MessageEmbed `json:"-"` }
type MessageSnapshot ¶
type MessageSnapshot struct {
Message *Message `json:"message"`
}
type MessageType ¶
type MessageType int
const ( MessageTypeDefault MessageType = 0 MessageTypeRecipientAdd MessageType = 1 MessageTypeRecipientRemove MessageType = 2 MessageTypeCall MessageType = 3 MessageTypeChannelNameChange MessageType = 4 MessageTypeChannelIconChange MessageType = 5 MessageTypeChannelPinnedMessage MessageType = 6 MessageTypeGuildMemberJoin MessageType = 7 MessageTypeUserPremiumGuildSubscription MessageType = 8 MessageTypeUserPremiumGuildSubscriptionTierOne MessageType = 9 MessageTypeUserPremiumGuildSubscriptionTierTwo MessageType = 10 MessageTypeUserPremiumGuildSubscriptionTierThree MessageType = 11 MessageTypeChannelFollowAdd MessageType = 12 MessageTypeGuildDiscoveryDisqualified MessageType = 14 MessageTypeGuildDiscoveryRequalified MessageType = 15 MessageTypeThreadCreated MessageType = 18 MessageTypeReply MessageType = 19 MessageTypeChatInputCommand MessageType = 20 MessageTypeThreadStarterMessage MessageType = 21 MessageTypeContextMenuCommand MessageType = 23 )
type MessageUpdate ¶
func (*MessageUpdate) UnmarshalJSON ¶
func (m *MessageUpdate) UnmarshalJSON(b []byte) error
type ModalSubmitInteractionData ¶
type ModalSubmitInteractionData struct { CustomID string `json:"custom_id"` Components []MessageComponent `json:"-"` }
func (ModalSubmitInteractionData) Type ¶
func (ModalSubmitInteractionData) Type() InteractionType
func (*ModalSubmitInteractionData) UnmarshalJSON ¶
func (d *ModalSubmitInteractionData) UnmarshalJSON(data []byte) error
type PermissionOverwrite ¶
type PermissionOverwrite struct { ID string `json:"id"` Type PermissionOverwriteType `json:"type"` Deny int64 `json:"deny,string"` Allow int64 `json:"allow,string"` }
type PermissionOverwriteType ¶
type PermissionOverwriteType int
const ( PermissionOverwriteTypeRole PermissionOverwriteType = 0 PermissionOverwriteTypeMember PermissionOverwriteType = 1 )
type Poll ¶
type Poll struct { Question PollMedia `json:"question"` Answers []PollAnswer `json:"answers"` AllowMultiselect bool `json:"allow_multiselect"` LayoutType PollLayoutType `json:"layout_type,omitempty"` Duration int `json:"duration,omitempty"` Results *PollResults `json:"results,omitempty"` Expiry *time.Time `json:"expiry,omitempty"` }
type PollAnswer ¶
type PollAnswerCount ¶
type PollMedia ¶
type PollMedia struct { Text string `json:"text,omitempty"` Emoji *ComponentEmoji `json:"emoji,omitempty"` }
type PollResults ¶
type PollResults struct { Finalized bool `json:"is_finalized"` AnswerCounts []*PollAnswerCount `json:"answer_counts"` }
type PremiumTier ¶
type PremiumTier int
const ( PremiumTierNone PremiumTier = 0 PremiumTier1 PremiumTier = 1 PremiumTier2 PremiumTier = 2 PremiumTier3 PremiumTier = 3 )
type Presence ¶
type Presence struct { User *User `json:"user"` Status Status `json:"status"` Activities []*Activity `json:"activities"` Since *int `json:"since"` ClientStatus ClientStatus `json:"client_status"` }
type PresenceUpdate ¶
type PresencesReplace ¶
type PresencesReplace []*Presence
type RESTError ¶
type RateLimit ¶
type RateLimit struct { *TooManyRequests URL string }
type RateLimitError ¶
type RateLimitError struct {
*RateLimit
}
func (RateLimitError) Error ¶
func (e RateLimitError) Error() string
type RateLimiter ¶
func NewRatelimiter ¶
func NewRatelimiter() *RateLimiter
func (*RateLimiter) GetBucket ¶
func (r *RateLimiter) GetBucket(key string) *Bucket
func (*RateLimiter) GetWaitTime ¶
func (r *RateLimiter) GetWaitTime(b *Bucket, minRemaining int) time.Duration
func (*RateLimiter) LockBucket ¶
func (r *RateLimiter) LockBucket(bucketID string) *Bucket
func (*RateLimiter) LockBucketObject ¶
func (r *RateLimiter) LockBucketObject(b *Bucket) *Bucket
type RecurrenceRule ¶ added in v0.28.2
type RecurrenceRule struct { Start time.Time `json:"start"` End *time.Time `json:"end,omitempty"` Frequency RecurrenceRuleFrequency `json:"frequency"` Interval int `json:"interval"` ByWeekday []RecurrenceRuleWeekday `json:"by_weekday,omitempty"` ByNWeekday []RecurrenceRuleNWeekDay `json:"by_n_weekday,omitempty"` ByMonth []RecurrenceRuleMonth `json:"by_month,omitempty"` ByMonthDay []int `json:"by_month_day,omitempty"` ByYearDay []int `json:"by_year_day,omitempty"` Count int `json:"count,omitempty"` }
type RecurrenceRuleFrequency ¶ added in v0.28.2
type RecurrenceRuleFrequency int
const ( YEARLY RecurrenceRuleFrequency = 0 MONTHLY RecurrenceRuleFrequency = 1 WEEKLY RecurrenceRuleFrequency = 2 DAILY RecurrenceRuleFrequency = 3 )
type RecurrenceRuleMonth ¶ added in v0.28.2
type RecurrenceRuleMonth int
const ( JANUARY RecurrenceRuleMonth = 1 FEBRUARY RecurrenceRuleMonth = 2 MARCH RecurrenceRuleMonth = 3 APRIL RecurrenceRuleMonth = 4 MAY RecurrenceRuleMonth = 5 JUNE RecurrenceRuleMonth = 6 JULY RecurrenceRuleMonth = 7 AUGUST RecurrenceRuleMonth = 8 SEPTEMBER RecurrenceRuleMonth = 9 OCTOBER RecurrenceRuleMonth = 10 NOVEMBER RecurrenceRuleMonth = 11 DECEMBER RecurrenceRuleMonth = 12 )
type RecurrenceRuleNWeekDay ¶ added in v0.28.2
type RecurrenceRuleNWeekDay struct { N int `json:"n"` Day RecurrenceRuleWeekday `json:"day"` }
type RecurrenceRuleWeekday ¶ added in v0.28.2
type RecurrenceRuleWeekday int
const ( MONDAY RecurrenceRuleWeekday = 0 TUESDAY RecurrenceRuleWeekday = 1 WEDNESDAY RecurrenceRuleWeekday = 2 THURSDAY RecurrenceRuleWeekday = 3 FRIDAY RecurrenceRuleWeekday = 4 SATURDAY RecurrenceRuleWeekday = 5 SUNDAY RecurrenceRuleWeekday = 6 )
type RequestConfig ¶
type RequestOption ¶
type RequestOption func(cfg *RequestConfig)
func WithAuditLogReason ¶
func WithAuditLogReason(reason string) RequestOption
func WithClient ¶
func WithClient(client *http.Client) RequestOption
func WithContext ¶
func WithContext(ctx context.Context) RequestOption
func WithHeader ¶
func WithHeader(key, value string) RequestOption
func WithLocale ¶
func WithLocale(locale Locale) RequestOption
func WithRestRetries ¶
func WithRestRetries(max int) RequestOption
func WithRetryOnRatelimit ¶
func WithRetryOnRatelimit(retry bool) RequestOption
type Role ¶
type Role struct { ID string `json:"id"` Name string `json:"name"` Managed bool `json:"managed"` Mentionable bool `json:"mentionable"` Hoist bool `json:"hoist"` Color int `json:"color"` Position int `json:"position"` Permissions int64 `json:"permissions,string"` Icon string `json:"icon"` UnicodeEmoji string `json:"unicode_emoji"` Flags RoleFlags `json:"flags"` }
type RoleParams ¶
type RoleParams struct { Name string `json:"name,omitempty"` Color *int `json:"color,omitempty"` Hoist *bool `json:"hoist,omitempty"` Permissions *int64 `json:"permissions,omitempty,string"` Mentionable *bool `json:"mentionable,omitempty"` UnicodeEmoji *string `json:"unicode_emoji,omitempty"` Icon *string `json:"icon,omitempty"` }
type SelectMenu ¶
type SelectMenu struct { MenuType SelectMenuType `json:"type,omitempty"` CustomID string `json:"custom_id,omitempty"` Placeholder string `json:"placeholder"` MinValues *int `json:"min_values,omitempty"` MaxValues int `json:"max_values,omitempty"` DefaultValues []SelectMenuDefaultValue `json:"default_values,omitempty"` Options []SelectMenuOption `json:"options,omitempty"` Disabled bool `json:"disabled"` ChannelTypes []ChannelType `json:"channel_types,omitempty"` }
func (SelectMenu) MarshalJSON ¶
func (s SelectMenu) MarshalJSON() ([]byte, error)
func (SelectMenu) Type ¶
func (s SelectMenu) Type() ComponentType
type SelectMenuDefaultValue ¶
type SelectMenuDefaultValue struct { ID string `json:"id"` Type SelectMenuDefaultValueType `json:"type"` }
type SelectMenuDefaultValueType ¶
type SelectMenuDefaultValueType string
const ( SelectMenuDefaultValueUser SelectMenuDefaultValueType = "user" SelectMenuDefaultValueRole SelectMenuDefaultValueType = "role" SelectMenuDefaultValueChannel SelectMenuDefaultValueType = "channel" )
type SelectMenuOption ¶
type SelectMenuOption struct { Label string `json:"label,omitempty"` Value string `json:"value"` Description string `json:"description"` Emoji *ComponentEmoji `json:"emoji,omitempty"` Default bool `json:"default"` }
type SelectMenuType ¶
type SelectMenuType ComponentType
type Session ¶
type Session struct { sync.RWMutex Token string MFA bool Debug bool LogLevel int ShouldReconnectOnError bool ShouldReconnectVoiceOnSessionError bool ShouldRetryOnRateLimit bool Identify Identify Compress bool ShardID int ShardCount int StateEnabled bool SyncEvents bool DataReady bool MaxRestRetries int VoiceReady bool UDPReady bool VoiceConnections map[string]*VoiceConnection State *State Client *http.Client Dialer *websocket.Dialer UserAgent string LastHeartbeatAck time.Time LastHeartbeatSent time.Time Ratelimiter *RateLimiter // contains filtered or unexported fields }
func (*Session) AddHandler ¶
func (s *Session) AddHandler(handler interface{}) func()
func (*Session) AddHandlerOnce ¶
func (s *Session) AddHandlerOnce(handler interface{}) func()
func (*Session) Application ¶
func (s *Session) Application(appID string) (st *Application, err error)
func (*Session) ApplicationAssets ¶
func (*Session) ApplicationBotCreate ¶
func (*Session) ApplicationCommand ¶
func (s *Session) ApplicationCommand(appID, guildID, cmdID string, options ...RequestOption) (cmd *ApplicationCommand, err error)
func (*Session) ApplicationCommandBulkOverwrite ¶
func (s *Session) ApplicationCommandBulkOverwrite(appID string, guildID string, commands []*ApplicationCommand, options ...RequestOption) (createdCommands []*ApplicationCommand, err error)
func (*Session) ApplicationCommandCreate ¶
func (s *Session) ApplicationCommandCreate(appID string, guildID string, cmd *ApplicationCommand, options ...RequestOption) (ccmd *ApplicationCommand, err error)
func (*Session) ApplicationCommandDelete ¶
func (s *Session) ApplicationCommandDelete(appID, guildID, cmdID string, options ...RequestOption) error
func (*Session) ApplicationCommandEdit ¶
func (s *Session) ApplicationCommandEdit(appID, guildID, cmdID string, cmd *ApplicationCommand, options ...RequestOption) (updated *ApplicationCommand, err error)
func (*Session) ApplicationCommandPermissions ¶
func (s *Session) ApplicationCommandPermissions(appID, guildID, cmdID string, options ...RequestOption) (permissions *GuildApplicationCommandPermissions, err error)
func (*Session) ApplicationCommandPermissionsBatchEdit ¶
func (s *Session) ApplicationCommandPermissionsBatchEdit(appID, guildID string, permissions []*GuildApplicationCommandPermissions, options ...RequestOption) (err error)
func (*Session) ApplicationCommandPermissionsEdit ¶
func (s *Session) ApplicationCommandPermissionsEdit(appID, guildID, cmdID string, permissions *ApplicationCommandPermissionsList, options ...RequestOption) (err error)
func (*Session) ApplicationCommands ¶
func (s *Session) ApplicationCommands(appID, guildID string, options ...RequestOption) (cmd []*ApplicationCommand, err error)
func (*Session) ApplicationCreate ¶
func (s *Session) ApplicationCreate(ap *Application) (st *Application, err error)
func (*Session) ApplicationDelete ¶
func (*Session) ApplicationEmoji ¶
func (s *Session) ApplicationEmoji(appID, emojiID string, options ...RequestOption) (emoji *Emoji, err error)
func (*Session) ApplicationEmojiCreate ¶
func (s *Session) ApplicationEmojiCreate(appID string, data *EmojiParams, options ...RequestOption) (emoji *Emoji, err error)
func (*Session) ApplicationEmojiDelete ¶
func (s *Session) ApplicationEmojiDelete(appID, emojiID string, options ...RequestOption) (err error)
func (*Session) ApplicationEmojiEdit ¶
func (s *Session) ApplicationEmojiEdit(appID string, emojiID string, data *EmojiParams, options ...RequestOption) (emoji *Emoji, err error)
func (*Session) ApplicationEmojis ¶
func (s *Session) ApplicationEmojis(appID string, options ...RequestOption) (emojis []*Emoji, err error)
func (*Session) ApplicationRoleConnectionMetadata ¶
func (s *Session) ApplicationRoleConnectionMetadata(appID string) (st []*ApplicationRoleConnectionMetadata, err error)
func (*Session) ApplicationRoleConnectionMetadataUpdate ¶
func (s *Session) ApplicationRoleConnectionMetadataUpdate(appID string, metadata []*ApplicationRoleConnectionMetadata) (st []*ApplicationRoleConnectionMetadata, err error)
func (*Session) ApplicationUpdate ¶
func (s *Session) ApplicationUpdate(appID string, ap *Application) (st *Application, err error)
func (*Session) Applications ¶
func (s *Session) Applications() (st []*Application, err error)
func (*Session) AutoModerationRule ¶
func (s *Session) AutoModerationRule(guildID, ruleID string, options ...RequestOption) (st *AutoModerationRule, err error)
func (*Session) AutoModerationRuleCreate ¶
func (s *Session) AutoModerationRuleCreate(guildID string, rule *AutoModerationRule, options ...RequestOption) (st *AutoModerationRule, err error)
func (*Session) AutoModerationRuleDelete ¶
func (s *Session) AutoModerationRuleDelete(guildID, ruleID string, options ...RequestOption) (err error)
func (*Session) AutoModerationRuleEdit ¶
func (s *Session) AutoModerationRuleEdit(guildID, ruleID string, rule *AutoModerationRule, options ...RequestOption) (st *AutoModerationRule, err error)
func (*Session) AutoModerationRules ¶
func (s *Session) AutoModerationRules(guildID string, options ...RequestOption) (st []*AutoModerationRule, err error)
func (*Session) Channel ¶
func (s *Session) Channel(channelID string, options ...RequestOption) (st *Channel, err error)
func (*Session) ChannelDelete ¶
func (s *Session) ChannelDelete(channelID string, options ...RequestOption) (st *Channel, err error)
func (*Session) ChannelEdit ¶
func (s *Session) ChannelEdit(channelID string, data *ChannelEdit, options ...RequestOption) (st *Channel, err error)
func (*Session) ChannelEditComplex ¶
func (s *Session) ChannelEditComplex(channelID string, data *ChannelEdit, options ...RequestOption) (st *Channel, err error)
func (*Session) ChannelFileSend ¶
func (*Session) ChannelFileSendWithMessage ¶
func (*Session) ChannelInviteCreate ¶
func (*Session) ChannelInvites ¶
func (s *Session) ChannelInvites(channelID string, options ...RequestOption) (st []*Invite, err error)
func (*Session) ChannelMessage ¶
func (s *Session) ChannelMessage(channelID, messageID string, options ...RequestOption) (st *Message, err error)
func (*Session) ChannelMessageCrosspost ¶
func (s *Session) ChannelMessageCrosspost(channelID, messageID string, options ...RequestOption) (st *Message, err error)
func (*Session) ChannelMessageDelete ¶
func (s *Session) ChannelMessageDelete(channelID, messageID string, options ...RequestOption) (err error)
func (*Session) ChannelMessageEdit ¶
func (s *Session) ChannelMessageEdit(channelID, messageID, content string, options ...RequestOption) (*Message, error)
func (*Session) ChannelMessageEditComplex ¶
func (s *Session) ChannelMessageEditComplex(m *MessageEdit, options ...RequestOption) (st *Message, err error)
func (*Session) ChannelMessageEditEmbed ¶
func (s *Session) ChannelMessageEditEmbed(channelID, messageID string, embed *MessageEmbed, options ...RequestOption) (*Message, error)
func (*Session) ChannelMessageEditEmbeds ¶
func (s *Session) ChannelMessageEditEmbeds(channelID, messageID string, embeds []*MessageEmbed, options ...RequestOption) (*Message, error)
func (*Session) ChannelMessagePin ¶
func (s *Session) ChannelMessagePin(channelID, messageID string, options ...RequestOption) (err error)
func (*Session) ChannelMessageSend ¶
func (*Session) ChannelMessageSendComplex ¶
func (s *Session) ChannelMessageSendComplex(channelID string, data *MessageSend, options ...RequestOption) (st *Message, err error)
func (*Session) ChannelMessageSendEmbed ¶
func (s *Session) ChannelMessageSendEmbed(channelID string, embed *MessageEmbed, options ...RequestOption) (*Message, error)
func (*Session) ChannelMessageSendEmbedReply ¶
func (s *Session) ChannelMessageSendEmbedReply(channelID string, embed *MessageEmbed, reference *MessageReference, options ...RequestOption) (*Message, error)
func (*Session) ChannelMessageSendEmbeds ¶
func (s *Session) ChannelMessageSendEmbeds(channelID string, embeds []*MessageEmbed, options ...RequestOption) (*Message, error)
func (*Session) ChannelMessageSendEmbedsReply ¶
func (s *Session) ChannelMessageSendEmbedsReply(channelID string, embeds []*MessageEmbed, reference *MessageReference, options ...RequestOption) (*Message, error)
func (*Session) ChannelMessageSendReply ¶
func (s *Session) ChannelMessageSendReply(channelID string, content string, reference *MessageReference, options ...RequestOption) (*Message, error)
func (*Session) ChannelMessageSendTTS ¶
func (*Session) ChannelMessageUnpin ¶
func (s *Session) ChannelMessageUnpin(channelID, messageID string, options ...RequestOption) (err error)
func (*Session) ChannelMessages ¶
func (*Session) ChannelMessagesBulkDelete ¶
func (s *Session) ChannelMessagesBulkDelete(channelID string, messages []string, options ...RequestOption) (err error)
func (*Session) ChannelMessagesPinned ¶
func (s *Session) ChannelMessagesPinned(channelID string, options ...RequestOption) (st []*Message, err error)
func (*Session) ChannelNewsFollow ¶
func (s *Session) ChannelNewsFollow(channelID, targetID string, options ...RequestOption) (st *ChannelFollow, err error)
func (*Session) ChannelPermissionDelete ¶
func (s *Session) ChannelPermissionDelete(channelID, targetID string, options ...RequestOption) (err error)
func (*Session) ChannelPermissionSet ¶
func (s *Session) ChannelPermissionSet(channelID, targetID string, targetType PermissionOverwriteType, allow, deny int64, options ...RequestOption) (err error)
func (*Session) ChannelTyping ¶
func (s *Session) ChannelTyping(channelID string, options ...RequestOption) (err error)
func (*Session) ChannelVoiceJoin ¶
func (s *Session) ChannelVoiceJoin(gID, cID string, mute, deaf bool) (voice *VoiceConnection, err error)
func (*Session) ChannelVoiceJoinManual ¶
func (*Session) ChannelWebhooks ¶
func (s *Session) ChannelWebhooks(channelID string, options ...RequestOption) (st []*Webhook, err error)
func (*Session) CloseWithCode ¶
func (*Session) EntitlementConsume ¶
func (s *Session) EntitlementConsume(appID, entitlementID string, options ...RequestOption) (err error)
func (*Session) EntitlementTestCreate ¶
func (s *Session) EntitlementTestCreate(appID string, data *EntitlementTest, options ...RequestOption) (err error)
func (*Session) EntitlementTestDelete ¶
func (s *Session) EntitlementTestDelete(appID, entitlementID string, options ...RequestOption) (err error)
func (*Session) Entitlements ¶
func (s *Session) Entitlements(appID string, filterOptions *EntitlementFilterOptions, options ...RequestOption) (entitlements []*Entitlement, err error)
func (*Session) FollowupMessageCreate ¶
func (s *Session) FollowupMessageCreate(interaction *Interaction, wait bool, data *WebhookParams, options ...RequestOption) (*Message, error)
func (*Session) FollowupMessageDelete ¶
func (s *Session) FollowupMessageDelete(interaction *Interaction, messageID string, options ...RequestOption) error
func (*Session) FollowupMessageEdit ¶
func (s *Session) FollowupMessageEdit(interaction *Interaction, messageID string, data *WebhookEdit, options ...RequestOption) (*Message, error)
func (*Session) ForumThreadStart ¶
func (s *Session) ForumThreadStart(channelID, name string, archiveDuration ThreadArchiveDuration, content string, options ...RequestOption) (th *Channel, err error)
func (*Session) ForumThreadStartComplex ¶
func (s *Session) ForumThreadStartComplex(channelID string, threadData *ThreadStart, messageData *MessageSend, options ...RequestOption) (th *Channel, err error)
func (*Session) ForumThreadStartEmbed ¶
func (s *Session) ForumThreadStartEmbed(channelID, name string, archiveDuration ThreadArchiveDuration, embed *MessageEmbed, options ...RequestOption) (th *Channel, err error)
func (*Session) ForumThreadStartEmbeds ¶
func (s *Session) ForumThreadStartEmbeds(channelID, name string, archiveDuration ThreadArchiveDuration, embeds []*MessageEmbed, options ...RequestOption) (th *Channel, err error)
func (*Session) Gateway ¶
func (s *Session) Gateway(options ...RequestOption) (gateway string, err error)
func (*Session) GatewayBot ¶
func (s *Session) GatewayBot(options ...RequestOption) (st *GatewayBotResponse, err error)
func (*Session) GatewayWriteStruct ¶
func (*Session) Guild ¶
func (s *Session) Guild(guildID string, options ...RequestOption) (st *Guild, err error)
func (*Session) GuildApplicationCommandsPermissions ¶
func (s *Session) GuildApplicationCommandsPermissions(appID, guildID string, options ...RequestOption) (permissions []*GuildApplicationCommandPermissions, err error)
func (*Session) GuildAuditLog ¶
func (s *Session) GuildAuditLog(guildID, userID, beforeID string, actionType, limit int, options ...RequestOption) (st *GuildAuditLog, err error)
func (*Session) GuildBan ¶
func (s *Session) GuildBan(guildID, userID string, options ...RequestOption) (st *GuildBan, err error)
func (*Session) GuildBanCreate ¶
func (s *Session) GuildBanCreate(guildID, userID string, days int, options ...RequestOption) (err error)
func (*Session) GuildBanCreateWithReason ¶
func (s *Session) GuildBanCreateWithReason(guildID, userID, reason string, days int, options ...RequestOption) (err error)
func (*Session) GuildBanDelete ¶
func (s *Session) GuildBanDelete(guildID, userID string, options ...RequestOption) (err error)
func (*Session) GuildChannelCreate ¶
func (s *Session) GuildChannelCreate(guildID, name string, ctype ChannelType, options ...RequestOption) (st *Channel, err error)
func (*Session) GuildChannelCreateComplex ¶
func (s *Session) GuildChannelCreateComplex(guildID string, data GuildChannelCreateData, options ...RequestOption) (st *Channel, err error)
func (*Session) GuildChannels ¶
func (s *Session) GuildChannels(guildID string, options ...RequestOption) (st []*Channel, err error)
func (*Session) GuildChannelsReorder ¶
func (s *Session) GuildChannelsReorder(guildID string, channels []*Channel, options ...RequestOption) (err error)
func (*Session) GuildCreate ¶
func (s *Session) GuildCreate(name string, options ...RequestOption) (st *Guild, err error)
func (*Session) GuildCreateWithTemplate ¶
func (s *Session) GuildCreateWithTemplate(templateCode, name, icon string, options ...RequestOption) (st *Guild, err error)
func (*Session) GuildDelete ¶
func (s *Session) GuildDelete(guildID string, options ...RequestOption) (err error)
func (*Session) GuildEdit ¶
func (s *Session) GuildEdit(guildID string, g *GuildParams, options ...RequestOption) (st *Guild, err error)
func (*Session) GuildEmbed ¶
func (s *Session) GuildEmbed(guildID string, options ...RequestOption) (st *GuildEmbed, err error)
func (*Session) GuildEmbedEdit ¶
func (s *Session) GuildEmbedEdit(guildID string, data *GuildEmbed, options ...RequestOption) (err error)
func (*Session) GuildEmoji ¶
func (s *Session) GuildEmoji(guildID, emojiID string, options ...RequestOption) (emoji *Emoji, err error)
func (*Session) GuildEmojiCreate ¶
func (s *Session) GuildEmojiCreate(guildID string, data *EmojiParams, options ...RequestOption) (emoji *Emoji, err error)
func (*Session) GuildEmojiDelete ¶
func (s *Session) GuildEmojiDelete(guildID, emojiID string, options ...RequestOption) (err error)
func (*Session) GuildEmojiEdit ¶
func (s *Session) GuildEmojiEdit(guildID, emojiID string, data *EmojiParams, options ...RequestOption) (emoji *Emoji, err error)
func (*Session) GuildEmojis ¶
func (s *Session) GuildEmojis(guildID string, options ...RequestOption) (emoji []*Emoji, err error)
func (*Session) GuildIntegrationCreate ¶
func (s *Session) GuildIntegrationCreate(guildID, integrationType, integrationID string, options ...RequestOption) (err error)
func (*Session) GuildIntegrationDelete ¶
func (s *Session) GuildIntegrationDelete(guildID, integrationID string, options ...RequestOption) (err error)
func (*Session) GuildIntegrationEdit ¶
func (*Session) GuildIntegrations ¶
func (s *Session) GuildIntegrations(guildID string, options ...RequestOption) (st []*Integration, err error)
func (*Session) GuildInvites ¶
func (s *Session) GuildInvites(guildID string, options ...RequestOption) (st []*Invite, err error)
func (*Session) GuildLeave ¶
func (s *Session) GuildLeave(guildID string, options ...RequestOption) (err error)
func (*Session) GuildMember ¶
func (s *Session) GuildMember(guildID, userID string, options ...RequestOption) (st *Member, err error)
func (*Session) GuildMemberAdd ¶
func (s *Session) GuildMemberAdd(guildID, userID string, data *GuildMemberAddParams, options ...RequestOption) (err error)
func (*Session) GuildMemberDeafen ¶
func (*Session) GuildMemberDelete ¶
func (s *Session) GuildMemberDelete(guildID, userID string, options ...RequestOption) (err error)
func (*Session) GuildMemberDeleteWithReason ¶
func (s *Session) GuildMemberDeleteWithReason(guildID, userID, reason string, options ...RequestOption) (err error)
func (*Session) GuildMemberEdit ¶
func (s *Session) GuildMemberEdit(guildID, userID string, data *GuildMemberParams, options ...RequestOption) (st *Member, err error)
func (*Session) GuildMemberEditComplex ¶
func (s *Session) GuildMemberEditComplex(guildID, userID string, data *GuildMemberParams, options ...RequestOption) (st *Member, err error)
func (*Session) GuildMemberMove ¶
func (*Session) GuildMemberMute ¶
func (*Session) GuildMemberNickname ¶
func (s *Session) GuildMemberNickname(guildID, userID, nickname string, options ...RequestOption) (err error)
func (*Session) GuildMemberRoleAdd ¶
func (s *Session) GuildMemberRoleAdd(guildID, userID, roleID string, options ...RequestOption) (err error)
func (*Session) GuildMemberRoleRemove ¶
func (s *Session) GuildMemberRoleRemove(guildID, userID, roleID string, options ...RequestOption) (err error)
func (*Session) GuildMemberTimeout ¶
func (*Session) GuildMembers ¶
func (*Session) GuildMembersSearch ¶
func (*Session) GuildOnboarding ¶
func (s *Session) GuildOnboarding(guildID string, options ...RequestOption) (onboarding *GuildOnboarding, err error)
func (*Session) GuildOnboardingEdit ¶
func (s *Session) GuildOnboardingEdit(guildID string, o *GuildOnboarding, options ...RequestOption) (onboarding *GuildOnboarding, err error)
func (*Session) GuildPreview ¶
func (s *Session) GuildPreview(guildID string, options ...RequestOption) (st *GuildPreview, err error)
func (*Session) GuildPrune ¶
func (*Session) GuildPruneCount ¶
func (*Session) GuildRoleCreate ¶
func (s *Session) GuildRoleCreate(guildID string, data *RoleParams, options ...RequestOption) (st *Role, err error)
func (*Session) GuildRoleDelete ¶
func (s *Session) GuildRoleDelete(guildID, roleID string, options ...RequestOption) (err error)
func (*Session) GuildRoleEdit ¶
func (s *Session) GuildRoleEdit(guildID, roleID string, data *RoleParams, options ...RequestOption) (st *Role, err error)
func (*Session) GuildRoleReorder ¶
func (*Session) GuildRoles ¶
func (s *Session) GuildRoles(guildID string, options ...RequestOption) (st []*Role, err error)
func (*Session) GuildScheduledEvent ¶
func (s *Session) GuildScheduledEvent(guildID, eventID string, userCount bool, options ...RequestOption) (st *GuildScheduledEvent, err error)
func (*Session) GuildScheduledEventCreate ¶
func (s *Session) GuildScheduledEventCreate(guildID string, event *GuildScheduledEventParams, options ...RequestOption) (st *GuildScheduledEvent, err error)
func (*Session) GuildScheduledEventDelete ¶
func (s *Session) GuildScheduledEventDelete(guildID, eventID string, options ...RequestOption) (err error)
func (*Session) GuildScheduledEventEdit ¶
func (s *Session) GuildScheduledEventEdit(guildID, eventID string, event *GuildScheduledEventParams, options ...RequestOption) (st *GuildScheduledEvent, err error)
func (*Session) GuildScheduledEventUsers ¶
func (s *Session) GuildScheduledEventUsers(guildID, eventID string, limit int, withMember bool, beforeID, afterID string, options ...RequestOption) (st []*GuildScheduledEventUser, err error)
func (*Session) GuildScheduledEvents ¶
func (s *Session) GuildScheduledEvents(guildID string, userCount bool, options ...RequestOption) (st []*GuildScheduledEvent, err error)
func (*Session) GuildSplash ¶
func (*Session) GuildTemplate ¶
func (s *Session) GuildTemplate(templateCode string, options ...RequestOption) (st *GuildTemplate, err error)
func (*Session) GuildTemplateCreate ¶
func (s *Session) GuildTemplateCreate(guildID string, data *GuildTemplateParams, options ...RequestOption) (st *GuildTemplate)
func (*Session) GuildTemplateDelete ¶
func (s *Session) GuildTemplateDelete(guildID, templateCode string, options ...RequestOption) (err error)
func (*Session) GuildTemplateEdit ¶
func (s *Session) GuildTemplateEdit(guildID, templateCode string, data *GuildTemplateParams, options ...RequestOption) (st *GuildTemplate, err error)
func (*Session) GuildTemplateSync ¶
func (s *Session) GuildTemplateSync(guildID, templateCode string, options ...RequestOption) (err error)
func (*Session) GuildTemplates ¶
func (s *Session) GuildTemplates(guildID string, options ...RequestOption) (st []*GuildTemplate, err error)
func (*Session) GuildThreadsActive ¶
func (s *Session) GuildThreadsActive(guildID string, options ...RequestOption) (threads *ThreadsList, err error)
func (*Session) GuildWebhooks ¶
func (s *Session) GuildWebhooks(guildID string, options ...RequestOption) (st []*Webhook, err error)
func (*Session) GuildWithCounts ¶
func (s *Session) GuildWithCounts(guildID string, options ...RequestOption) (st *Guild, err error)
func (*Session) HeartbeatLatency ¶
func (*Session) InteractionRespond ¶
func (s *Session) InteractionRespond(interaction *Interaction, resp *InteractionResponse, options ...RequestOption) error
func (*Session) InteractionResponse ¶
func (s *Session) InteractionResponse(interaction *Interaction, options ...RequestOption) (*Message, error)
func (*Session) InteractionResponseDelete ¶
func (s *Session) InteractionResponseDelete(interaction *Interaction, options ...RequestOption) error
func (*Session) InteractionResponseEdit ¶
func (s *Session) InteractionResponseEdit(interaction *Interaction, newresp *WebhookEdit, options ...RequestOption) (*Message, error)
func (*Session) Invite ¶
func (s *Session) Invite(inviteID string, options ...RequestOption) (st *Invite, err error)
func (*Session) InviteAccept ¶
func (s *Session) InviteAccept(inviteID string, options ...RequestOption) (st *Invite, err error)
func (*Session) InviteComplex ¶
func (*Session) InviteDelete ¶
func (s *Session) InviteDelete(inviteID string, options ...RequestOption) (st *Invite, err error)
func (*Session) InviteWithCounts ¶
func (s *Session) InviteWithCounts(inviteID string, options ...RequestOption) (st *Invite, err error)
func (*Session) MessageReactionAdd ¶
func (s *Session) MessageReactionAdd(channelID, messageID, emojiID string, options ...RequestOption) error
func (*Session) MessageReactionRemove ¶
func (s *Session) MessageReactionRemove(channelID, messageID, emojiID, userID string, options ...RequestOption) error
func (*Session) MessageReactions ¶
func (*Session) MessageReactionsRemoveAll ¶
func (s *Session) MessageReactionsRemoveAll(channelID, messageID string, options ...RequestOption) error
func (*Session) MessageReactionsRemoveEmoji ¶
func (s *Session) MessageReactionsRemoveEmoji(channelID, messageID, emojiID string, options ...RequestOption) error
func (*Session) MessageThreadStart ¶
func (s *Session) MessageThreadStart(channelID, messageID string, name string, archiveDuration ThreadArchiveDuration, options ...RequestOption) (ch *Channel, err error)
func (*Session) MessageThreadStartComplex ¶
func (s *Session) MessageThreadStartComplex(channelID, messageID string, data *ThreadStart, options ...RequestOption) (ch *Channel, err error)
func (*Session) PollAnswerVoters ¶
func (*Session) PollExpire ¶
func (*Session) Request ¶
func (s *Session) Request(method, urlStr string, data interface{}, options ...RequestOption) (response []byte, err error)
func (*Session) RequestGuildMembers ¶
func (*Session) RequestGuildMembersBatch ¶
func (*Session) RequestGuildMembersBatchList ¶
func (*Session) RequestGuildMembersList ¶
func (*Session) RequestWithBucketID ¶
func (*Session) RequestWithLockedBucket ¶
func (*Session) StageInstance ¶
func (s *Session) StageInstance(channelID string, options ...RequestOption) (si *StageInstance, err error)
func (*Session) StageInstanceCreate ¶
func (s *Session) StageInstanceCreate(data *StageInstanceParams, options ...RequestOption) (si *StageInstance, err error)
func (*Session) StageInstanceDelete ¶
func (s *Session) StageInstanceDelete(channelID string, options ...RequestOption) (err error)
func (*Session) StageInstanceEdit ¶
func (s *Session) StageInstanceEdit(channelID string, data *StageInstanceParams, options ...RequestOption) (si *StageInstance, err error)
func (*Session) Subscription ¶
func (s *Session) Subscription(skuID, subscriptionID, userID string, options ...RequestOption) (subscription *Subscription, err error)
func (*Session) Subscriptions ¶
func (s *Session) Subscriptions(skuID string, userID string, before, after *time.Time, limit int, options ...RequestOption) (subscriptions []*Subscription, err error)
func (*Session) ThreadJoin ¶
func (s *Session) ThreadJoin(id string, options ...RequestOption) error
func (*Session) ThreadLeave ¶
func (s *Session) ThreadLeave(id string, options ...RequestOption) error
func (*Session) ThreadMember ¶
func (s *Session) ThreadMember(threadID, memberID string, withMember bool, options ...RequestOption) (member *ThreadMember, err error)
func (*Session) ThreadMemberAdd ¶
func (s *Session) ThreadMemberAdd(threadID, memberID string, options ...RequestOption) error
func (*Session) ThreadMemberRemove ¶
func (s *Session) ThreadMemberRemove(threadID, memberID string, options ...RequestOption) error
func (*Session) ThreadMembers ¶
func (s *Session) ThreadMembers(threadID string, limit int, withMember bool, afterID string, options ...RequestOption) (members []*ThreadMember, err error)
func (*Session) ThreadStart ¶
func (s *Session) ThreadStart(channelID, name string, typ ChannelType, archiveDuration ThreadArchiveDuration, options ...RequestOption) (ch *Channel, err error)
func (*Session) ThreadStartComplex ¶
func (s *Session) ThreadStartComplex(channelID string, data *ThreadStart, options ...RequestOption) (ch *Channel, err error)
func (*Session) ThreadsActive ¶
func (s *Session) ThreadsActive(channelID string, options ...RequestOption) (threads *ThreadsList, err error)
func (*Session) ThreadsArchived ¶
func (s *Session) ThreadsArchived(channelID string, before *time.Time, limit int, options ...RequestOption) (threads *ThreadsList, err error)
func (*Session) ThreadsPrivateArchived ¶
func (s *Session) ThreadsPrivateArchived(channelID string, before *time.Time, limit int, options ...RequestOption) (threads *ThreadsList, err error)
func (*Session) ThreadsPrivateJoinedArchived ¶
func (s *Session) ThreadsPrivateJoinedArchived(channelID string, before *time.Time, limit int, options ...RequestOption) (threads *ThreadsList, err error)
func (*Session) UpdateCustomStatus ¶
func (*Session) UpdateGameStatus ¶
func (*Session) UpdateListeningStatus ¶
func (*Session) UpdateStatusComplex ¶
func (s *Session) UpdateStatusComplex(usd UpdateStatusData) (err error)
func (*Session) UpdateStreamingStatus ¶
func (*Session) UpdateWatchStatus ¶
func (*Session) User ¶
func (s *Session) User(userID string, options ...RequestOption) (st *User, err error)
func (*Session) UserApplicationRoleConnection ¶
func (s *Session) UserApplicationRoleConnection(appID string) (st *ApplicationRoleConnection, err error)
func (*Session) UserApplicationRoleConnectionUpdate ¶
func (s *Session) UserApplicationRoleConnectionUpdate(appID string, rconn *ApplicationRoleConnection) (st *ApplicationRoleConnection, err error)
func (*Session) UserAvatar ¶
func (*Session) UserAvatarDecode ¶
func (*Session) UserChannelCreate ¶
func (s *Session) UserChannelCreate(recipientID string, options ...RequestOption) (st *Channel, err error)
func (*Session) UserChannelPermissions ¶
func (s *Session) UserChannelPermissions(userID, channelID string, fetchOptions ...RequestOption) (apermissions int64, err error)
func (*Session) UserConnections ¶
func (s *Session) UserConnections(options ...RequestOption) (conn []*UserConnection, err error)
func (*Session) UserGuildMember ¶
func (s *Session) UserGuildMember(guildID string, options ...RequestOption) (st *Member, err error)
func (*Session) UserGuilds ¶
func (*Session) UserUpdate ¶
func (s *Session) UserUpdate(username, avatar, banner string, options ...RequestOption) (st *User, err error)
func (*Session) VoiceRegions ¶
func (s *Session) VoiceRegions(options ...RequestOption) (st []*VoiceRegion, err error)
func (*Session) Webhook ¶
func (s *Session) Webhook(webhookID string, options ...RequestOption) (st *Webhook, err error)
func (*Session) WebhookCreate ¶
func (s *Session) WebhookCreate(channelID, name, avatar string, options ...RequestOption) (st *Webhook, err error)
func (*Session) WebhookDelete ¶
func (s *Session) WebhookDelete(webhookID string, options ...RequestOption) (err error)
func (*Session) WebhookDeleteWithToken ¶
func (s *Session) WebhookDeleteWithToken(webhookID, token string, options ...RequestOption) (st *Webhook, err error)
func (*Session) WebhookEdit ¶
func (s *Session) WebhookEdit(webhookID, name, avatar, channelID string, options ...RequestOption) (st *Webhook, err error)
func (*Session) WebhookEditWithToken ¶
func (s *Session) WebhookEditWithToken(webhookID, token, name, avatar string, options ...RequestOption) (st *Webhook, err error)
func (*Session) WebhookExecute ¶
func (s *Session) WebhookExecute(webhookID, token string, wait bool, data *WebhookParams, options ...RequestOption) (st *Message, err error)
func (*Session) WebhookMessage ¶
func (s *Session) WebhookMessage(webhookID, token, messageID string, options ...RequestOption) (message *Message, err error)
func (*Session) WebhookMessageDelete ¶
func (s *Session) WebhookMessageDelete(webhookID, token, messageID string, options ...RequestOption) (err error)
func (*Session) WebhookMessageEdit ¶
func (s *Session) WebhookMessageEdit(webhookID, token, messageID string, data *WebhookEdit, options ...RequestOption) (st *Message, err error)
func (*Session) WebhookThreadExecute ¶
func (s *Session) WebhookThreadExecute(webhookID, token string, wait bool, threadID string, data *WebhookParams, options ...RequestOption) (st *Message, err error)
func (*Session) WebhookWithToken ¶
func (s *Session) WebhookWithToken(webhookID, token string, options ...RequestOption) (st *Webhook, err error)
type SessionInformation ¶
type StageInstance ¶
type StageInstance struct { ID string `json:"id"` GuildID string `json:"guild_id"` ChannelID string `json:"channel_id"` Topic string `json:"topic"` PrivacyLevel StageInstancePrivacyLevel `json:"privacy_level"` DiscoverableDisabled bool `json:"discoverable_disabled"` GuildScheduledEventID string `json:"guild_scheduled_event_id"` }
type StageInstanceEventCreate ¶
type StageInstanceEventCreate struct {
*StageInstance
}
type StageInstanceEventDelete ¶
type StageInstanceEventDelete struct {
*StageInstance
}
type StageInstanceEventUpdate ¶
type StageInstanceEventUpdate struct {
*StageInstance
}
type StageInstanceParams ¶
type StageInstanceParams struct { ChannelID string `json:"channel_id,omitempty"` Topic string `json:"topic,omitempty"` PrivacyLevel StageInstancePrivacyLevel `json:"privacy_level,omitempty"` SendStartNotification bool `json:"send_start_notification,omitempty"` }
type StageInstancePrivacyLevel ¶
type StageInstancePrivacyLevel int
const ( StageInstancePrivacyLevelPublic StageInstancePrivacyLevel = 1 StageInstancePrivacyLevelGuildOnly StageInstancePrivacyLevel = 2 )
type State ¶
type State struct { sync.RWMutex Ready MaxMessageCount int TrackChannels bool TrackThreads bool TrackEmojis bool TrackMembers bool TrackThreadMembers bool TrackRoles bool TrackVoice bool TrackPresences bool // contains filtered or unexported fields }
func (*State) ChannelAdd ¶
func (*State) ChannelRemove ¶
func (*State) GuildRemove ¶
func (*State) MemberRemove ¶
func (*State) MessageAdd ¶
func (*State) MessageColor ¶
func (*State) MessagePermissions ¶
func (*State) MessageRemove ¶
func (*State) OnInterface ¶
func (*State) PresenceRemove ¶
func (*State) RoleRemove ¶
func (*State) ThreadListSync ¶
func (s *State) ThreadListSync(tls *ThreadListSync) error
func (*State) ThreadMemberUpdate ¶
func (s *State) ThreadMemberUpdate(mu *ThreadMemberUpdate) error
func (*State) ThreadMembersUpdate ¶
func (s *State) ThreadMembersUpdate(tmu *ThreadMembersUpdate) error
func (*State) UserChannelPermissions ¶
func (*State) VoiceState ¶
func (s *State) VoiceState(guildID, userID string) (*VoiceState, error)
type Sticker ¶
type Sticker struct { ID string `json:"id"` PackID string `json:"pack_id"` Name string `json:"name"` Description string `json:"description"` Tags string `json:"tags"` Type StickerType `json:"type"` FormatType StickerFormat `json:"format_type"` Available bool `json:"available"` GuildID string `json:"guild_id"` User *User `json:"user"` SortValue int `json:"sort_value"` }
type StickerFormat ¶
type StickerFormat int
const ( StickerFormatTypePNG StickerFormat = 1 StickerFormatTypeAPNG StickerFormat = 2 StickerFormatTypeLottie StickerFormat = 3 StickerFormatTypeGIF StickerFormat = 4 )
type StickerItem ¶
type StickerItem struct { ID string `json:"id"` Name string `json:"name"` FormatType StickerFormat `json:"format_type"` }
type StickerPack ¶
type StickerType ¶
type StickerType int
const ( StickerTypeStandard StickerType = 1 StickerTypeGuild StickerType = 2 )
type Subscription ¶
type Subscription struct { ID string `json:"id"` UserID string `json:"user_id"` SKUIDs []string `json:"sku_ids"` EntitlementIDs []string `json:"entitlement_ids"` RenewalSKUIDs []string `json:"renewal_sku_ids,omitempty"` CurrentPeriodStart time.Time `json:"current_period_start"` CurrentPeriodEnd time.Time `json:"current_period_end"` Status SubscriptionStatus `json:"status"` CanceledAt *time.Time `json:"canceled_at,omitempty"` Country string `json:"country,omitempty"` }
type SubscriptionCreate ¶
type SubscriptionCreate struct {
*Subscription
}
type SubscriptionDelete ¶
type SubscriptionDelete struct {
*Subscription
}
type SubscriptionStatus ¶
type SubscriptionStatus int
type SubscriptionUpdate ¶
type SubscriptionUpdate struct {
*Subscription
}
type SystemChannelFlag ¶
type SystemChannelFlag int
const ( SystemChannelFlagsSuppressJoinNotifications SystemChannelFlag = 1 << 0 SystemChannelFlagsSuppressPremium SystemChannelFlag = 1 << 1 SystemChannelFlagsSuppressGuildReminderNotifications SystemChannelFlag = 1 << 2 SystemChannelFlagsSuppressJoinNotificationReplies SystemChannelFlag = 1 << 3 )
type TeamMember ¶
type TeamMember struct { User *User `json:"user"` TeamID string `json:"team_id"` MembershipState MembershipState `json:"membership_state"` Permissions []string `json:"permissions"` }
type TextInput ¶
type TextInput struct { CustomID string `json:"custom_id"` Label string `json:"label"` Style TextInputStyle `json:"style"` Placeholder string `json:"placeholder,omitempty"` Value string `json:"value,omitempty"` Required bool `json:"required"` MinLength int `json:"min_length,omitempty"` MaxLength int `json:"max_length,omitempty"` }
func (TextInput) MarshalJSON ¶
func (TextInput) Type ¶
func (TextInput) Type() ComponentType
type TextInputStyle ¶
type TextInputStyle uint
const ( TextInputShort TextInputStyle = 1 TextInputParagraph TextInputStyle = 2 )
type ThreadArchiveDuration ¶ added in v0.28.2
type ThreadArchiveDuration int
type ThreadCreate ¶
type ThreadDelete ¶
type ThreadDelete struct {
*Channel
}
type ThreadListSync ¶
type ThreadListSync struct { GuildID string `json:"guild_id"` ChannelIDs []string `json:"channel_ids"` Threads []*Channel `json:"threads"` Members []*ThreadMember `json:"members"` }
type ThreadMember ¶
type ThreadMemberUpdate ¶
type ThreadMemberUpdate struct { *ThreadMember GuildID string `json:"guild_id"` }
type ThreadMembersUpdate ¶
type ThreadMembersUpdate struct { ID string `json:"id"` GuildID string `json:"guild_id"` MemberCount int `json:"member_count"` AddedMembers []AddedThreadMember `json:"added_members"` RemovedMembers []string `json:"removed_member_ids"` }
type ThreadMetadata ¶
type ThreadStart ¶
type ThreadStart struct { Name string `json:"name"` AutoArchiveDuration ThreadArchiveDuration `json:"auto_archive_duration,omitempty"` Type ChannelType `json:"type,omitempty"` Invitable bool `json:"invitable"` RateLimitPerUser int `json:"rate_limit_per_user,omitempty"` AppliedTags []string `json:"applied_tags,omitempty"` }
type ThreadUpdate ¶
type ThreadsList ¶
type ThreadsList struct { Threads []*Channel `json:"threads"` Members []*ThreadMember `json:"members"` HasMore bool `json:"has_more"` }
type TimeStamps ¶
type TimeStamps struct { EndTimestamp int64 `json:"end,omitempty"` StartTimestamp int64 `json:"start,omitempty"` }
func (*TimeStamps) UnmarshalJSON ¶
func (t *TimeStamps) UnmarshalJSON(data []byte) error
type TooManyRequests ¶
type TooManyRequests struct { Bucket string `json:"bucket"` Message string `json:"message"` RetryAfter time.Duration `json:"retry_after"` }
func (*TooManyRequests) UnmarshalJSON ¶
func (t *TooManyRequests) UnmarshalJSON(data []byte) error
type TypingStart ¶
type UpdateStatusData ¶
type User ¶
type User struct { ID string `json:"id"` Email string `json:"email"` Username string `json:"username"` Avatar string `json:"avatar"` Locale string `json:"locale"` Discriminator string `json:"discriminator"` GlobalName string `json:"global_name"` Token string `json:"token"` Verified bool `json:"verified"` MFAEnabled bool `json:"mfa_enabled"` Banner string `json:"banner"` AccentColor int `json:"accent_color"` Bot bool `json:"bot"` PublicFlags UserFlags `json:"public_flags"` PremiumType UserPremiumType `json:"premium_type"` System bool `json:"system"` Flags int `json:"flags"` }
func (*User) DefaultAvatarIndex ¶
func (*User) DisplayName ¶
type UserConnection ¶
type UserConnection struct { ID string `json:"id"` Name string `json:"name"` Type string `json:"type"` Revoked bool `json:"revoked"` Integrations []*Integration `json:"integrations"` }
type UserFlags ¶
type UserFlags int
const ( UserFlagDiscordEmployee UserFlags = 1 << 0 UserFlagDiscordPartner UserFlags = 1 << 1 UserFlagHypeSquadEvents UserFlags = 1 << 2 UserFlagBugHunterLevel1 UserFlags = 1 << 3 UserFlagHouseBravery UserFlags = 1 << 6 UserFlagHouseBrilliance UserFlags = 1 << 7 UserFlagHouseBalance UserFlags = 1 << 8 UserFlagEarlySupporter UserFlags = 1 << 9 UserFlagTeamUser UserFlags = 1 << 10 UserFlagSystem UserFlags = 1 << 12 UserFlagBugHunterLevel2 UserFlags = 1 << 14 UserFlagVerifiedBot UserFlags = 1 << 16 UserFlagVerifiedBotDeveloper UserFlags = 1 << 17 UserFlagDiscordCertifiedModerator UserFlags = 1 << 18 UserFlagBotHTTPInteractions UserFlags = 1 << 19 UserFlagSpammer UserFlags = 1 << 20 UserFlagActiveBotDeveloper UserFlags = 1 << 22 )
type UserGuild ¶
type UserGuild struct { ID string `json:"id"` Name string `json:"name"` Icon string `json:"icon"` Owner bool `json:"owner"` Permissions int64 `json:"permissions,string"` Features []GuildFeature `json:"features"` ApproximateMemberCount int `json:"approximate_member_count"` ApproximatePresenceCount int `json:"approximate_presence_count"` }
type UserPremiumType ¶
type UserPremiumType int
const ( UserPremiumTypeNone UserPremiumType = 0 UserPremiumTypeNitroClassic UserPremiumType = 1 UserPremiumTypeNitro UserPremiumType = 2 UserPremiumTypeNitroBasic UserPremiumType = 3 )
type UserUpdate ¶
type UserUpdate struct {
*User
}
type VerificationLevel ¶
type VerificationLevel int
const ( VerificationLevelNone VerificationLevel = 0 VerificationLevelLow VerificationLevel = 1 VerificationLevelMedium VerificationLevel = 2 VerificationLevelHigh VerificationLevel = 3 VerificationLevelVeryHigh VerificationLevel = 4 )
type VoiceConnection ¶
type VoiceConnection struct { sync.RWMutex Debug bool LogLevel int Ready bool UserID string GuildID string ChannelID string OpusSend chan []byte OpusRecv chan *Packet // contains filtered or unexported fields }
func (*VoiceConnection) AddHandler ¶
func (v *VoiceConnection) AddHandler(h VoiceSpeakingUpdateHandler)
func (*VoiceConnection) ChangeChannel ¶
func (v *VoiceConnection) ChangeChannel(channelID string, mute, deaf bool) (err error)
func (*VoiceConnection) Close ¶
func (v *VoiceConnection) Close()
func (*VoiceConnection) Disconnect ¶
func (v *VoiceConnection) Disconnect() (err error)
func (*VoiceConnection) Speaking ¶
func (v *VoiceConnection) Speaking(b bool) (err error)
type VoiceRegion ¶
type VoiceServerUpdate ¶
type VoiceSpeakingUpdate ¶
type VoiceSpeakingUpdateHandler ¶
type VoiceSpeakingUpdateHandler func(vc *VoiceConnection, vs *VoiceSpeakingUpdate)
type VoiceState ¶
type VoiceState struct { GuildID string `json:"guild_id"` ChannelID string `json:"channel_id"` UserID string `json:"user_id"` Member *Member `json:"member"` 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"` SelfVideo bool `json:"self_video"` Suppress bool `json:"suppress"` RequestToSpeakTimestamp *time.Time `json:"request_to_speak_timestamp"` }
type VoiceStateUpdate ¶
type VoiceStateUpdate struct { *VoiceState BeforeUpdate *VoiceState `json:"-"` }
type Webhook ¶
type Webhook struct { ID string `json:"id"` Type WebhookType `json:"type"` GuildID string `json:"guild_id"` ChannelID string `json:"channel_id"` User *User `json:"user"` Name string `json:"name"` Avatar string `json:"avatar"` Token string `json:"token"` ApplicationID string `json:"application_id,omitempty"` }
type WebhookEdit ¶
type WebhookEdit struct { Content *string `json:"content,omitempty"` Components *[]MessageComponent `json:"components,omitempty"` Embeds *[]*MessageEmbed `json:"embeds,omitempty"` Files []*File `json:"-"` Attachments *[]*MessageAttachment `json:"attachments,omitempty"` AllowedMentions *MessageAllowedMentions `json:"allowed_mentions,omitempty"` }
type WebhookParams ¶
type WebhookParams struct { Content string `json:"content,omitempty"` Username string `json:"username,omitempty"` AvatarURL string `json:"avatar_url,omitempty"` TTS bool `json:"tts,omitempty"` Files []*File `json:"-"` Components []MessageComponent `json:"components"` Embeds []*MessageEmbed `json:"embeds,omitempty"` Attachments []*MessageAttachment `json:"attachments,omitempty"` AllowedMentions *MessageAllowedMentions `json:"allowed_mentions,omitempty"` Flags MessageFlags `json:"flags,omitempty"` ThreadName string `json:"thread_name,omitempty"` }
type WebhookType ¶
type WebhookType int
const ( WebhookTypeIncoming WebhookType = 1 WebhookTypeChannelFollower WebhookType = 2 )
type WebhooksUpdate ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.