Documentation
¶
Overview ¶
Code generated by github.com/switchupcb/disgo/_gen/tools/bundle. DO NOT EDIT.
Index ¶
- Constants
- Variables
- func BotAuthorization()
- func CDNEndpointAchievementIcon(applicationid, achievementid, iconhash string) string
- func CDNEndpointApplicationAsset(applicationid, assetid string) string
- func CDNEndpointApplicationCover(applicationid, coverimage string) string
- func CDNEndpointApplicationIcon(applicationid, icon string) string
- func CDNEndpointCustomEmoji(emojiid string) string
- func CDNEndpointDefaultUserAvatar(index string) string
- func CDNEndpointGuildBanner(guildid, guildbanner string) string
- func CDNEndpointGuildDiscoverySplash(guildid, guilddiscoverysplash string) string
- func CDNEndpointGuildIcon(guildid, guildicon string) string
- func CDNEndpointGuildMemberAvatar(guildid, userid, memberavatar string) string
- func CDNEndpointGuildMemberBanner(guildid, userid, memberbanner string) string
- func CDNEndpointGuildScheduledEventCover(scheduledeventid, scheduledeventcoverimage string) string
- func CDNEndpointGuildSplash(guildid, guildsplash string) string
- func CDNEndpointRoleIcon(roleid, roleicon string) string
- func CDNEndpointSticker(stickerid string) string
- func CDNEndpointStickerPackBanner(stickerpackbannerassetid string) string
- func CDNEndpointStorePageAsset() string
- func CDNEndpointTeamIcon(teamid, teamicon string) string
- func CDNEndpointUserAvatar(userid, useravatar string) string
- func CDNEndpointUserAvatarDecoration(userid, useravatardecoration string) string
- func CDNEndpointUserBanner(userid, userbanner string) string
- func CDNURLParameterExpire() string
- func CDNURLParameterIssued() string
- func CDNURLParameterSignature() string
- func EndpointAddGuildMember(guildid, userid string) string
- func EndpointAddGuildMemberRole(guildid, userid, roleid string) string
- func EndpointAddThreadMember(channelid, userid string) string
- func EndpointAuthorizationURL() string
- func EndpointBatchEditApplicationCommandPermissions(applicationid, guildid string) string
- func EndpointBeginGuildPrune(guildid string) string
- func EndpointBulkDeleteMessages(channelid string) string
- func EndpointBulkOverwriteGlobalApplicationCommands(applicationid string) string
- func EndpointBulkOverwriteGuildApplicationCommands(applicationid, guildid string) string
- func EndpointConsumeEntitlement(applicationid, entitlementid string) string
- func EndpointCreateApplicationEmoji(applicationid string) string
- func EndpointCreateAutoModerationRule(guildid string) string
- func EndpointCreateChannelInvite(channelid string) string
- func EndpointCreateDM() string
- func EndpointCreateFollowupMessage(applicationid, interactiontoken string) string
- func EndpointCreateGlobalApplicationCommand(applicationid string) string
- func EndpointCreateGroupDM() string
- func EndpointCreateGuild() string
- func EndpointCreateGuildApplicationCommand(applicationid, guildid string) string
- func EndpointCreateGuildBan(guildid, userid string) string
- func EndpointCreateGuildChannel(guildid string) string
- func EndpointCreateGuildEmoji(guildid string) string
- func EndpointCreateGuildRole(guildid string) string
- func EndpointCreateGuildScheduledEvent(guildid string) string
- func EndpointCreateGuildSoundboardSound(guildid string) string
- func EndpointCreateGuildSticker(guildid string) string
- func EndpointCreateGuildTemplate(guildid string) string
- func EndpointCreateGuildfromGuildTemplate(templatecode string) string
- func EndpointCreateInteractionResponse(interactionid, interactiontoken string) string
- func EndpointCreateMessage(channelid string) string
- func EndpointCreateReaction(channelid, messageid, emoji string) string
- func EndpointCreateStageInstance() string
- func EndpointCreateTestEntitlement(applicationid string) string
- func EndpointCreateWebhook(channelid string) string
- func EndpointCrosspostMessage(channelid, messageid string) string
- func EndpointDeleteAllReactions(channelid, messageid string) string
- func EndpointDeleteAllReactionsforEmoji(channelid, messageid, emoji string) string
- func EndpointDeleteApplicationEmoji(applicationid, emojiid string) string
- func EndpointDeleteAutoModerationRule(guildid, automoderationruleid string) string
- func EndpointDeleteChannelPermission(channelid, overwriteid string) string
- func EndpointDeleteCloseChannel(channelid string) string
- func EndpointDeleteFollowupMessage(applicationid, interactiontoken, messageid string) string
- func EndpointDeleteGlobalApplicationCommand(applicationid, commandid string) string
- func EndpointDeleteGuild(guildid string) string
- func EndpointDeleteGuildApplicationCommand(applicationid, guildid, commandid string) string
- func EndpointDeleteGuildEmoji(guildid, emojiid string) string
- func EndpointDeleteGuildIntegration(guildid, integrationid string) string
- func EndpointDeleteGuildRole(guildid, roleid string) string
- func EndpointDeleteGuildScheduledEvent(guildid, guildscheduledeventid string) string
- func EndpointDeleteGuildSoundboardSound(guildid, soundid string) string
- func EndpointDeleteGuildSticker(guildid, stickerid string) string
- func EndpointDeleteGuildTemplate(guildid, templatecode string) string
- func EndpointDeleteInvite(invitecode string) string
- func EndpointDeleteMessage(channelid, messageid string) string
- func EndpointDeleteOriginalInteractionResponse(applicationid, interactiontoken string) string
- func EndpointDeleteOwnReaction(channelid, messageid, emoji string) string
- func EndpointDeleteStageInstance(channelid string) string
- func EndpointDeleteTestEntitlement(applicationid, entitlementid string) string
- func EndpointDeleteUserReaction(channelid, messageid, emoji, userid string) string
- func EndpointDeleteWebhook(webhookid string) string
- func EndpointDeleteWebhookMessage(webhookid, webhooktoken, messageid string) string
- func EndpointDeleteWebhookwithToken(webhookid, webhooktoken string) string
- func EndpointEditApplicationCommandPermissions(applicationid, guildid, commandid string) string
- func EndpointEditChannelPermissions(channelid, overwriteid string) string
- func EndpointEditCurrentApplication() string
- func EndpointEditFollowupMessage(applicationid, interactiontoken, messageid string) string
- func EndpointEditGlobalApplicationCommand(applicationid, commandid string) string
- func EndpointEditGuildApplicationCommand(applicationid, guildid, commandid string) string
- func EndpointEditMessage(channelid, messageid string) string
- func EndpointEditOriginalInteractionResponse(applicationid, interactiontoken string) string
- func EndpointEditWebhookMessage(webhookid, webhooktoken, messageid string) string
- func EndpointEndPoll(channelid, messageid string) string
- func EndpointExecuteGitHubCompatibleWebhook(webhookid, webhooktoken string) string
- func EndpointExecuteSlackCompatibleWebhook(webhookid, webhooktoken string) string
- func EndpointExecuteWebhook(webhookid, webhooktoken string) string
- func EndpointFollowAnnouncementChannel(channelid string) string
- func EndpointGetAnswerVoters(channelid, messageid, answerid string) string
- func EndpointGetApplicationActivityInstance(applicationid, instanceid string) string
- func EndpointGetApplicationCommandPermissions(applicationid, guildid, commandid string) string
- func EndpointGetApplicationEmoji(applicationid, emojiid string) string
- func EndpointGetApplicationRoleConnectionMetadataRecords(applicationid string) string
- func EndpointGetAutoModerationRule(guildid, automoderationruleid string) string
- func EndpointGetChannel(channelid string) string
- func EndpointGetChannelInvites(channelid string) string
- func EndpointGetChannelMessage(channelid, messageid string) string
- func EndpointGetChannelMessages(channelid string) string
- func EndpointGetChannelWebhooks(channelid string) string
- func EndpointGetCurrentApplication() string
- func EndpointGetCurrentAuthorizationInformation() string
- func EndpointGetCurrentBotApplicationInformation() string
- func EndpointGetCurrentUser() string
- func EndpointGetCurrentUserApplicationRoleConnection(applicationid string) string
- func EndpointGetCurrentUserConnections() string
- func EndpointGetCurrentUserGuildMember(guildid string) string
- func EndpointGetCurrentUserGuilds() string
- func EndpointGetEntitlement(applicationid, entitlementid string) string
- func EndpointGetFollowupMessage(applicationid, interactiontoken, messageid string) string
- func EndpointGetGateway() string
- func EndpointGetGatewayBot() string
- func EndpointGetGlobalApplicationCommand(applicationid, commandid string) string
- func EndpointGetGlobalApplicationCommands(applicationid string) string
- func EndpointGetGuild(guildid string) string
- func EndpointGetGuildApplicationCommand(applicationid, guildid, commandid string) string
- func EndpointGetGuildApplicationCommandPermissions(applicationid, guildid string) string
- func EndpointGetGuildApplicationCommands(applicationid, guildid string) string
- func EndpointGetGuildAuditLog(guildid string) string
- func EndpointGetGuildBan(guildid, userid string) string
- func EndpointGetGuildBans(guildid string) string
- func EndpointGetGuildChannels(guildid string) string
- func EndpointGetGuildEmoji(guildid, emojiid string) string
- func EndpointGetGuildIntegrations(guildid string) string
- func EndpointGetGuildInvites(guildid string) string
- func EndpointGetGuildMember(guildid, userid string) string
- func EndpointGetGuildOnboarding(guildid string) string
- func EndpointGetGuildPreview(guildid string) string
- func EndpointGetGuildPruneCount(guildid string) string
- func EndpointGetGuildRole(guildid, roleid string) string
- func EndpointGetGuildRoles(guildid string) string
- func EndpointGetGuildScheduledEvent(guildid, guildscheduledeventid string) string
- func EndpointGetGuildScheduledEventUsers(guildid, guildscheduledeventid string) string
- func EndpointGetGuildSoundboardSound(guildid, soundid string) string
- func EndpointGetGuildSticker(guildid, stickerid string) string
- func EndpointGetGuildTemplate(templatecode string) string
- func EndpointGetGuildTemplates(guildid string) string
- func EndpointGetGuildVanityURL(guildid string) string
- func EndpointGetGuildVoiceRegions(guildid string) string
- func EndpointGetGuildWebhooks(guildid string) string
- func EndpointGetGuildWelcomeScreen(guildid string) string
- func EndpointGetGuildWidget(guildid string) string
- func EndpointGetGuildWidgetImage(guildid string) string
- func EndpointGetGuildWidgetSettings(guildid string) string
- func EndpointGetInvite(invitecode string) string
- func EndpointGetOriginalInteractionResponse(applicationid, interactiontoken string) string
- func EndpointGetPinnedMessages(channelid string) string
- func EndpointGetReactions(channelid, messageid, emoji string) string
- func EndpointGetSKUSubscription(skuid, subscriptionid string) string
- func EndpointGetStageInstance(channelid string) string
- func EndpointGetSticker(stickerid string) string
- func EndpointGetStickerPack(packid string) string
- func EndpointGetThreadMember(channelid, userid string) string
- func EndpointGetUser(userid string) string
- func EndpointGetWebhook(webhookid string) string
- func EndpointGetWebhookMessage(webhookid, webhooktoken, messageid string) string
- func EndpointGetWebhookwithToken(webhookid, webhooktoken string) string
- func EndpointGroupDMAddRecipient(channelid, userid string) string
- func EndpointGroupDMRemoveRecipient(channelid, userid string) string
- func EndpointJoinThread(channelid string) string
- func EndpointLeaveGuild(guildid string) string
- func EndpointLeaveThread(channelid string) string
- func EndpointListActiveGuildThreads(guildid string) string
- func EndpointListApplicationEmojis(applicationid string) string
- func EndpointListAutoModerationRulesForGuild(guildid string) string
- func EndpointListDefaultSoundboardSounds() string
- func EndpointListEntitlements(applicationid string) string
- func EndpointListGuildEmojis(guildid string) string
- func EndpointListGuildMembers(guildid string) string
- func EndpointListGuildSoundboardSounds(guildid string) string
- func EndpointListGuildStickers(guildid string) string
- func EndpointListJoinedPrivateArchivedThreads(channelid string) string
- func EndpointListPrivateArchivedThreads(channelid string) string
- func EndpointListPublicArchivedThreads(channelid string) string
- func EndpointListSKUSubscriptions(skuid string) string
- func EndpointListSKUs(applicationid string) string
- func EndpointListScheduledEventsforGuild(guildid string) string
- func EndpointListStickerPacks() string
- func EndpointListThreadMembers(channelid string) string
- func EndpointListVoiceRegions() string
- func EndpointModifyApplicationEmoji(applicationid, emojiid string) string
- func EndpointModifyAutoModerationRule(guildid, automoderationruleid string) string
- func EndpointModifyChannel(channelid string) string
- func EndpointModifyCurrentMember(guildid string) string
- func EndpointModifyCurrentUser() string
- func EndpointModifyCurrentUserNick(guildid string) string
- func EndpointModifyCurrentUserVoiceState(guildid string) string
- func EndpointModifyGuild(guildid string) string
- func EndpointModifyGuildChannelPositions(guildid string) string
- func EndpointModifyGuildEmoji(guildid, emojiid string) string
- func EndpointModifyGuildMFALevel(guildid string) string
- func EndpointModifyGuildMember(guildid, userid string) string
- func EndpointModifyGuildOnboarding(guildid string) string
- func EndpointModifyGuildRole(guildid, roleid string) string
- func EndpointModifyGuildRolePositions(guildid string) string
- func EndpointModifyGuildScheduledEvent(guildid, guildscheduledeventid string) string
- func EndpointModifyGuildSoundboardSound(guildid, soundid string) string
- func EndpointModifyGuildSticker(guildid, stickerid string) string
- func EndpointModifyGuildTemplate(guildid, templatecode string) string
- func EndpointModifyGuildWelcomeScreen(guildid string) string
- func EndpointModifyGuildWidget(guildid string) string
- func EndpointModifyStageInstance(channelid string) string
- func EndpointModifyUserVoiceState(guildid, userid string) string
- func EndpointModifyWebhook(webhookid string) string
- func EndpointModifyWebhookwithToken(webhookid, webhooktoken string) string
- func EndpointPinMessage(channelid, messageid string) string
- func EndpointQueryString(dst any) (string, error)
- func EndpointRemoveGuildBan(guildid, userid string) string
- func EndpointRemoveGuildMember(guildid, userid string) string
- func EndpointRemoveGuildMemberRole(guildid, userid, roleid string) string
- func EndpointRemoveThreadMember(channelid, userid string) string
- func EndpointSearchGuildMembers(guildid string) string
- func EndpointSendSoundboardSound(channelid string) string
- func EndpointStartThreadfromMessage(channelid, messageid string) string
- func EndpointStartThreadinForumChannel(channelid string) string
- func EndpointStartThreadwithoutMessage(channelid string) string
- func EndpointSyncGuildTemplate(guildid, templatecode string) string
- func EndpointTokenRevocationURL() string
- func EndpointTokenURL() string
- func EndpointTriggerTypingIndicator(channelid string) string
- func EndpointUnpinMessage(channelid, messageid string) string
- func EndpointUpdateApplicationRoleConnectionMetadataRecords(applicationid string) string
- func EndpointUpdateCurrentUserApplicationRoleConnection(applicationid string) string
- func GenerateAuthorizationURL(bot *Client, response string) string
- func GenerateBotAuthorizationURL(p BotAuthParams) string
- func Hash(n int) hash
- func IsValue[T any](p *T) bool
- func IsValue2[T any](dp **T) bool
- func JSONCodeError(status int) error
- func LogCommand(log *zerolog.Event, clientid string, op int, command string) *zerolog.Event
- func LogCommandVoice(log *zerolog.Event, op int, command string) *zerolog.Event
- func LogEventHandler(log *zerolog.Event, clientid, event string) *zerolog.Event
- func LogPayload(log *zerolog.Event, op int, data json.RawMessage) *zerolog.Event
- func LogRequest(log *zerolog.Event, clientid, xid, routeid, resourceid, endpoint string) *zerolog.Event
- func LogRequestBody(log *zerolog.Event, clientid, xid, routeid, resourceid, endpoint, body string) *zerolog.Event
- func LogResponse(log *zerolog.Event, header, body string) *zerolog.Event
- func LogSession(log *zerolog.Event, sessionid string) *zerolog.Event
- func Pointer[T any](v T) *T
- func Pointer2[T any](v T, null ...bool) **T
- func SendRequest(bot *Client, xid, routeid, resourceid, method, uri string, ...) error
- func StatusCodeError(status int) string
- func WebhookAuthorization(bot *Client, ru *RedirectURL) (*AccessTokenResponse, *Webhook, error)
- type AccessTokenExchange
- type AccessTokenResponse
- func AdvancedBotAuthorization(bot *Client, ru *RedirectURL) (*AccessTokenResponse, error)
- func AuthorizationCodeGrant(bot *Client, ru *RedirectURL) (*AccessTokenResponse, error)
- func ClientCredentialsGrant(bot *Client) (*AccessTokenResponse, error)
- func ImplicitGrant(ru *RedirectURI) *AccessTokenResponse
- func RefreshAuthorizationCodeGrant(bot *Client, token *AccessTokenResponse) (*AccessTokenResponse, error)
- type ActionMetadata
- type ActionRow
- type Activity
- type ActivityAssetImage
- type ActivityAssets
- type ActivityEmoji
- type ActivityInstance
- type ActivityLocation
- type ActivityParty
- type ActivitySecrets
- type ActivityTimestamps
- type AddGuildMember
- type AddGuildMemberRole
- type AddThreadMember
- type AllowedMentions
- type Application
- type ApplicationCommand
- type ApplicationCommandData
- type ApplicationCommandInteractionDataOption
- type ApplicationCommandInteractionMetadata
- type ApplicationCommandOption
- type ApplicationCommandOptionChoice
- type ApplicationCommandPermissions
- type ApplicationCommandPermissionsUpdate
- type ApplicationIntegrationTypeConfiguration
- type ApplicationRoleConnection
- type ApplicationRoleConnectionMetadata
- type Attachment
- type AuditLog
- type AuditLogChange
- type AuditLogEntry
- type AuditLogOptions
- type Authentication
- type Authorization
- type AuthorizationURL
- type AutoModerationAction
- type AutoModerationActionExecution
- type AutoModerationRule
- type AutoModerationRuleCreate
- type AutoModerationRuleDelete
- type AutoModerationRuleUpdate
- type Autocomplete
- type AvatarDecorationData
- type Ban
- type BatchEditApplicationCommandPermissions
- type BeginGuildPrune
- type BitFlag
- type BotAuth
- type BotAuthParams
- type Bucket
- type BulkDeleteMessages
- type BulkOverwriteGlobalApplicationCommands
- type BulkOverwriteGuildApplicationCommands
- type Button
- type Channel
- type ChannelCreate
- type ChannelDelete
- type ChannelMention
- type ChannelPinsUpdate
- type ChannelUpdate
- type Client
- type ClientCredentialsAccessTokenResponse
- type ClientCredentialsTokenRequest
- type ClientDisconnect
- type ClientStatus
- type Component
- type Config
- type Connection
- type ConsumeEntitlement
- type CreateApplicationEmoji
- type CreateAutoModerationRule
- type CreateChannelInvite
- type CreateDM
- type CreateFollowupMessage
- type CreateGlobalApplicationCommand
- type CreateGroupDM
- type CreateGuild
- type CreateGuildApplicationCommand
- type CreateGuildBan
- type CreateGuildChannel
- type CreateGuildEmoji
- type CreateGuildRole
- type CreateGuildScheduledEvent
- type CreateGuildSoundboardSound
- type CreateGuildSticker
- type CreateGuildTemplate
- type CreateGuildfromGuildTemplate
- type CreateInteractionResponse
- type CreateMessage
- type CreateReaction
- type CreateStageInstance
- type CreateTestEntitlement
- type CreateWebhook
- type CrosspostMessage
- type CurrentAuthorizationInformationResponse
- type DefaultReaction
- type DeleteAllReactions
- type DeleteAllReactionsforEmoji
- type DeleteApplicationEmoji
- type DeleteAutoModerationRule
- type DeleteChannelPermission
- type DeleteCloseChannel
- type DeleteFollowupMessage
- type DeleteGlobalApplicationCommand
- type DeleteGuild
- type DeleteGuildApplicationCommand
- type DeleteGuildEmoji
- type DeleteGuildIntegration
- type DeleteGuildRole
- type DeleteGuildScheduledEvent
- type DeleteGuildSoundboardSound
- type DeleteGuildSticker
- type DeleteGuildTemplate
- type DeleteInvite
- type DeleteMessage
- type DeleteOriginalInteractionResponse
- type DeleteOwnReaction
- type DeleteStageInstance
- type DeleteTestEntitlement
- type DeleteUserReaction
- type DeleteWebhook
- type DeleteWebhookMessage
- type DeleteWebhookwithToken
- type EditApplicationCommandPermissions
- type EditChannelPermissions
- type EditCurrentApplication
- type EditFollowupMessage
- type EditGlobalApplicationCommand
- type EditGuildApplicationCommand
- type EditMessage
- type EditOriginalInteractionResponse
- type EditWebhookMessage
- type Embed
- type EmbedAuthor
- type EmbedField
- type EmbedFooter
- type EmbedImage
- type EmbedProvider
- type EmbedThumbnail
- type EmbedVideo
- type Emoji
- type EndPoll
- type Entitlement
- type EntitlementCreate
- type EntitlementDelete
- type EntitlementUpdate
- type ErrorEvent
- type ErrorEventHandler
- type ErrorRequest
- type ErrorSession
- type ErrorSessionDisconnect
- type ErrorStatusCode
- type Event
- type ExecuteGitHubCompatibleWebhook
- type ExecuteSlackCompatibleWebhook
- type ExecuteWebhook
- type ExtendedBotAuthorizationAccessTokenResponse
- type File
- type Flag
- type Flags
- type FollowAnnouncementChannel
- type FollowedChannel
- type ForumAndMediaThreadMessageParams
- type ForumTag
- type Gateway
- type GatewayCloseEventCode
- type GatewayPayload
- type GatewayPresenceUpdate
- type GatewayURLQueryString
- type GatewayVoiceStateUpdate
- type GetAnswerVoters
- type GetAnswerVotersResponse
- type GetApplicationActivityInstance
- type GetApplicationCommandPermissions
- type GetApplicationEmoji
- type GetApplicationRoleConnectionMetadataRecords
- type GetAutoModerationRule
- type GetChannel
- type GetChannelInvites
- type GetChannelMessage
- type GetChannelMessages
- type GetChannelWebhooks
- type GetCurrentApplication
- type GetCurrentAuthorizationInformation
- type GetCurrentBotApplicationInformation
- type GetCurrentUser
- type GetCurrentUserApplicationRoleConnection
- type GetCurrentUserConnections
- type GetCurrentUserGuildMember
- type GetCurrentUserGuilds
- type GetEntitlement
- type GetFollowupMessage
- type GetGateway
- type GetGatewayBot
- type GetGatewayBotResponse
- type GetGatewayResponse
- type GetGlobalApplicationCommand
- type GetGlobalApplicationCommands
- type GetGuild
- type GetGuildApplicationCommand
- type GetGuildApplicationCommandPermissions
- type GetGuildApplicationCommands
- type GetGuildAuditLog
- type GetGuildBan
- type GetGuildBans
- type GetGuildChannels
- type GetGuildEmoji
- type GetGuildIntegrations
- type GetGuildInvites
- type GetGuildMember
- type GetGuildOnboarding
- type GetGuildPreview
- type GetGuildPruneCount
- type GetGuildPruneCountResponse
- type GetGuildRole
- type GetGuildRoles
- type GetGuildScheduledEvent
- type GetGuildScheduledEventUsers
- type GetGuildSoundboardSound
- type GetGuildSticker
- type GetGuildTemplate
- type GetGuildTemplates
- type GetGuildVanityURL
- type GetGuildVoiceRegions
- type GetGuildWebhooks
- type GetGuildWelcomeScreen
- type GetGuildWidget
- type GetGuildWidgetImage
- type GetGuildWidgetSettings
- type GetInvite
- type GetOriginalInteractionResponse
- type GetPinnedMessages
- type GetReactions
- type GetSKUSubscription
- type GetStageInstance
- type GetSticker
- type GetStickerPack
- type GetThreadMember
- type GetUser
- type GetWebhook
- type GetWebhookMessage
- type GetWebhookwithToken
- type GroupDMAddRecipient
- type GroupDMRemoveRecipient
- type Guild
- type GuildApplicationCommandPermissions
- type GuildAuditLogEntryCreate
- type GuildBanAdd
- type GuildBanRemove
- type GuildCreate
- type GuildDelete
- type GuildEmojisUpdate
- type GuildIntegrationsUpdate
- type GuildMember
- type GuildMemberAdd
- type GuildMemberRemove
- type GuildMemberUpdate
- type GuildMembersChunk
- type GuildOnboarding
- type GuildPreview
- type GuildRoleCreate
- type GuildRoleDelete
- type GuildRoleUpdate
- type GuildScheduledEvent
- type GuildScheduledEventCreate
- type GuildScheduledEventDelete
- type GuildScheduledEventEntityMetadata
- type GuildScheduledEventRecurrenceRule
- type GuildScheduledEventRecurrenceRuleNWeekday
- type GuildScheduledEventUpdate
- type GuildScheduledEventUser
- type GuildScheduledEventUserAdd
- type GuildScheduledEventUserRemove
- type GuildSoundboardSoundCreate
- type GuildSoundboardSoundDelete
- type GuildSoundboardSoundUpdate
- type GuildSoundboardSoundsUpdate
- type GuildStickersUpdate
- type GuildTemplate
- type GuildUpdate
- type GuildWidget
- type GuildWidgetSettings
- type Handlers
- type Heartbeat
- type Hello
- type Identify
- type IdentifyConnectionProperties
- type InstallParams
- type Integration
- type IntegrationAccount
- type IntegrationApplication
- type IntegrationCreate
- type IntegrationDelete
- type IntegrationUpdate
- type Interaction
- type InteractionCallbackData
- type InteractionCreate
- type InteractionData
- type InteractionResponse
- type InvalidSession
- type Invite
- type InviteCreate
- type InviteDelete
- type InviteMetadata
- type JoinThread
- type LeaveGuild
- type LeaveThread
- type ListActiveGuildThreads
- type ListActiveGuildThreadsResponse
- type ListApplicationEmojis
- type ListApplicationEmojisResponse
- type ListAutoModerationRulesForGuild
- type ListDefaultSoundboardSounds
- type ListEntitlements
- type ListGuildEmojis
- type ListGuildMembers
- type ListGuildSoundboardSounds
- type ListGuildSoundboardSoundsResponse
- type ListGuildStickers
- type ListJoinedPrivateArchivedThreads
- type ListJoinedPrivateArchivedThreadsResponse
- type ListPrivateArchivedThreads
- type ListPrivateArchivedThreadsResponse
- type ListPublicArchivedThreads
- type ListPublicArchivedThreadsResponse
- type ListSKUSubscriptions
- type ListSKUs
- type ListScheduledEventsforGuild
- type ListStickerPacks
- type ListStickerPacksResponse
- type ListThreadMembers
- type ListVoiceRegions
- type Message
- type MessageActivity
- type MessageCall
- type MessageComponentData
- type MessageComponentInteractionMetadata
- type MessageCreate
- type MessageDelete
- type MessageDeleteBulk
- type MessageInteraction
- type MessageInteractionMetadata
- type MessagePollVoteAdd
- type MessagePollVoteRemove
- type MessageReactionAdd
- type MessageReactionRemove
- type MessageReactionRemoveAll
- type MessageReactionRemoveEmoji
- type MessageReference
- type MessageSnapshot
- type MessageUpdate
- type Messages
- type Modal
- type ModalSubmitData
- type ModalSubmitInteractionMetadata
- type ModifyApplicationEmoji
- type ModifyAutoModerationRule
- type ModifyChannel
- type ModifyChannelGroupDM
- type ModifyChannelGuild
- type ModifyChannelThread
- type ModifyCurrentMember
- type ModifyCurrentUser
- type ModifyCurrentUserVoiceState
- type ModifyGuild
- type ModifyGuildChannelPositionParameters
- type ModifyGuildChannelPositions
- type ModifyGuildEmoji
- type ModifyGuildMFALevel
- type ModifyGuildMFALevelResponse
- type ModifyGuildMember
- type ModifyGuildOnboarding
- type ModifyGuildRole
- type ModifyGuildRolePositionParameters
- type ModifyGuildRolePositions
- type ModifyGuildScheduledEvent
- type ModifyGuildSoundboardSound
- type ModifyGuildSticker
- type ModifyGuildTemplate
- type ModifyGuildWelcomeScreen
- type ModifyGuildWidget
- type ModifyStageInstance
- type ModifyUserVoiceState
- type ModifyWebhook
- type ModifyWebhookwithToken
- type Nonce
- type OnboardingPrompt
- type PermissionOverwrite
- type PinMessage
- type PointerIndicator
- type Poll
- type PollAnswer
- type PollAnswerCount
- type PollCreateRequest
- type PollMedia
- type PollResults
- type PresenceUpdate
- type PromptOption
- type RateLimit
- func (r *RateLimit) EndTx()
- func (r *RateLimit) GetBucket(routeid string, resourceid string) *Bucket
- func (r *RateLimit) GetBucketFromID(bucketid string) *Bucket
- func (r *RateLimit) GetBucketID(routeid string) string
- func (r *RateLimit) Lock()
- func (r *RateLimit) SetBucket(routeid string, bucket *Bucket)
- func (r *RateLimit) SetBucketFromID(bucketid string, bucket *Bucket)
- func (r *RateLimit) SetBucketID(routeid string, bucketid string)
- func (r *RateLimit) SetDefaultBucket(bucket *Bucket)
- func (r *RateLimit) StartTx()
- func (r *RateLimit) Unlock()
- type RateLimitHeader
- type RateLimitResponse
- type RateLimiter
- type Reaction
- type ReactionCountDetails
- type Ready
- type Reconnect
- type RedirectURI
- type RedirectURL
- type RefreshTokenExchange
- type RemoveGuildBan
- type RemoveGuildMember
- type RemoveGuildMemberRole
- type RemoveThreadMember
- type Request
- type RequestGuildMembers
- type RequestSoundboardSounds
- type ResolvedData
- type Resume
- type Resumed
- type Role
- type RoleSubscriptionData
- type RoleTags
- type SKU
- type SearchGuildMembers
- type SelectDefaultValue
- type SelectMenu
- func (c SelectMenu) ComponentType() Flag
- func (c SelectMenu) ComponentTypeChannelSelect() Flag
- func (c SelectMenu) ComponentTypeMentionableSelect() Flag
- func (c SelectMenu) ComponentTypeRoleSelect() Flag
- func (c SelectMenu) ComponentTypeUserSelect() Flag
- func (c SelectMenu) FlagComponentTypeStringSelect() Flag
- type SelectMenuOption
- type SelectProtocol
- type SelectProtocolData
- type SendSoundboardSound
- type Session
- type SessionDescription
- type SessionManager
- type SessionStartLimit
- type ShardLimit
- type ShardManager
- type SoundboardSound
- type SoundboardSounds
- type Speaking
- type StageInstance
- type StageInstanceCreate
- type StageInstanceDelete
- type StageInstanceUpdate
- type StartThreadfromMessage
- type StartThreadinForumChannel
- type StartThreadwithoutMessage
- type Sticker
- type StickerItem
- type StickerPack
- type Subscription
- type SubscriptionCreate
- type SubscriptionDelete
- type SubscriptionUpdate
- type SyncGuildTemplate
- type Team
- type TeamMember
- type TextInput
- type ThreadCreate
- type ThreadDelete
- type ThreadListSync
- type ThreadMember
- type ThreadMemberUpdate
- type ThreadMembersUpdate
- type ThreadMetadata
- type ThreadUpdate
- type TriggerMetadata
- type TriggerTypingIndicator
- type TypingStart
- type UnpinMessage
- type UpdateApplicationRoleConnectionMetadataRecords
- type UpdateCurrentUserApplicationRoleConnection
- type User
- type UserUpdate
- type Value
- type VoiceChannelConnection
- type VoiceChannelEffectSend
- type VoiceCloseEventCode
- type VoiceHandlers
- type VoiceHeartbeat
- type VoiceHeartbeatACK
- type VoiceHello
- type VoiceIdentify
- type VoicePacket
- type VoicePayload
- type VoiceReady
- type VoiceRegion
- type VoiceResume
- type VoiceResumed
- type VoiceServerUpdate
- type VoiceSession
- type VoiceState
- type VoiceStateUpdate
- type Webhook
- type WebhookTokenResponse
- type WebhooksUpdate
- type WelcomeScreen
- type WelcomeScreenChannel
Constants ¶
const ( FlagGatewayOpcodeDispatch = 0 FlagGatewayOpcodeHeartbeat = 1 FlagGatewayOpcodeIdentify = 2 FlagGatewayOpcodePresenceUpdate = 3 FlagGatewayOpcodeVoiceStateUpdate = 4 FlagGatewayOpcodeResume = 6 FlagGatewayOpcodeReconnect = 7 FlagGatewayOpcodeRequestGuildMembers = 8 FlagGatewayOpcodeInvalidSession = 9 FlagGatewayOpcodeHello = 10 FlagGatewayOpcodeHeartbeatACK = 11 FlagGatewayOpcodeRequestSoundboardSounds = 31 )
Gateway Opcodes https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
const ( FlagVoiceOpcodeIdentify = 0 FlagVoiceOpcodeSelectProtocol = 1 FlagVoiceOpcodeReadyServer = 2 FlagVoiceOpcodeHeartbeat = 3 FlagVoiceOpcodeSessionDescription = 4 FlagVoiceOpcodeSpeaking = 5 FlagVoiceOpcodeHeartbeatACK = 6 FlagVoiceOpcodeResume = 7 FlagVoiceOpcodeHello = 8 FlagVoiceOpcodeResumed = 9 FlagVoiceOpcodeClientsConnect = 11 FlagVoiceOpcodeClientDisconnect = 13 FlagVoiceOpcodeDAVEPrepareTransition = 21 FlagVoiceOpcodeDAVEExecuteTransition = 22 FlagVoiceOpcodeDAVETransitionReady = 23 FlagVoiceOpcodeDAVEPrepareEpoch = 24 FlagVoiceOpcodeDAVEMLSExternalSender = 25 FlagVoiceOpcodeDAVEMLSKeyPackage = 26 FlagVoiceOpcodeDAVEMLSProposals = 27 FlagVoiceOpcodeDAVEMLSCommitWelcome = 28 FlagVoiceOpcodeDAVEMLSAnnounceCommitTransition = 29 FlagVoiceOpcodeDAVEMLSWelcome = 30 FlagVoiceOpcodeDAVEMLSInvalidCommitWelcome = 31 )
Voice Opcodes https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes
const ( FlagHTTPResponseCodeOK = 200 FlagHTTPResponseCodeCREATED = 201 FlagHTTPResponseCodeNOCONTENT = 204 FlagHTTPResponseCodeNOTMODIFIED = 304 FlagHTTPResponseCodeBADREQUEST = 400 FlagHTTPResponseCodeUNAUTHORIZED = 401 FlagHTTPResponseCodeFORBIDDEN = 403 FlagHTTPResponseCodeNOTFOUND = 404 FlagHTTPResponseCodeMETHODNOTALLOWED = 405 FlagHTTPResponseCodeTOOMANYREQUESTS = 429 FlagHTTPResponseCodeGATEWAYUNAVAILABLE = 502 FlagHTTPResponseCodeSERVERERROR = 500 // 5xx (500 Not Guaranteed) )
HTTP Response Codes https://discord.com/developers/docs/topics/opcodes-and-status-codes#http-http-response-codes
const ( FlagRPCErrorCodeUnknownError = 1000 FlagRPCErrorCodeInvalidPayload = 4000 FlagRPCErrorCodeInvalidCommand = 4002 FlagRPCErrorCodeInvalidGuild = 4003 FlagRPCErrorCodeInvalidEvent = 4004 FlagRPCErrorCodeInvalidChannel = 4005 FlagRPCErrorCodeInvalidPermissions = 4006 FlagRPCErrorCodeInvalidClientID = 4007 FlagRPCErrorCodeInvalidOrigin = 4008 FlagRPCErrorCodeInvalidToken = 4009 FlagRPCErrorCodeInvalidUser = 4010 FlagRPCErrorCodeOAuth2Error = 5000 FlagRPCErrorCodeSelectChannelTimedOut = 5001 FlagRPCErrorCodeGET_GUILDTimedOut = 5002 FlagRPCErrorCodeSelectVoiceForceRequired = 5003 FlagRPCErrorCodeCaptureShortcutAlreadyListening = 5004 )
RPC Error Codes https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes
const ( FlagRPCCloseEventCodeInvalidClientID = 4000 FlagRPCCloseEventCodeInvalidOrigin = 4001 FlagRPCCloseEventCodeRateLimited = 4002 FlagRPCCloseEventCodeTokenRevoked = 4003 FlagRPCCloseEventCodeInvalidVersion = 4004 FlagRPCCloseEventCodeInvalidEncoding = 4005 )
RPC Close Event Codes https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-close-event-codes
const ( FlagGatewaySendEventNameHeartbeat = "Heartbeat" FlagGatewaySendEventNameIdentify = "Identify" FlagGatewaySendEventNameUpdatePresence = "UpdatePresence" FlagGatewaySendEventNameUpdateVoiceState = "UpdateVoiceState " FlagGatewaySendEventNameResume = "Resume" FlagGatewaySendEventNameRequestGuildMembers = "RequestGuildMembers" FlagGatewaySendEventNameRequestSoundboardSounds = "RequestSoundboardSounds" )
Gateway SendEvent Names https://discord.com/developers/docs/topics/gateway-events#send-events
const ( FlagStatusTypeOnline = "online" FlagStatusTypeDoNotDisturb = "dnd" FlagStatusTypeAFK = "idle" FlagStatusTypeInvisible = "invisible" FlagStatusTypeOffline = "offline" )
Status Types https://discord.com/developers/docs/topics/gateway#update-presence-status-types
const ( FlagGatewayEventNameHello = "HELLO" FlagGatewayEventNameReady = "READY" FlagGatewayEventNameResumed = "RESUMED" FlagGatewayEventNameReconnect = "RECONNECT" FlagGatewayEventNameInvalidSession = "INVALID_SESSION" FlagGatewayEventNameApplicationCommandPermissionsUpdate = "APPLICATION_COMMAND_PERMISSIONS_UPDATE" FlagGatewayEventNameAutoModerationRuleCreate = "AUTO_MODERATION_RULE_CREATE" FlagGatewayEventNameAutoModerationRuleUpdate = "AUTO_MODERATION_RULE_UPDATE" FlagGatewayEventNameAutoModerationRuleDelete = "AUTO_MODERATION_RULE_DELETE" FlagGatewayEventNameAutoModerationActionExecution = "AUTO_MODERATION_ACTION_EXECUTION" FlagGatewayEventNameChannelCreate = "CHANNEL_CREATE" FlagGatewayEventNameChannelUpdate = "CHANNEL_UPDATE" FlagGatewayEventNameChannelDelete = "CHANNEL_DELETE" FlagGatewayEventNameChannelPinsUpdate = "CHANNEL_PINS_UPDATE" FlagGatewayEventNameThreadCreate = "THREAD_CREATE" FlagGatewayEventNameThreadUpdate = "THREAD_UPDATE" FlagGatewayEventNameThreadDelete = "THREAD_DELETE" FlagGatewayEventNameThreadListSync = "THREAD_LIST_SYNC" FlagGatewayEventNameThreadMemberUpdate = "THREAD_MEMBER_UPDATE" FlagGatewayEventNameThreadMembersUpdate = "THREAD_MEMBERS_UPDATE" FlagGatewayEventNameEntitlementCreate = "ENTITLEMENT_CREATE" FlagGatewayEventNameEntitlementUpdate = "ENTITLEMENT_UPDATE" FlagGatewayEventNameEntitlementDelete = "ENTITLEMENT_DELETE" FlagGatewayEventNameGuildCreate = "GUILD_CREATE" FlagGatewayEventNameGuildUpdate = "GUILD_UPDATE" FlagGatewayEventNameGuildDelete = "GUILD_DELETE" FlagGatewayEventNameGuildAuditLogEntryCreate = "GUILD_AUDIT_LOG_ENTRY_CREATE" FlagGatewayEventNameGuildBanAdd = "GUILD_BAN_ADD" FlagGatewayEventNameGuildBanRemove = "GUILD_BAN_REMOVE" FlagGatewayEventNameGuildEmojisUpdate = "GUILD_EMOJIS_UPDATE" FlagGatewayEventNameGuildStickersUpdate = "GUILD_STICKERS_UPDATE" FlagGatewayEventNameGuildIntegrationsUpdate = "GUILD_INTEGRATIONS_UPDATE" FlagGatewayEventNameGuildMemberAdd = "GUILD_MEMBER_ADD" FlagGatewayEventNameGuildMemberRemove = "GUILD_MEMBER_REMOVE" FlagGatewayEventNameGuildMemberUpdate = "GUILD_MEMBER_UPDATE" FlagGatewayEventNameGuildMembersChunk = "GUILD_MEMBERS_CHUNK" FlagGatewayEventNameGuildRoleCreate = "GUILD_ROLE_CREATE" FlagGatewayEventNameGuildRoleUpdate = "GUILD_ROLE_UPDATE" FlagGatewayEventNameGuildRoleDelete = "GUILD_ROLE_DELETE" FlagGatewayEventNameGuildScheduledEventCreate = "GUILD_SCHEDULED_EVENT_CREATE" FlagGatewayEventNameGuildScheduledEventUpdate = "GUILD_SCHEDULED_EVENT_UPDATE" FlagGatewayEventNameGuildScheduledEventDelete = "GUILD_SCHEDULED_EVENT_DELETE" FlagGatewayEventNameGuildScheduledEventUserAdd = "GUILD_SCHEDULED_EVENT_USER_ADD" FlagGatewayEventNameGuildScheduledEventUserRemove = "GUILD_SCHEDULED_EVENT_USER_REMOVE" FlagGatewayEventNameGuildSoundboardSoundCreate = "GUILD_SOUNDBOARD_SOUND_CREATE" FlagGatewayEventNameGuildSoundboardSoundUpdate = "GUILD_SOUNDBOARD_SOUND_UPDATE" FlagGatewayEventNameGuildSoundboardSoundDelete = "GUILD_SOUNDBOARD_SOUND_DELETE" FlagGatewayEventNameGuildSoundboardSoundsUpdate = "GUILD_SOUNDBOARD_SOUNDS_UPDATE" FlagGatewayEventNameSoundboardSounds = "SOUNDBOARD_SOUNDS" FlagGatewayEventNameIntegrationCreate = "INTEGRATION_CREATE" FlagGatewayEventNameIntegrationUpdate = "INTEGRATION_UPDATE" FlagGatewayEventNameIntegrationDelete = "INTEGRATION_DELETE" FlagGatewayEventNameInteractionCreate = "INTERACTION_CREATE" FlagGatewayEventNameInviteCreate = "INVITE_CREATE" FlagGatewayEventNameInviteDelete = "INVITE_DELETE" FlagGatewayEventNameMessageCreate = "MESSAGE_CREATE" FlagGatewayEventNameMessageUpdate = "MESSAGE_UPDATE" FlagGatewayEventNameMessageDelete = "MESSAGE_DELETE" FlagGatewayEventNameMessageDeleteBulk = "MESSAGE_DELETE_BULK" FlagGatewayEventNameMessageReactionAdd = "MESSAGE_REACTION_ADD" FlagGatewayEventNameMessageReactionRemove = "MESSAGE_REACTION_REMOVE" FlagGatewayEventNameMessageReactionRemoveAll = "MESSAGE_REACTION_REMOVE_ALL" FlagGatewayEventNameMessageReactionRemoveEmoji = "MESSAGE_REACTION_REMOVE_EMOJI" FlagGatewayEventNamePresenceUpdate = "PRESENCE_UPDATE" FlagGatewayEventNameStageInstanceCreate = "STAGE_INSTANCE_CREATE" FlagGatewayEventNameStageInstanceDelete = "STAGE_INSTANCE_DELETE" FlagGatewayEventNameStageInstanceUpdate = "STAGE_INSTANCE_UPDATE" FlagGatewayEventNameSubscriptionCreate = "SUBSCRIPTION_CREATE" FlagGatewayEventNameSubscriptionUpdate = "SUBSCRIPTION_UPDATE" FlagGatewayEventNameSubscriptionDelete = "SUBSCRIPTION_DELETE" FlagGatewayEventNameTypingStart = "TYPING_START" FlagGatewayEventNameUserUpdate = "USER_UPDATE" FlagGatewayEventNameVoiceChannelEffectSend = "VOICE_CHANNEL_EFFECT_SEND" FlagGatewayEventNameVoiceStateUpdate = "VOICE_STATE_UPDATE" FlagGatewayEventNameVoiceServerUpdate = "VOICE_SERVER_UPDATE" FlagGatewayEventNameWebhooksUpdate = "WEBHOOKS_UPDATE" FlagGatewayEventNameMessagePollVoteAdd = "MESSAGE_POLL_VOTE_ADD" FlagGatewayEventNameMessagePollVoteRemove = "MESSAGE_POLL_VOTE_REMOVE" )
Gateway Event Names https://discord.com/developers/docs/topics/gateway-events
const ( FlagRateLimitHeaderDate = "Date" FlagRateLimitHeaderLimit = "X-RateLimit-Limit" FlagRateLimitHeaderRemaining = "X-RateLimit-Remaining" FlagRateLimitHeaderReset = "X-RateLimit-Reset" FlagRateLimitHeaderResetAfter = "X-RateLimit-Reset-After" FlagRateLimitHeaderBucket = "X-RateLimit-Bucket" FlagRateLimitHeaderGlobal = "X-RateLimit-Global" FlagRateLimitHeaderScope = "X-RateLimit-Scope" FlagRateLimitHeaderRetryAfter = "Retry-After" )
Rate Limit Headers https://discord.com/developers/docs/topics/rate-limits#header-format-rate-limit-header-examples
const ( RateLimitScopeValueUser = "user" RateLimitScopeValueGlobal = "global" )
Rate Limit Scope Values https://discord.com/developers/docs/topics/rate-limits#header-format-rate-limit-header-examples
const ( // Global Rate Limit (Requests): 50 requests per second. FlagGlobalRateLimitRequest = 50 // Global Rate Limit (Gateway): 120 commands per minute. FlagGlobalRateLimitGateway = 120 FlagGlobalRateLimitGatewayInterval = time.Minute // Global Rate Limit (Identify Command): Get Gateway Bot `max_concurrency + 1` per 5 Seconds. FlagGlobalRateLimitIdentifyInterval = time.Second * 5 // Global Rate Limit (Identify Command): 1000 per day. FlagGlobalRateLimitIdentifyDaily = 1000 FlagGlobalRateLimitIdentifyDailyInterval = time.Hour * 24 )
Global Rate Limits https://discord.com/developers/docs/topics/rate-limits#global-rate-limit
const ( VersionDiscordAPI = "10" VersionDiscordVoiceGateway = "7" )
Version https://discord.com/developers/docs/reference#api-versioning
const ( ImageFormatJPEG = "JPEG" ImageFormatPNG = "PNG" ImageFormatWebP = "WebP" ImageFormatGIF = "GIF" ImageFormatLottie = "Lottie" )
Image Formats https://discord.com/developers/docs/reference#image-formatting-image-formats
const ( CDNEndpointAnimatedHashPrefix = "a_" CDNEndpointUserDiscriminatorDivisor = 5 )
CDN Endpoint Exceptions https://discord.com/developers/docs/reference#image-formatting-cdn-endpoints
const ( FlagLocalesDanish = "da" FlagLocalesGerman = "de" FlagLocalesEnglishUK = "en-GB" FlagLocalesEnglishUS = "en-US" FlagLocalesSpanish = "es-ES" FlagLocalesFrench = "fr" FlagLocalesCroatian = "hr" FlagLocalesIndonesian = "id" FlagLocalesItalian = "it" FlagLocalesLithuanian = "lt" FlagLocalesHungarian = "hu" FlagLocalesDutch = "nl" FlagLocalesNorwegian = "no" FlagLocalesPolish = "pl" FlagLocalesPortugueseBrazilian = "pt-BR" FlagLocalesRomanian = "ro" FlagLocalesFinnish = "fi" FlagLocalesSwedish = "sv-SE" FlagLocalesVietnamese = "vi" FlagLocalesTurkish = "tr" FlagLocalesCzech = "cs" FlagLocalesGreek = "el" FlagLocalesBulgarian = "bg" FlagLocalesRussian = "ru" FlagLocalesUkrainian = "uk" FlagLocalesHindi = "hi" FlagLocalesThai = "th" FlagLocalesChineseChina = "zh-CN" FlagLocalesJapanese = "ja" FlagLocalesChineseTaiwan = "zh-TW" FlagLocalesKorean = "ko" )
Locales https://discord.com/developers/docs/reference#locales
const ( FlagWidgetStyleOptionShield = "shield" FlagWidgetStyleOptionBanner1 = "banner1" FlagWidgetStyleOptionBanner2 = "banner2" FlagWidgetStyleOptionBanner3 = "banner3" FlagWidgetStyleOptionBanner4 = "banner4" )
Widget Style Options https://discord.com/developers/docs/resources/guild#get-guild-widget-image-widget-style-options
const ( FlagEmbedLimitTitle = 256 FlagEmbedLimitDescription = 4096 FlagEmbedLimitFields = 25 FlagEmbedLimitFieldName = 256 FlagEmbedLimitFieldValue = 1024 FlagEmbedLimitAuthorName = 256 )
Embed Limits https://discord.com/developers/docs/resources/channel#embed-object-embed-limits
const ( FlagAllowedMentionTypeRoles = "roles" FlagAllowedMentionTypeUsers = "users" FlagAllowedMentionTypeEveryone = "everyone" )
Allowed Mention Types https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mentions-structure
const ( FlagReactionTypeNORMAL = 0 FlagReactionTypeBURST = 1 )
Reaction Types https://discord.com/developers/docs/resources/message#get-reactions-reaction-types
const ( FlagGuildFeatureANIMATED_BANNER = "ANIMATED_BANNER" FlagGuildFeatureANIMATED_ICON = "ANIMATED_ICON" FlagGuildFeatureAPPLICATION_COMMAND_PERMISSIONS_V2 = "APPLICATION_COMMAND_PERMISSIONS_V2" FlagGuildFeatureAUTO_MODERATION = "AUTO_MODERATION" FlagGuildFeatureBANNER = "BANNER" FlagGuildFeatureCOMMUNITY = "COMMUNITY" FlagGuildFeatureCREATOR_MONETIZABLE_PROVISIONAL = "CREATOR_MONETIZABLE_PROVISIONAL" FlagGuildFeatureCREATOR_STORE_PAGE = "CREATOR_STORE_PAGE" FlagGuildFeatureDEVELOPER_SUPPORT_SERVER = "DEVELOPER_SUPPORT_SERVER" FlagGuildFeatureDISCOVERABLE = "DISCOVERABLE" FlagGuildFeatureFEATURABLE = "FEATURABLE" FlagGuildFeatureINVITES_DISABLED = "INVITES_DISABLED" FlagGuildFeatureINVITE_SPLASH = "INVITE_SPLASH" FlagGuildFeatureMEMBER_VERIFICATION_GATE_ENABLED = "MEMBER_VERIFICATION_GATE_ENABLED" FlagGuildFeatureMORE_STICKERS = "MORE_STICKERS" FlagGuildFeatureNEWS = "NEWS" FlagGuildFeaturePARTNERED = "PARTNERED" FlagGuildFeaturePREVIEW_ENABLED = "PREVIEW_ENABLED" FlagGuildFeatureRAID_ALERTS_DISABLED = "RAID_ALERTS_DISABLED" FlagGuildFeatureROLE_ICONS = "ROLE_ICONS" FlagGuildFeatureROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE = "ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE" FlagGuildFeatureROLE_SUBSCRIPTIONS_ENABLED = "ROLE_SUBSCRIPTIONS_ENABLED" FlagGuildFeatureTICKETED_EVENTS_ENABLED = "TICKETED_EVENTS_ENABLED" FlagGuildFeatureVANITY_URL = "VANITY_URL" FlagGuildFeatureVERIFIED = "VERIFIED" FlagGuildFeatureVIP_REGIONS = "VIP_REGIONS" FlagGuildFeatureWELCOME_SCREEN_ENABLED = "WELCOME_SCREEN_ENABLED" )
Guild Features https://discord.com/developers/docs/resources/guild#guild-object-guild-features
const ( FlagPromptTypeMULTIPLE_CHOICE = 0 FlagPromptTypeDROPDOWN = 1 )
Prompt Types https://discord.com/developers/docs/resources/guild#guild-onboarding-object-prompt-types
const ( FlagTeamMemberRoleTypeOwner = "" FlagTeamMemberRoleTypeAdmin = "admin" FlagTeamMemberRoleTypeDeveloper = "developer" FlagTeamMemberRoleTypeReadOnly = "read_only" )
Team Member Role Types https://discord.com/developers/docs/topics/teams#team-member-roles-team-member-role-types
const ( FlagOAuth2ScopeActivitiesRead = "activities.read" FlagOAuth2ScopeActivitiesWrite = "activities.write" FlagOAuth2ScopeApplicationsBuildsRead = "applications.builds.read" FlagOAuth2ScopeApplicationsBuildsUpload = "applications.builds.upload" FlagOAuth2ScopeApplicationsCommands = "applications.commands" FlagOAuth2ScopeApplicationsCommandsUpdate = "applications.commands.update" FlagOAuth2ScopeApplicationsCommandsPermissionsUpdate = "applications.commands.permissions.update" FlagOAuth2ScopeApplicationsEntitlements = "applications.entitlements" FlagOAuth2ScopeApplicationsStoreUpdate = "applications.store.update" FlagOAuth2ScopeBot = "bot" FlagOAuth2ScopeConnections = "connections" FlagOAuth2ScopeDM_channelsRead = "dm_channels.read" FlagOAuth2ScopeEmail = "email" FlagOAuth2ScopeGDMJoin = "gdm.join" FlagOAuth2ScopeGuilds = "guilds" FlagOAuth2ScopeGuildsJoin = "guilds.join" FlagOAuth2ScopeGuildsMembersRead = "guilds.members.read" FlagOAuth2ScopeIdentify = "identify" FlagOAuth2ScopeMessagesRead = "messages.read" FlagOAuth2ScopeRelationshipsRead = "relationships.read" FlagOAuth2ScopeRoleConnectionsWrite = "role_connections.write" FlagOAuth2ScopeRPC = "rpc" FlagOAuth2ScopeRPCActivitiesWrite = "rpc.activities.write" FlagOAuth2ScopeRPCNotificationsRead = "rpc.notifications.read" FlagOAuth2ScopeRPCVoiceRead = "rpc.voice.read" FlagOAuth2ScopeRPCVoiceWrite = "rpc.voice.write" FlagOAuth2ScopeVoice = "voice" FlagOAuth2ScopeWebhookIncoming = "webhook.incoming" )
OAuth2 Scopes https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes
const ( FlagVoiceOpcodeNameIdentify = "IDENTIFY" FlagVoiceOpcodeNameSelectProtocol = "SELECT_PROTOCOL" FlagVoiceOpcodeNameReady = "READY" FlagVoiceOpcodeNameHeartbeat = "HEARTBEAT" FlagVoiceOpcodeNameSessionDescription = "SESSION_DESCRIPTION" FlagVoiceOpcodeNameSpeaking = "SPEAKING" FlagVoiceOpcodeNameResume = "RESUME" FlagVoiceOpcodeNameHello = "HELLO" FlagVoiceOpcodeNameResumed = "RESUMED" FlagVoiceOpcodeNameClientDisconnect = "CLIENT_DISCONNECT" )
Voice Server Opcode (Event) Names https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes
const ( FlagVoiceSendEventNameIdentify = "Identify" FlagVoiceSendEventNameSelectProtocol = "SelectProtocol " FlagVoiceSendEventNameHeartbeat = "Heartbeat" FlagVoiceSendEventNameSpeaking = "Speaking" FlagVoiceSendEventNameResume = "Resume" )
Voice Server SendEvent Names https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes
const ( FlagVoiceEncryptionModeAES256 = "aead_aes256_gcm_rtpsize" FlagVoiceEncryptionModeXChaCha20 = "aead_xchacha20_poly1305_rtpsize" )
Voice Connection Encryption Modes https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-udp-connection-encryption-modes
const ( EndpointBaseURL = "https://discord.com/api/v" + VersionDiscordAPI + "/" CDNEndpointBaseURL = "https://cdn.discordapp.com/" )
Discord API Endpoints
const ( ErrorEventActionUnmarshal = "unmarshalling" ErrorEventActionMarshal = "marshalling" ErrorEventActionRead = "reading" ErrorEventActionWrite = "writing" )
const ( ErrorSessionTypeGateway = "Discord Gateway" ErrorSessionTypeVoice = "Discord Voice" )
const ( // LogCtxClient represents the log key for a Client (Bot) Application ID. LogCtxClient = "client" // LogCtxCorrelation represents the log key for a Correlation ID. LogCtxCorrelation = "xid" // LogCtxRequest represents the log key for a Request ID. LogCtxRequest = "request" // LogCtxRoute represents the log key for a Route ID. LogCtxRoute = "route" // LogCtxResource represents the log key for a Resource ID. LogCtxResource = "resource" // LogCtxEndpoint represents the log key for an Endpoint. LogCtxEndpoint = "endpoint" // LogCtxRequestBody represents the log key for an HTTP Request Body. LogCtxRequestBody = "body" // LogCtxBucket represents the log key for a Rate Limit Bucket ID. LogCtxBucket = "bucket" // LogCtxReset represents the log key for a Discord Bucket reset time. LogCtxReset = "reset" // LogCtxResponse represents the log key for an HTTP Request Response. LogCtxResponse = "response" // LogCtxResponseHeader represents the log key for an HTTP Request Response header. LogCtxResponseHeader = "header" // LogCtxResponseBody represents the log key for an HTTP Request Response body. LogCtxResponseBody = "body" // LogCtxRequestRateLimitCode represents the log key for an HTTP Rate Limit Response code. LogCtxRequestRateLimitCode = "code" // LogCtxSession represents the log key for a Discord Session ID. LogCtxSession = "session" // LogCtxPayload represents the log key for a Discord Gateway Payload. LogCtxPayload = "payload" // LogCtxPayloadOpcode represents the log key for a Discord Gateway Payload opcode. LogCtxPayloadOpcode = "opcode" // LogCtxPayloadData represents the log key for Discord Gateway Payload data. LogCtxPayloadData = "data" // LogCtxEvent represents the log key for a Discord Gateway Event. LogCtxEvent = "event" // LogCtxCommand represents the log key for a Discord Gateway command. LogCtxCommand = "command" // LogCtxCommandOpcode represents the log key for a Discord Gateway command opcode. LogCtxCommandOpcode = "opcode" // LogCtxCommandName represents the log key for a Discord Gateway command name. LogCtxCommandName = "name" )
Logger Contexts
const ( SessionStateNew = "" SessionStateConnecting = "connecting (before websocket connection)" SessionStateConnectingWebsocket = "connecting (with websocket connection)" SessionStateConnected = "connected" SessionStateDisconnecting = "disconnecting (purposefully)" SessionStateDisconnectingError = "disconnecting (due to an error)" SessionStateDisconnectingReconnect = "disconnecting (while reconnecting)" SessionStateDisconnectedFinal = "disconnected (after connection)" SessionStateDisconnectedError = "disconnected (due to an error)" SessionStateDisconnectedReconnect = "disconnected (while reconnecting)" SessionStateReconnecting = "reconnecting" )
Session States represent the state of the Session's connection to Discord.
const (
// 10,000 requests per 10 minutes.
FlagInvalidRequestRateLimit = 10000
)
Invalid Request Limit (CloudFlare Bans) https://discord.com/developers/docs/topics/rate-limits#invalid-request-limit-aka-cloudflare-bans
const (
GlobalRateLimitRouteID = "0"
)
const (
// SessionManagerVoiceKeyUnknownSession represents an unknown Session ID key for SessionManager.Voice
SessionManagerVoiceKeyUnknownSession = "UNKNOWN"
)
const (
TimestampFormatISO8601 = time.RFC3339
)
time.Time Format https://discord.com/developers/docs/reference#iso8601-datetime
Variables ¶
var ( FlagGatewayCloseEventCodeUnknownError = GatewayCloseEventCode{ Code: 4000, Description: "Unknown error", Explanation: "We're not sure what went wrong. Try reconnecting?", Reconnect: true, } FlagGatewayCloseEventCodeUnknownOpcode = GatewayCloseEventCode{ Code: 4001, Description: "Unknown opcode", Explanation: "You sent an invalid Gateway opcode or an invalid payload for an opcode. Don't do that!", Reconnect: true, } FlagGatewayCloseEventCodeDecodeError = GatewayCloseEventCode{ Code: 4002, Description: "Decode error", Explanation: "You sent an invalid payload to us. Don't do that!", Reconnect: true, } FlagGatewayCloseEventCodeNotAuthenticated = GatewayCloseEventCode{ Code: 4003, Description: "Not authenticated", Explanation: "You sent us a payload prior to identifying.", Reconnect: true, } FlagGatewayCloseEventCodeAuthenticationFailed = GatewayCloseEventCode{ Code: 4004, Description: "Authentication failed", Explanation: "The account token sent with your identify payload is incorrect.", Reconnect: false, } FlagGatewayCloseEventCodeAlreadyAuthenticated = GatewayCloseEventCode{ Code: 4005, Description: "Already authenticated", Explanation: "You sent more than one identify payload. Don't do that!", Reconnect: true, } FlagGatewayCloseEventCodeInvalidSeq = GatewayCloseEventCode{ Code: 4007, Description: "Invalid seq", Explanation: "The sequence sent when resuming the session was invalid. Reconnect and start a new session.", Reconnect: true, } FlagGatewayCloseEventCodeRateLimited = GatewayCloseEventCode{ Code: 4008, Description: "Rate limited.", Explanation: "You're sending payloads to us too quickly. Slow it down! You will be disconnected on receiving this.", Reconnect: true, } FlagGatewayCloseEventCodeSessionTimed = GatewayCloseEventCode{ Code: 4009, Description: "Session timed out", Explanation: "Your session timed out. Reconnect and start a new one.", Reconnect: true, } FlagGatewayCloseEventCodeInvalidShard = GatewayCloseEventCode{ Code: 4010, Description: "Invalid shard", Explanation: "You sent us an invalid shard when identifying.", Reconnect: false, } FlagGatewayCloseEventCodeShardingRequired = GatewayCloseEventCode{ Code: 4011, Description: "Sharding required", Explanation: "The session would have handled too many guilds - you are required to shard your connection in order to connect.", Reconnect: false, } FlagGatewayCloseEventCodeInvalidAPIVersion = GatewayCloseEventCode{ Code: 4012, Description: "Invalid API version", Explanation: "You sent an invalid version for the gateway.", Reconnect: false, } FlagGatewayCloseEventCodeInvalidIntent = GatewayCloseEventCode{ Code: 4013, Description: "Invalid intent(s)", Explanation: "You sent an invalid intent for a Gateway Intent. You may have incorrectly calculated the bitwise value.", Reconnect: false, } FlagGatewayCloseEventCodeDisallowedIntent = GatewayCloseEventCode{ Code: 4014, Description: "Disallowed intent(s)", Explanation: "You sent a disallowed intent for a Gateway Intent. You may have tried to specify an intent that you have not enabled or are not approved for.", Reconnect: false, } GatewayCloseEventCodes = map[int]*GatewayCloseEventCode{ FlagGatewayCloseEventCodeUnknownError.Code: &FlagGatewayCloseEventCodeUnknownError, FlagGatewayCloseEventCodeUnknownOpcode.Code: &FlagGatewayCloseEventCodeUnknownOpcode, FlagGatewayCloseEventCodeDecodeError.Code: &FlagGatewayCloseEventCodeDecodeError, FlagGatewayCloseEventCodeNotAuthenticated.Code: &FlagGatewayCloseEventCodeNotAuthenticated, FlagGatewayCloseEventCodeAuthenticationFailed.Code: &FlagGatewayCloseEventCodeAuthenticationFailed, FlagGatewayCloseEventCodeAlreadyAuthenticated.Code: &FlagGatewayCloseEventCodeAlreadyAuthenticated, FlagGatewayCloseEventCodeInvalidSeq.Code: &FlagGatewayCloseEventCodeInvalidSeq, FlagGatewayCloseEventCodeRateLimited.Code: &FlagGatewayCloseEventCodeRateLimited, FlagGatewayCloseEventCodeSessionTimed.Code: &FlagGatewayCloseEventCodeSessionTimed, FlagGatewayCloseEventCodeInvalidShard.Code: &FlagGatewayCloseEventCodeInvalidShard, FlagGatewayCloseEventCodeInvalidAPIVersion.Code: &FlagGatewayCloseEventCodeInvalidAPIVersion, FlagGatewayCloseEventCodeInvalidIntent.Code: &FlagGatewayCloseEventCodeInvalidIntent, FlagGatewayCloseEventCodeDisallowedIntent.Code: &FlagGatewayCloseEventCodeDisallowedIntent, } )
var ( FlagClientCloseEventCodeNormal = 1000 FlagClientCloseEventCodeAway = 1001 // https://www.rfc-editor.org/rfc/rfc6455#section-7.4.1 FlagClientCloseEventCodeReconnect = 3000 )
Client Close Event Codes https://discord.com/developers/docs/topics/gateway#disconnections
var ( FlagVoiceCloseEventCodeUnknownOpcode = VoiceCloseEventCode{ Code: 4001, Description: "Unknown opcode", Explanation: "You sent an invalid opcode.", } FlagVoiceCloseEventCodeFailedDecode = VoiceCloseEventCode{ Code: 4002, Description: "Failed to decode payload", Explanation: "You sent a invalid payload in your identifying to the Gateway.", } FlagVoiceCloseEventCodeNotAuthenticated = VoiceCloseEventCode{ Code: 4003, Description: "Not authenticated", Explanation: "You sent a payload before identifying with the Gateway or this session has been invalidated.", } FlagVoiceCloseEventCodeAuthenticationFailed = VoiceCloseEventCode{ Code: 4004, Description: "Authentication failed", Explanation: "The token you sent in your identify payload is incorrect.", } FlagVoiceCloseEventCodeAlreadyAuthenticated = VoiceCloseEventCode{ Code: 4005, Description: "Already authenticated", Explanation: "You sent more than one identify payload. Stahp.", } FlagVoiceCloseEventCodeInvalidSession = VoiceCloseEventCode{ Code: 4006, Description: "Session no longer valid", Explanation: "Your session is no longer valid.", } FlagVoiceCloseEventCodeSessionTimeout = VoiceCloseEventCode{ Code: 4009, Description: "Session timeout", Explanation: "Your session has timed out.", } FlagVoiceCloseEventCodeServerNotFound = VoiceCloseEventCode{ Code: 4011, Description: "Server not found", Explanation: "We can't find the server you're trying to connect to.", } FlagVoiceCloseEventCodeUnknownProtocol = VoiceCloseEventCode{ Code: 4012, Description: "Unknown protocol", Explanation: "We didn't recognize the protocol you sent.", } FlagVoiceCloseEventCodeDisconnectedChannel = VoiceCloseEventCode{ Code: 4014, Description: "Disconnected", Explanation: "Channel was deleted, you were kicked, voice server changed, or the main gateway session was dropped. Don't reconnect.", } FlagVoiceCloseEventCodeVoiceServerCrash = VoiceCloseEventCode{ Code: 4015, Description: "Voice server crashed", Explanation: "The server crashed. Our bad! Try resuming.", } FlagVoiceCloseEventCodeUnknownEncryptionMode = VoiceCloseEventCode{ Code: 4016, Description: "Unknown encryption mode", Explanation: "We didn't recognize your encryption.", } FlagVoiceCloseEventCodeBadRequest = VoiceCloseEventCode{ Code: 4020, Description: "Bad request", Explanation: "You sent a malformed request.", } VoiceCloseEventCodes = map[int]*VoiceCloseEventCode{ FlagVoiceCloseEventCodeUnknownOpcode.Code: &FlagVoiceCloseEventCodeUnknownOpcode, FlagVoiceCloseEventCodeFailedDecode.Code: &FlagVoiceCloseEventCodeFailedDecode, FlagVoiceCloseEventCodeNotAuthenticated.Code: &FlagVoiceCloseEventCodeNotAuthenticated, FlagVoiceCloseEventCodeAuthenticationFailed.Code: &FlagVoiceCloseEventCodeAuthenticationFailed, FlagVoiceCloseEventCodeAlreadyAuthenticated.Code: &FlagVoiceCloseEventCodeAlreadyAuthenticated, FlagVoiceCloseEventCodeInvalidSession.Code: &FlagVoiceCloseEventCodeInvalidSession, FlagVoiceCloseEventCodeSessionTimeout.Code: &FlagVoiceCloseEventCodeSessionTimeout, FlagVoiceCloseEventCodeServerNotFound.Code: &FlagVoiceCloseEventCodeServerNotFound, FlagVoiceCloseEventCodeUnknownProtocol.Code: &FlagVoiceCloseEventCodeUnknownProtocol, FlagVoiceCloseEventCodeDisconnectedChannel.Code: &FlagVoiceCloseEventCodeDisconnectedChannel, FlagVoiceCloseEventCodeVoiceServerCrash.Code: &FlagVoiceCloseEventCodeVoiceServerCrash, FlagVoiceCloseEventCodeUnknownEncryptionMode.Code: &FlagVoiceCloseEventCodeUnknownEncryptionMode, FlagVoiceCloseEventCodeBadRequest.Code: &FlagVoiceCloseEventCodeBadRequest, } )
var ( EndpointModifyChannelGroupDM = EndpointModifyChannel EndpointModifyChannelGuild = EndpointModifyChannel EndpointModifyChannelThread = EndpointModifyChannel )
var ( // ContentTypeURLQueryString is an HTTP Header Content Type that indicates // a payload with an encoded URL Query String. ContentTypeURLQueryString = []byte("application/x-www-form-urlencoded") // ContentTypeJSON is an HTTP Header Content Type that indicates a payload with a JSON body. ContentTypeJSON = []byte("application/json") // ContentTypeMultipartForm is an HTTP Header Content Type that indicates // a payload with multiple content types. ContentTypeMultipartForm = []byte("multipart/form-data") // ContentTypeJPEG is an HTTP Header Content Type that indicates a payload with a JPEG image. ContentTypeJPEG = []byte("image/jpeg") // ContentTypePNG is an HTTP Header Content Type that indicates a payload with a PNG image. ContentTypePNG = []byte("image/png") // ContentTypeWebP is an HTTP Header Content Type that indicates a payload with a WebP image. ContentTypeWebP = []byte("image/webp") // ContentTypeGIF is an HTTP Header Content Type that indicates a payload with a GIF animated image. ContentTypeGIF = []byte("image/gif") )
Content Types https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type
var (
ActivityLocationKindEnum = map[string]string{
"gc": "Location is a Guild Channel",
"pc": "Location is a Private Channel, such as a DM or GDM",
}
)
Activity Location Kind Enum https://discord.com/developers/docs/resources/application#get-application-activity-instance-activity-location-kind-enum
var ( HTTPResponseCodes = map[int]string{ FlagHTTPResponseCodeOK: "The request completed successfully.", FlagHTTPResponseCodeCREATED: "The entity was created successfully.", FlagHTTPResponseCodeNOCONTENT: "The request completed successfully but returned no content.", FlagHTTPResponseCodeNOTMODIFIED: "The entity was not modified (no action was taken).", FlagHTTPResponseCodeBADREQUEST: "The request was improperly formatted, or the server couldn't understand it.", FlagHTTPResponseCodeUNAUTHORIZED: "The Authorization header was missing or invalid.", FlagHTTPResponseCodeFORBIDDEN: "The Authorization token you passed did not have permission to the resource.", FlagHTTPResponseCodeNOTFOUND: "The resource at the location specified doesn't exist.", FlagHTTPResponseCodeMETHODNOTALLOWED: "The HTTP method used is not valid for the location specified.", FlagHTTPResponseCodeTOOMANYREQUESTS: "You are being rate limited, see Rate Limits.", FlagHTTPResponseCodeGATEWAYUNAVAILABLE: "There was not a gateway available to process your request. Wait a bit and retry.", FlagHTTPResponseCodeSERVERERROR: "The server had an error processing your request (these are rare).", } )
var ( // HashPerRoute hashes a request that uses a per-route rate limit algorithm. HashPerRoute = Hash(0) )
var ( // IgnoreGlobalRateLimitRouteIDs represents a set of Route IDs that do NOT adhere to the Global Rate Limit. // // Interaction endpoints are not bound to the bot's Global Rate Limit. // https://discord.com/developers/docs/interactions/receiving-and-responding#endpoints IgnoreGlobalRateLimitRouteIDs = map[string]bool{ "18": true, "19": true, "20": true, "21": true, "22": true, "23": true, "24": true, "25": true, } )
var ( InvalidRateLimitRequests = map[int]string{ FlagHTTPResponseCodeUNAUTHORIZED: HTTPResponseCodes[FlagHTTPResponseCodeUNAUTHORIZED], FlagHTTPResponseCodeFORBIDDEN: HTTPResponseCodes[FlagHTTPResponseCodeFORBIDDEN], FlagHTTPResponseCodeTOOMANYREQUESTS: HTTPResponseCodes[FlagHTTPResponseCodeTOOMANYREQUESTS], } )
var (
JSONErrorCodes = map[int]string{}/* 207 elements not displayed */
)
JSON Error Codes https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes
var ( // Logger represents the Disgo Logger used to log information. Logger = zerolog.New(os.Stdout) )
var ( MutableGuildFeatures = map[string]bool{ FlagGuildFeatureCOMMUNITY: true, FlagGuildFeatureINVITES_DISABLED: true, FlagGuildFeatureDISCOVERABLE: true, FlagGuildFeatureRAID_ALERTS_DISABLED: true, } )
Mutable Guild Features https://discord.com/developers/docs/resources/guild#guild-object-mutable-guild-features
var ( PrivilegedIntents = map[BitFlag]bool{ FlagIntentGUILD_PRESENCES: true, FlagIntentGUILD_MEMBERS: true, FlagIntentMESSAGE_CONTENT: true, } )
Privileged Intents https://discord.com/developers/docs/topics/gateway#privileged-intents
var ( // RateLimitHashFuncs represents a map of routes to respective rate limit algorithms. // // Used to determine the hashing function for routes during runtime (map[routeID]algorithm). RateLimitHashFuncs = map[uint8]hash{}/* 206 elements not displayed */ )
var ( // RouteIDs represents a map of Routes to Route IDs (map[string]uint8). RouteIDs = map[string]uint8{}/* 208 elements not displayed */ )
Functions ¶
func BotAuthorization ¶
func BotAuthorization()
BotAuthorization performs a specialized OAuth2 flow for users to add bots to guilds.
Send the user a valid Bot Authorization URL, which can be generated using GenerateBotAuthorizationURL(disgo.BotAuthParams{...}).
When the user visits the Bot Authorization URL, they will be prompted for authorization. If the user accepts the prompt (with a guild), the bot will be added to the selected guild.
For more information read, https://discord.com/developers/docs/topics/oauth2#bot-authorization-flow
func CDNEndpointAchievementIcon ¶
CDNEndpointAchievementIcon builds a query for an HTTP request.
func CDNEndpointApplicationAsset ¶
CDNEndpointApplicationAsset builds a query for an HTTP request.
func CDNEndpointApplicationCover ¶
CDNEndpointApplicationCover builds a query for an HTTP request.
func CDNEndpointApplicationIcon ¶
CDNEndpointApplicationIcon builds a query for an HTTP request.
func CDNEndpointCustomEmoji ¶
CDNEndpointCustomEmoji builds a query for an HTTP request.
func CDNEndpointDefaultUserAvatar ¶
CDNEndpointDefaultUserAvatar builds a query for an HTTP request.
func CDNEndpointGuildBanner ¶
CDNEndpointGuildBanner builds a query for an HTTP request.
func CDNEndpointGuildDiscoverySplash ¶
CDNEndpointGuildDiscoverySplash builds a query for an HTTP request.
func CDNEndpointGuildIcon ¶
CDNEndpointGuildIcon builds a query for an HTTP request.
func CDNEndpointGuildMemberAvatar ¶
CDNEndpointGuildMemberAvatar builds a query for an HTTP request.
func CDNEndpointGuildMemberBanner ¶
CDNEndpointGuildMemberBanner builds a query for an HTTP request.
func CDNEndpointGuildScheduledEventCover ¶
CDNEndpointGuildScheduledEventCover builds a query for an HTTP request.
func CDNEndpointGuildSplash ¶
CDNEndpointGuildSplash builds a query for an HTTP request.
func CDNEndpointRoleIcon ¶
CDNEndpointRoleIcon builds a query for an HTTP request.
func CDNEndpointSticker ¶
CDNEndpointSticker builds a query for an HTTP request.
func CDNEndpointStickerPackBanner ¶
CDNEndpointStickerPackBanner builds a query for an HTTP request.
func CDNEndpointStorePageAsset ¶ added in v1.10.1
func CDNEndpointStorePageAsset() string
CDNEndpointStorePageAsset builds a query for an HTTP request.
func CDNEndpointTeamIcon ¶
CDNEndpointTeamIcon builds a query for an HTTP request.
func CDNEndpointUserAvatar ¶
CDNEndpointUserAvatar builds a query for an HTTP request.
func CDNEndpointUserAvatarDecoration ¶ added in v1.10.2
CDNEndpointUserAvatarDecoration builds a query for an HTTP request.
func CDNEndpointUserBanner ¶
CDNEndpointUserBanner builds a query for an HTTP request.
func CDNURLParameterExpire ¶ added in v1.10.2
func CDNURLParameterExpire() string
CDNURLParameterExpire builds a query for an HTTP request.
func CDNURLParameterIssued ¶ added in v1.10.2
func CDNURLParameterIssued() string
CDNURLParameterIssued builds a query for an HTTP request.
func CDNURLParameterSignature ¶ added in v1.10.2
func CDNURLParameterSignature() string
CDNURLParameterSignature builds a query for an HTTP request.
func EndpointAddGuildMember ¶
EndpointAddGuildMember builds a query for an HTTP request.
func EndpointAddGuildMemberRole ¶
EndpointAddGuildMemberRole builds a query for an HTTP request.
func EndpointAddThreadMember ¶
EndpointAddThreadMember builds a query for an HTTP request.
func EndpointAuthorizationURL ¶
func EndpointAuthorizationURL() string
EndpointAuthorizationURL builds a query for an HTTP request.
func EndpointBatchEditApplicationCommandPermissions ¶
EndpointBatchEditApplicationCommandPermissions builds a query for an HTTP request.
func EndpointBeginGuildPrune ¶
EndpointBeginGuildPrune builds a query for an HTTP request.
func EndpointBulkDeleteMessages ¶
EndpointBulkDeleteMessages builds a query for an HTTP request.
func EndpointBulkOverwriteGlobalApplicationCommands ¶
EndpointBulkOverwriteGlobalApplicationCommands builds a query for an HTTP request.
func EndpointBulkOverwriteGuildApplicationCommands ¶
EndpointBulkOverwriteGuildApplicationCommands builds a query for an HTTP request.
func EndpointConsumeEntitlement ¶ added in v1.10.2
EndpointConsumeEntitlement builds a query for an HTTP request.
func EndpointCreateApplicationEmoji ¶ added in v1.10.2
EndpointCreateApplicationEmoji builds a query for an HTTP request.
func EndpointCreateAutoModerationRule ¶
EndpointCreateAutoModerationRule builds a query for an HTTP request.
func EndpointCreateChannelInvite ¶
EndpointCreateChannelInvite builds a query for an HTTP request.
func EndpointCreateDM ¶
func EndpointCreateDM() string
EndpointCreateDM builds a query for an HTTP request.
func EndpointCreateFollowupMessage ¶
EndpointCreateFollowupMessage builds a query for an HTTP request.
func EndpointCreateGlobalApplicationCommand ¶
EndpointCreateGlobalApplicationCommand builds a query for an HTTP request.
func EndpointCreateGroupDM ¶
func EndpointCreateGroupDM() string
EndpointCreateGroupDM builds a query for an HTTP request.
func EndpointCreateGuild ¶
func EndpointCreateGuild() string
EndpointCreateGuild builds a query for an HTTP request.
func EndpointCreateGuildApplicationCommand ¶
EndpointCreateGuildApplicationCommand builds a query for an HTTP request.
func EndpointCreateGuildBan ¶
EndpointCreateGuildBan builds a query for an HTTP request.
func EndpointCreateGuildChannel ¶
EndpointCreateGuildChannel builds a query for an HTTP request.
func EndpointCreateGuildEmoji ¶
EndpointCreateGuildEmoji builds a query for an HTTP request.
func EndpointCreateGuildRole ¶
EndpointCreateGuildRole builds a query for an HTTP request.
func EndpointCreateGuildScheduledEvent ¶
EndpointCreateGuildScheduledEvent builds a query for an HTTP request.
func EndpointCreateGuildSoundboardSound ¶ added in v1.10.2
EndpointCreateGuildSoundboardSound builds a query for an HTTP request.
func EndpointCreateGuildSticker ¶
EndpointCreateGuildSticker builds a query for an HTTP request.
func EndpointCreateGuildTemplate ¶
EndpointCreateGuildTemplate builds a query for an HTTP request.
func EndpointCreateGuildfromGuildTemplate ¶
EndpointCreateGuildfromGuildTemplate builds a query for an HTTP request.
func EndpointCreateInteractionResponse ¶
EndpointCreateInteractionResponse builds a query for an HTTP request.
func EndpointCreateMessage ¶
EndpointCreateMessage builds a query for an HTTP request.
func EndpointCreateReaction ¶
EndpointCreateReaction builds a query for an HTTP request.
func EndpointCreateStageInstance ¶
func EndpointCreateStageInstance() string
EndpointCreateStageInstance builds a query for an HTTP request.
func EndpointCreateTestEntitlement ¶ added in v1.10.2
EndpointCreateTestEntitlement builds a query for an HTTP request.
func EndpointCreateWebhook ¶
EndpointCreateWebhook builds a query for an HTTP request.
func EndpointCrosspostMessage ¶
EndpointCrosspostMessage builds a query for an HTTP request.
func EndpointDeleteAllReactions ¶
EndpointDeleteAllReactions builds a query for an HTTP request.
func EndpointDeleteAllReactionsforEmoji ¶
EndpointDeleteAllReactionsforEmoji builds a query for an HTTP request.
func EndpointDeleteApplicationEmoji ¶ added in v1.10.2
EndpointDeleteApplicationEmoji builds a query for an HTTP request.
func EndpointDeleteAutoModerationRule ¶
EndpointDeleteAutoModerationRule builds a query for an HTTP request.
func EndpointDeleteChannelPermission ¶
EndpointDeleteChannelPermission builds a query for an HTTP request.
func EndpointDeleteCloseChannel ¶
EndpointDeleteCloseChannel builds a query for an HTTP request.
func EndpointDeleteFollowupMessage ¶
EndpointDeleteFollowupMessage builds a query for an HTTP request.
func EndpointDeleteGlobalApplicationCommand ¶
EndpointDeleteGlobalApplicationCommand builds a query for an HTTP request.
func EndpointDeleteGuild ¶
EndpointDeleteGuild builds a query for an HTTP request.
func EndpointDeleteGuildApplicationCommand ¶
EndpointDeleteGuildApplicationCommand builds a query for an HTTP request.
func EndpointDeleteGuildEmoji ¶
EndpointDeleteGuildEmoji builds a query for an HTTP request.
func EndpointDeleteGuildIntegration ¶
EndpointDeleteGuildIntegration builds a query for an HTTP request.
func EndpointDeleteGuildRole ¶
EndpointDeleteGuildRole builds a query for an HTTP request.
func EndpointDeleteGuildScheduledEvent ¶
EndpointDeleteGuildScheduledEvent builds a query for an HTTP request.
func EndpointDeleteGuildSoundboardSound ¶ added in v1.10.2
EndpointDeleteGuildSoundboardSound builds a query for an HTTP request.
func EndpointDeleteGuildSticker ¶
EndpointDeleteGuildSticker builds a query for an HTTP request.
func EndpointDeleteGuildTemplate ¶
EndpointDeleteGuildTemplate builds a query for an HTTP request.
func EndpointDeleteInvite ¶
EndpointDeleteInvite builds a query for an HTTP request.
func EndpointDeleteMessage ¶
EndpointDeleteMessage builds a query for an HTTP request.
func EndpointDeleteOriginalInteractionResponse ¶
EndpointDeleteOriginalInteractionResponse builds a query for an HTTP request.
func EndpointDeleteOwnReaction ¶
EndpointDeleteOwnReaction builds a query for an HTTP request.
func EndpointDeleteStageInstance ¶
EndpointDeleteStageInstance builds a query for an HTTP request.
func EndpointDeleteTestEntitlement ¶ added in v1.10.2
EndpointDeleteTestEntitlement builds a query for an HTTP request.
func EndpointDeleteUserReaction ¶
EndpointDeleteUserReaction builds a query for an HTTP request.
func EndpointDeleteWebhook ¶
EndpointDeleteWebhook builds a query for an HTTP request.
func EndpointDeleteWebhookMessage ¶
EndpointDeleteWebhookMessage builds a query for an HTTP request.
func EndpointDeleteWebhookwithToken ¶
EndpointDeleteWebhookwithToken builds a query for an HTTP request.
func EndpointEditApplicationCommandPermissions ¶
EndpointEditApplicationCommandPermissions builds a query for an HTTP request.
func EndpointEditChannelPermissions ¶
EndpointEditChannelPermissions builds a query for an HTTP request.
func EndpointEditCurrentApplication ¶ added in v1.10.2
func EndpointEditCurrentApplication() string
EndpointEditCurrentApplication builds a query for an HTTP request.
func EndpointEditFollowupMessage ¶
EndpointEditFollowupMessage builds a query for an HTTP request.
func EndpointEditGlobalApplicationCommand ¶
EndpointEditGlobalApplicationCommand builds a query for an HTTP request.
func EndpointEditGuildApplicationCommand ¶
EndpointEditGuildApplicationCommand builds a query for an HTTP request.
func EndpointEditMessage ¶
EndpointEditMessage builds a query for an HTTP request.
func EndpointEditOriginalInteractionResponse ¶
EndpointEditOriginalInteractionResponse builds a query for an HTTP request.
func EndpointEditWebhookMessage ¶
EndpointEditWebhookMessage builds a query for an HTTP request.
func EndpointEndPoll ¶ added in v1.10.2
EndpointEndPoll builds a query for an HTTP request.
func EndpointExecuteGitHubCompatibleWebhook ¶
EndpointExecuteGitHubCompatibleWebhook builds a query for an HTTP request.
func EndpointExecuteSlackCompatibleWebhook ¶
EndpointExecuteSlackCompatibleWebhook builds a query for an HTTP request.
func EndpointExecuteWebhook ¶
EndpointExecuteWebhook builds a query for an HTTP request.
func EndpointFollowAnnouncementChannel ¶
EndpointFollowAnnouncementChannel builds a query for an HTTP request.
func EndpointGetAnswerVoters ¶ added in v1.10.2
EndpointGetAnswerVoters builds a query for an HTTP request.
func EndpointGetApplicationActivityInstance ¶ added in v1.10.2
EndpointGetApplicationActivityInstance builds a query for an HTTP request.
func EndpointGetApplicationCommandPermissions ¶
EndpointGetApplicationCommandPermissions builds a query for an HTTP request.
func EndpointGetApplicationEmoji ¶ added in v1.10.2
EndpointGetApplicationEmoji builds a query for an HTTP request.
func EndpointGetApplicationRoleConnectionMetadataRecords ¶ added in v1.10.1
EndpointGetApplicationRoleConnectionMetadataRecords builds a query for an HTTP request.
func EndpointGetAutoModerationRule ¶
EndpointGetAutoModerationRule builds a query for an HTTP request.
func EndpointGetChannel ¶
EndpointGetChannel builds a query for an HTTP request.
func EndpointGetChannelInvites ¶
EndpointGetChannelInvites builds a query for an HTTP request.
func EndpointGetChannelMessage ¶
EndpointGetChannelMessage builds a query for an HTTP request.
func EndpointGetChannelMessages ¶
EndpointGetChannelMessages builds a query for an HTTP request.
func EndpointGetChannelWebhooks ¶
EndpointGetChannelWebhooks builds a query for an HTTP request.
func EndpointGetCurrentApplication ¶ added in v1.10.2
func EndpointGetCurrentApplication() string
EndpointGetCurrentApplication builds a query for an HTTP request.
func EndpointGetCurrentAuthorizationInformation ¶
func EndpointGetCurrentAuthorizationInformation() string
EndpointGetCurrentAuthorizationInformation builds a query for an HTTP request.
func EndpointGetCurrentBotApplicationInformation ¶
func EndpointGetCurrentBotApplicationInformation() string
EndpointGetCurrentBotApplicationInformation builds a query for an HTTP request.
func EndpointGetCurrentUser ¶
func EndpointGetCurrentUser() string
EndpointGetCurrentUser builds a query for an HTTP request.
func EndpointGetCurrentUserApplicationRoleConnection ¶ added in v1.10.2
EndpointGetCurrentUserApplicationRoleConnection builds a query for an HTTP request.
func EndpointGetCurrentUserConnections ¶ added in v1.10.2
func EndpointGetCurrentUserConnections() string
EndpointGetCurrentUserConnections builds a query for an HTTP request.
func EndpointGetCurrentUserGuildMember ¶
EndpointGetCurrentUserGuildMember builds a query for an HTTP request.
func EndpointGetCurrentUserGuilds ¶
func EndpointGetCurrentUserGuilds() string
EndpointGetCurrentUserGuilds builds a query for an HTTP request.
func EndpointGetEntitlement ¶ added in v1.10.2
EndpointGetEntitlement builds a query for an HTTP request.
func EndpointGetFollowupMessage ¶
EndpointGetFollowupMessage builds a query for an HTTP request.
func EndpointGetGateway ¶
func EndpointGetGateway() string
EndpointGetGateway builds a query for an HTTP request.
func EndpointGetGatewayBot ¶
func EndpointGetGatewayBot() string
EndpointGetGatewayBot builds a query for an HTTP request.
func EndpointGetGlobalApplicationCommand ¶
EndpointGetGlobalApplicationCommand builds a query for an HTTP request.
func EndpointGetGlobalApplicationCommands ¶
EndpointGetGlobalApplicationCommands builds a query for an HTTP request.
func EndpointGetGuild ¶
EndpointGetGuild builds a query for an HTTP request.
func EndpointGetGuildApplicationCommand ¶
EndpointGetGuildApplicationCommand builds a query for an HTTP request.
func EndpointGetGuildApplicationCommandPermissions ¶
EndpointGetGuildApplicationCommandPermissions builds a query for an HTTP request.
func EndpointGetGuildApplicationCommands ¶
EndpointGetGuildApplicationCommands builds a query for an HTTP request.
func EndpointGetGuildAuditLog ¶
EndpointGetGuildAuditLog builds a query for an HTTP request.
func EndpointGetGuildBan ¶
EndpointGetGuildBan builds a query for an HTTP request.
func EndpointGetGuildBans ¶
EndpointGetGuildBans builds a query for an HTTP request.
func EndpointGetGuildChannels ¶
EndpointGetGuildChannels builds a query for an HTTP request.
func EndpointGetGuildEmoji ¶
EndpointGetGuildEmoji builds a query for an HTTP request.
func EndpointGetGuildIntegrations ¶
EndpointGetGuildIntegrations builds a query for an HTTP request.
func EndpointGetGuildInvites ¶
EndpointGetGuildInvites builds a query for an HTTP request.
func EndpointGetGuildMember ¶
EndpointGetGuildMember builds a query for an HTTP request.
func EndpointGetGuildOnboarding ¶ added in v1.10.1
EndpointGetGuildOnboarding builds a query for an HTTP request.
func EndpointGetGuildPreview ¶
EndpointGetGuildPreview builds a query for an HTTP request.
func EndpointGetGuildPruneCount ¶
EndpointGetGuildPruneCount builds a query for an HTTP request.
func EndpointGetGuildRole ¶ added in v1.10.2
EndpointGetGuildRole builds a query for an HTTP request.
func EndpointGetGuildRoles ¶
EndpointGetGuildRoles builds a query for an HTTP request.
func EndpointGetGuildScheduledEvent ¶
EndpointGetGuildScheduledEvent builds a query for an HTTP request.
func EndpointGetGuildScheduledEventUsers ¶
EndpointGetGuildScheduledEventUsers builds a query for an HTTP request.
func EndpointGetGuildSoundboardSound ¶ added in v1.10.2
EndpointGetGuildSoundboardSound builds a query for an HTTP request.
func EndpointGetGuildSticker ¶
EndpointGetGuildSticker builds a query for an HTTP request.
func EndpointGetGuildTemplate ¶
EndpointGetGuildTemplate builds a query for an HTTP request.
func EndpointGetGuildTemplates ¶
EndpointGetGuildTemplates builds a query for an HTTP request.
func EndpointGetGuildVanityURL ¶
EndpointGetGuildVanityURL builds a query for an HTTP request.
func EndpointGetGuildVoiceRegions ¶
EndpointGetGuildVoiceRegions builds a query for an HTTP request.
func EndpointGetGuildWebhooks ¶
EndpointGetGuildWebhooks builds a query for an HTTP request.
func EndpointGetGuildWelcomeScreen ¶
EndpointGetGuildWelcomeScreen builds a query for an HTTP request.
func EndpointGetGuildWidget ¶
EndpointGetGuildWidget builds a query for an HTTP request.
func EndpointGetGuildWidgetImage ¶
EndpointGetGuildWidgetImage builds a query for an HTTP request.
func EndpointGetGuildWidgetSettings ¶
EndpointGetGuildWidgetSettings builds a query for an HTTP request.
func EndpointGetInvite ¶
EndpointGetInvite builds a query for an HTTP request.
func EndpointGetOriginalInteractionResponse ¶
EndpointGetOriginalInteractionResponse builds a query for an HTTP request.
func EndpointGetPinnedMessages ¶
EndpointGetPinnedMessages builds a query for an HTTP request.
func EndpointGetReactions ¶
EndpointGetReactions builds a query for an HTTP request.
func EndpointGetSKUSubscription ¶ added in v1.10.2
EndpointGetSKUSubscription builds a query for an HTTP request.
func EndpointGetStageInstance ¶
EndpointGetStageInstance builds a query for an HTTP request.
func EndpointGetSticker ¶
EndpointGetSticker builds a query for an HTTP request.
func EndpointGetStickerPack ¶ added in v1.10.2
EndpointGetStickerPack builds a query for an HTTP request.
func EndpointGetThreadMember ¶
EndpointGetThreadMember builds a query for an HTTP request.
func EndpointGetUser ¶
EndpointGetUser builds a query for an HTTP request.
func EndpointGetWebhook ¶
EndpointGetWebhook builds a query for an HTTP request.
func EndpointGetWebhookMessage ¶
EndpointGetWebhookMessage builds a query for an HTTP request.
func EndpointGetWebhookwithToken ¶
EndpointGetWebhookwithToken builds a query for an HTTP request.
func EndpointGroupDMAddRecipient ¶
EndpointGroupDMAddRecipient builds a query for an HTTP request.
func EndpointGroupDMRemoveRecipient ¶
EndpointGroupDMRemoveRecipient builds a query for an HTTP request.
func EndpointJoinThread ¶
EndpointJoinThread builds a query for an HTTP request.
func EndpointLeaveGuild ¶
EndpointLeaveGuild builds a query for an HTTP request.
func EndpointLeaveThread ¶
EndpointLeaveThread builds a query for an HTTP request.
func EndpointListActiveGuildThreads ¶
EndpointListActiveGuildThreads builds a query for an HTTP request.
func EndpointListApplicationEmojis ¶ added in v1.10.2
EndpointListApplicationEmojis builds a query for an HTTP request.
func EndpointListAutoModerationRulesForGuild ¶
EndpointListAutoModerationRulesForGuild builds a query for an HTTP request.
func EndpointListDefaultSoundboardSounds ¶ added in v1.10.2
func EndpointListDefaultSoundboardSounds() string
EndpointListDefaultSoundboardSounds builds a query for an HTTP request.
func EndpointListEntitlements ¶ added in v1.10.2
EndpointListEntitlements builds a query for an HTTP request.
func EndpointListGuildEmojis ¶
EndpointListGuildEmojis builds a query for an HTTP request.
func EndpointListGuildMembers ¶
EndpointListGuildMembers builds a query for an HTTP request.
func EndpointListGuildSoundboardSounds ¶ added in v1.10.2
EndpointListGuildSoundboardSounds builds a query for an HTTP request.
func EndpointListGuildStickers ¶
EndpointListGuildStickers builds a query for an HTTP request.
func EndpointListJoinedPrivateArchivedThreads ¶
EndpointListJoinedPrivateArchivedThreads builds a query for an HTTP request.
func EndpointListPrivateArchivedThreads ¶
EndpointListPrivateArchivedThreads builds a query for an HTTP request.
func EndpointListPublicArchivedThreads ¶
EndpointListPublicArchivedThreads builds a query for an HTTP request.
func EndpointListSKUSubscriptions ¶ added in v1.10.2
EndpointListSKUSubscriptions builds a query for an HTTP request.
func EndpointListSKUs ¶ added in v1.10.2
EndpointListSKUs builds a query for an HTTP request.
func EndpointListScheduledEventsforGuild ¶
EndpointListScheduledEventsforGuild builds a query for an HTTP request.
func EndpointListStickerPacks ¶ added in v1.10.2
func EndpointListStickerPacks() string
EndpointListStickerPacks builds a query for an HTTP request.
func EndpointListThreadMembers ¶
EndpointListThreadMembers builds a query for an HTTP request.
func EndpointListVoiceRegions ¶
func EndpointListVoiceRegions() string
EndpointListVoiceRegions builds a query for an HTTP request.
func EndpointModifyApplicationEmoji ¶ added in v1.10.2
EndpointModifyApplicationEmoji builds a query for an HTTP request.
func EndpointModifyAutoModerationRule ¶
EndpointModifyAutoModerationRule builds a query for an HTTP request.
func EndpointModifyChannel ¶
EndpointModifyChannel builds a query for an HTTP request.
func EndpointModifyCurrentMember ¶
EndpointModifyCurrentMember builds a query for an HTTP request.
func EndpointModifyCurrentUser ¶
func EndpointModifyCurrentUser() string
EndpointModifyCurrentUser builds a query for an HTTP request.
func EndpointModifyCurrentUserNick ¶
EndpointModifyCurrentUserNick builds a query for an HTTP request.
func EndpointModifyCurrentUserVoiceState ¶
EndpointModifyCurrentUserVoiceState builds a query for an HTTP request.
func EndpointModifyGuild ¶
EndpointModifyGuild builds a query for an HTTP request.
func EndpointModifyGuildChannelPositions ¶
EndpointModifyGuildChannelPositions builds a query for an HTTP request.
func EndpointModifyGuildEmoji ¶
EndpointModifyGuildEmoji builds a query for an HTTP request.
func EndpointModifyGuildMFALevel ¶
EndpointModifyGuildMFALevel builds a query for an HTTP request.
func EndpointModifyGuildMember ¶
EndpointModifyGuildMember builds a query for an HTTP request.
func EndpointModifyGuildOnboarding ¶ added in v1.10.2
EndpointModifyGuildOnboarding builds a query for an HTTP request.
func EndpointModifyGuildRole ¶
EndpointModifyGuildRole builds a query for an HTTP request.
func EndpointModifyGuildRolePositions ¶
EndpointModifyGuildRolePositions builds a query for an HTTP request.
func EndpointModifyGuildScheduledEvent ¶
EndpointModifyGuildScheduledEvent builds a query for an HTTP request.
func EndpointModifyGuildSoundboardSound ¶ added in v1.10.2
EndpointModifyGuildSoundboardSound builds a query for an HTTP request.
func EndpointModifyGuildSticker ¶
EndpointModifyGuildSticker builds a query for an HTTP request.
func EndpointModifyGuildTemplate ¶
EndpointModifyGuildTemplate builds a query for an HTTP request.
func EndpointModifyGuildWelcomeScreen ¶
EndpointModifyGuildWelcomeScreen builds a query for an HTTP request.
func EndpointModifyGuildWidget ¶
EndpointModifyGuildWidget builds a query for an HTTP request.
func EndpointModifyStageInstance ¶
EndpointModifyStageInstance builds a query for an HTTP request.
func EndpointModifyUserVoiceState ¶
EndpointModifyUserVoiceState builds a query for an HTTP request.
func EndpointModifyWebhook ¶
EndpointModifyWebhook builds a query for an HTTP request.
func EndpointModifyWebhookwithToken ¶
EndpointModifyWebhookwithToken builds a query for an HTTP request.
func EndpointPinMessage ¶
EndpointPinMessage builds a query for an HTTP request.
func EndpointQueryString ¶
EndpointQueryString returns a URL Query String from a given object.
func EndpointRemoveGuildBan ¶
EndpointRemoveGuildBan builds a query for an HTTP request.
func EndpointRemoveGuildMember ¶
EndpointRemoveGuildMember builds a query for an HTTP request.
func EndpointRemoveGuildMemberRole ¶
EndpointRemoveGuildMemberRole builds a query for an HTTP request.
func EndpointRemoveThreadMember ¶
EndpointRemoveThreadMember builds a query for an HTTP request.
func EndpointSearchGuildMembers ¶
EndpointSearchGuildMembers builds a query for an HTTP request.
func EndpointSendSoundboardSound ¶ added in v1.10.2
EndpointSendSoundboardSound builds a query for an HTTP request.
func EndpointStartThreadfromMessage ¶
EndpointStartThreadfromMessage builds a query for an HTTP request.
func EndpointStartThreadinForumChannel ¶
EndpointStartThreadinForumChannel builds a query for an HTTP request.
func EndpointStartThreadwithoutMessage ¶
EndpointStartThreadwithoutMessage builds a query for an HTTP request.
func EndpointSyncGuildTemplate ¶
EndpointSyncGuildTemplate builds a query for an HTTP request.
func EndpointTokenRevocationURL ¶
func EndpointTokenRevocationURL() string
EndpointTokenRevocationURL builds a query for an HTTP request.
func EndpointTokenURL ¶
func EndpointTokenURL() string
EndpointTokenURL builds a query for an HTTP request.
func EndpointTriggerTypingIndicator ¶
EndpointTriggerTypingIndicator builds a query for an HTTP request.
func EndpointUnpinMessage ¶
EndpointUnpinMessage builds a query for an HTTP request.
func EndpointUpdateApplicationRoleConnectionMetadataRecords ¶ added in v1.10.1
EndpointUpdateApplicationRoleConnectionMetadataRecords builds a query for an HTTP request.
func EndpointUpdateCurrentUserApplicationRoleConnection ¶ added in v1.10.2
EndpointUpdateCurrentUserApplicationRoleConnection builds a query for an HTTP request.
func GenerateAuthorizationURL ¶
GenerateAuthorizationURL generates an authorization URL from a given client and response type.
func GenerateBotAuthorizationURL ¶
func GenerateBotAuthorizationURL(p BotAuthParams) string
GenerateBotAuthorizationURL generates a bot authorization URL using the given BotAuthParams.
Bot.Scopes must include "bot" to enable the OAuth2 Bot Flow.
func Hash ¶
func Hash(n int) hash
Hash returns a hashing function which hashes a request using its routeID.
n represents the degree of resources used to hash the request.
Per-Route: n = 0 Per-Resource: n = 1 ...
func JSONCodeError ¶
JSONCodeError handles a Discord API JSON Error Code and returns the relevant error message.
func LogCommand ¶
LogCommand logs a Gateway Command (typically using a LogSession).
func LogCommandVoice ¶ added in v1.10.2
LogCommandVoice logs a Voice Command.
func LogEventHandler ¶
LogEventHandler logs an event handler action.
func LogPayload ¶
LogPayload logs a Discord Gateway Payload (typically using LogSession).
func LogRequest ¶
func LogRequest(log *zerolog.Event, clientid, xid, routeid, resourceid, endpoint string) *zerolog.Event
LogRequest logs a request.
func LogRequestBody ¶
func LogRequestBody(log *zerolog.Event, clientid, xid, routeid, resourceid, endpoint, body string) *zerolog.Event
LogRequestBody logs a request with its body.
func LogResponse ¶
LogResponse logs a response (typically using LogRequest).
func LogSession ¶
LogSession logs a session.
func Pointer2 ¶
Pointer2 returns a double pointer to the given value.
set `null` to true in order to point the double pointer to a `nil` pointer.
func SendRequest ¶
func SendRequest(bot *Client, xid, routeid, resourceid, method, uri string, content, body []byte, dst any) error
SendRequest sends a fasthttp.Request using the given route ID, HTTP method, URI, content type and body, then parses the response into dst.
func StatusCodeError ¶
StatusCodeError returns the relevant message for a Discord API HTTP Status Code.
func WebhookAuthorization ¶
func WebhookAuthorization(bot *Client, ru *RedirectURL) (*AccessTokenResponse, *Webhook, error)
WebhookAuthorization performs a specialized OAuth2 authorization code grant.
Send the user a valid Authorization URL, which can be generated using GenerateAuthorizationURL(bot, "code") when bot.Scopes is set to `webhook.incoming`.
When the user visits the Authorization URL, they will be prompted for authorization. If the user accepts the prompt (with a channel), they will be redirected to the `redirect_uri`. This issues a GET request to the `redirect_uri` web server which YOU MUST HANDLE by parsing the request's URL Query String into a disgo.RedirectURL object.
Retrieve the user's access token by calling THIS FUNCTION (with the disgo.RedirectURL parameter), which performs an Access Token Exchange.
Refresh the token by using RefreshAuthorizationCodeGrant(bot, token).
For more information read, https://discord.com/developers/docs/topics/oauth2#webhooks
Types ¶
type AccessTokenExchange ¶
type AccessTokenExchange struct { ClientID string `url:"client_id,omitempty"` ClientSecret string `url:"client_secret,omitempty"` GrantType string `url:"grant_type,omitempty"` Code string `url:"code,omitempty"` RedirectURI string `url:"redirect_uri,omitempty"` }
Access Token Exchange POST /oauth2/token https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-access-token-exchange-example
func (*AccessTokenExchange) Send ¶
func (r *AccessTokenExchange) Send(bot *Client) (*AccessTokenResponse, error)
Send sends an AccessTokenExchange request to Discord and returns an AccessTokenResponse.
type AccessTokenResponse ¶
type AccessTokenResponse struct { AccessToken string `json:"access_token,omitempty"` TokenType string `json:"token_type,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` Scope string `json:"scope,omitempty"` ExpiresIn time.Duration `json:"expires_in,omitempty"` }
Access Token Response https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-access-token-response
func AdvancedBotAuthorization ¶
func AdvancedBotAuthorization(bot *Client, ru *RedirectURL) (*AccessTokenResponse, error)
AdvancedBotAuthorization performs a specialized OAuth2 flow for users to add bots to guilds.
Send the user a valid Bot Authorization URL, which can be generated using GenerateBotAuthorizationURL(disgo.BotAuthParams{...}).
If the user accepts the prompt (with a guild), they will be redirected to the `redirect_uri`. This issues a GET request to the `redirect_uri` web server which YOU MUST HANDLE by parsing the request's URL Query String into a disgo.RedirectURL object.
Retrieve the user's access token by calling THIS FUNCTION (with the disgo.RedirectURL parameter), which performs an Access Token Exchange.
Refresh the token by using RefreshAuthorizationCodeGrant(bot, token).
For more information read, https://discord.com/developers/docs/topics/oauth2#advanced-bot-authorization
func AuthorizationCodeGrant ¶
func AuthorizationCodeGrant(bot *Client, ru *RedirectURL) (*AccessTokenResponse, error)
AuthorizationCodeGrant performs an OAuth2 authorization code grant.
Send the user a valid Authorization URL, which can be generated using GenerateAuthorizationURL(bot, "code").
When the user visits the Authorization URL, they will be prompted for authorization. If the user accepts the prompt, they will be redirected to the `redirect_uri`. This issues a GET request to the `redirect_uri` web server which YOU MUST HANDLE by parsing the request's URL Query String into a disgo.RedirectURL object.
Retrieve the user's access token by calling THIS FUNCTION (with the disgo.RedirectURL parameter), which performs an Access Token Exchange.
Refresh the token by using RefreshAuthorizationCodeGrant(bot, token).
For more information, read https://discord.com/developers/docs/topics/oauth2#authorization-code-grant
func ClientCredentialsGrant ¶
func ClientCredentialsGrant(bot *Client) (*AccessTokenResponse, error)
ClientCredentialsGrant performs a client credential OAuth2 grant for TESTING PURPOSES.
The bot client's Authentication Header will be set to a Basic Authentication Header that uses the bot's ClientID as a username and ClientSecret as a password.
A request will be made for a Client Credential grant which returns a disgo.AccessTokenResponse that does NOT contain a refresh token.
For more information, read https://discord.com/developers/docs/topics/oauth2#client-credentials-grant
func ImplicitGrant ¶
func ImplicitGrant(ru *RedirectURI) *AccessTokenResponse
ImplicitGrant converts a RedirectURI (from a simplified OAuth2 grant) to an AccessTokenResponse.
Send the user a valid Authorization URL, which can be generated using GenerateAuthorizationURL(bot, "token").
When the user visits the Authorization URL, they will be prompted for authorization. If the user accepts the prompt, they will be redirected to the `redirect_uri`. This issues a GET request to the `redirect_uri` web server which YOU MUST HANDLE by parsing the request's URI Fragments into a disgo.RedirectURI object.
A disgo.RedirectURI object is equivalent to a disgo.AccessTokenResponse, but it does NOT contain a refresh token.
For more information, read https://discord.com/developers/docs/topics/oauth2#implicit-grant
func RefreshAuthorizationCodeGrant ¶
func RefreshAuthorizationCodeGrant(bot *Client, token *AccessTokenResponse) (*AccessTokenResponse, error)
RefreshAuthorizationCodeGrant refreshes an Access Token from an OAuth2 authorization code grant.
type ActionMetadata ¶
type ActionMetadata struct { CustomMessage *string `json:"custom_message,omitempty"` ChannelID string `json:"channel_id"` DurationSeconds int `json:"duration_seconds"` }
Action Metadata https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-metadata
type ActionRow ¶ added in v1.10.2
https://discord.com/developers/docs/interactions/message-components#action-rows
func (ActionRow) ComponentType ¶ added in v1.10.2
func (*ActionRow) UnmarshalJSON ¶ added in v1.10.2
type Activity ¶
type Activity struct { Party *ActivityParty `json:"party,omitempty"` Emoji **Emoji `json:"emoji,omitempty"` URL **string `json:"url,omitempty"` Instance *bool `json:"instance,omitempty"` Timestamps *ActivityTimestamps `json:"timestamps,omitempty"` ApplicationID *string `json:"application_id,omitempty"` Secrets *ActivitySecrets `json:"secrets,omitempty"` State **string `json:"state,omitempty"` Details **string `json:"details,omitempty"` Assets *ActivityAssets `json:"assets,omitempty"` Name string `json:"name"` Buttons []*Button `json:"buttons,omitempty"` CreatedAt int `json:"created_at"` Flags BitFlag `json:"flags,omitempty"` Type Flag `json:"type"` }
Activity Object https://discord.com/developers/docs/topics/gateway-events#activity-object
type ActivityAssetImage ¶
type ActivityAssetImage struct { ApplicationAsset string `json:"application_asset_id"` MediaProxyImage string `json:"image_id"` }
Activity Asset Image https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-asset-image
type ActivityAssets ¶
type ActivityAssets struct { LargeImage *string `json:"large_image,omitempty"` LargeText *string `json:"large_text,omitempty"` SmallImage *string `json:"small_image,omitempty"` SmallText *string `json:"small_text,omitempty"` }
Activity Assets Struct https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-assets
type ActivityEmoji ¶
type ActivityEmoji struct { ID *string `json:"id,omitempty"` Animated *bool `json:"animated,omitempty"` Name string `json:"name"` }
Activity Emoji https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji
type ActivityInstance ¶ added in v1.10.2
type ActivityInstance struct { ApplicationID string `json:"application_id"` InstanceID string `json:"instance_id"` LaunchID string `json:"launch_id"` Location *ActivityLocation `json:"location"` Users []string `json:"users"` }
Activity Instance Object https://discord.com/developers/docs/resources/application#get-application-activity-instance-activity-instance-object
type ActivityLocation ¶ added in v1.10.2
type ActivityLocation struct { GuildID **string `json:"guild_id,omitempty"` ID string `json:"id"` Kind string `json:"kind"` ChannelID string `json:"channel_id"` }
Activity Location Object https://discord.com/developers/docs/resources/application#get-application-activity-instance-activity-location-object
type ActivityParty ¶
Activity Party Struct https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party
type ActivitySecrets ¶
type ActivitySecrets struct { Join *string `json:"join,omitempty"` Spectate *string `json:"spectate,omitempty"` Match *string `json:"match,omitempty"` }
Activity Secrets Struct https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets
type ActivityTimestamps ¶
type ActivityTimestamps struct { Start *int `json:"start,omitempty"` End *int `json:"end,omitempty"` }
Activity Timestamps Struct https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-timestamps
type AddGuildMember ¶
type AddGuildMember struct { Nick *string `json:"nick,omitempty"` Mute *bool `json:"mute,omitempty"` Deaf *bool `json:"deaf,omitempty"` GuildID string `json:"-"` UserID string `json:"-"` AccessToken string `json:"access_token"` Roles []string `json:"roles,omitempty"` }
Add Guild Member PUT /guilds/{guild.id}/members/{user.id} https://discord.com/developers/docs/resources/guild#add-guild-member
func (*AddGuildMember) Send ¶
func (r *AddGuildMember) Send(bot *Client) (*GuildMember, error)
Send sends a AddGuildMember request to Discord and returns a GuildMember.
type AddGuildMemberRole ¶
Add Guild Member Role PUT /guilds/{guild.id}/members/{user.id}/roles/{role.id} https://discord.com/developers/docs/resources/guild#add-guild-member-role
func (*AddGuildMemberRole) Send ¶
func (r *AddGuildMemberRole) Send(bot *Client) error
Send sends a AddGuildMemberRole request to Discord and returns a error.
type AddThreadMember ¶
Add Thread Member PUT /channels/{channel.id}/thread-members/{user.id} https://discord.com/developers/docs/resources/channel#add-thread-member
func (*AddThreadMember) Send ¶
func (r *AddThreadMember) Send(bot *Client) error
Send sends a AddThreadMember request to Discord and returns a error.
type AllowedMentions ¶
type AllowedMentions struct { Parse []*string `json:"parse"` Roles []string `json:"roles"` Users []string `json:"users"` RepliedUser bool `json:"replied_user"` }
Allowed Mentions Structure https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mentions-structure
type Application ¶
type Application struct { Guild *Guild `json:"guild,omitempty"` CustomInstallURL *string `json:"custom_install_url,omitempty"` PrimarySKUID *string `json:"primary_sku_id,omitempty"` IntegrationTypesConfig map[Flag]*ApplicationIntegrationTypeConfiguration `json:"integration_types_config,omitempty"` InstallParams *InstallParams `json:"install_params,omitempty"` EventWebhooksURL **string `json:"event_webhooks_url,omitempty"` RoleConnectionsVerificationURL **string `json:"role_connections_verification_url,omitempty"` Bot *User `json:"bot,omitempty"` TermsOfServiceURL *string `json:"terms_of_service_url,omitempty"` PrivacyProxyURL *string `json:"privacy_policy_url,omitempty"` Owner *User `json:"owner,omitempty"` InteractionsEndpointURL **string `json:"interactions_endpoint_url,omitempty"` Team *Team `json:"team"` GuildID *string `json:"guild_id,omitempty"` Icon *string `json:"icon"` Slug *string `json:"slug,omitempty"` ApproximateUserInstallCount *int `json:"approximate_user_install_count,omitempty"` CoverImage *string `json:"cover_image,omitempty"` Flags *BitFlag `json:"flags,omitempty"` ApproximateGuildCount *int `json:"approximate_guild_count,omitempty"` Name string `json:"name"` VerifyKey string `json:"verify_key"` Description string `json:"description"` ID string `json:"id"` RedirectURIs []string `json:"redirect_uris,omitempty"` EventWebhooksTypes []string `json:"event_webhooks_types,omitempty"` Tags []string `json:"tags,omitempty"` RPCOrigins []string `json:"rpc_origins,omitempty"` BotRequireCodeGrant bool `json:"bot_require_code_grant"` BotPublic bool `json:"bot_public"` EventWebhooksStatus Flag `json:"event_webhooks_status"` }
Application Object https://discord.com/developers/docs/resources/application
type ApplicationCommand ¶
type ApplicationCommand struct { DefaultMemberPermissions *string `json:"default_member_permissions"` NSFW *bool `json:"nsfw,omitempty"` Contexts *[]Flag `json:"contexts,omitempty"` GuildID *string `json:"guild_id,omitempty"` DescriptionLocalizations *map[string]string `json:"description_localizations,omitempty"` NameLocalizations *map[string]string `json:"name_localizations,omitempty"` Type *Flag `json:"type,omitempty"` Name string `json:"name"` Description string `json:"description"` ID string `json:"id"` ApplicationID string `json:"application_id"` Version string `json:"version,omitempty"` Options []*ApplicationCommandOption `json:"options,omitempty"` IntegrationTypes []Flag `json:"integration_types,omitempty"` Handler Flag `json:"handler,omitempty"` }
Application Command Structure https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure
type ApplicationCommandData ¶
type ApplicationCommandData struct { Resolved *ResolvedData `json:"resolved,omitempty"` GuildID *string `json:"guild_id,omitempty"` TargetID *string `json:"target_id,omitempty"` ID string `json:"id"` Name string `json:"name"` Options []*ApplicationCommandInteractionDataOption `json:"options,omitempty"` Type Flag `json:"type"` }
Application Command Data Structure https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-application-command-data-structure
func (ApplicationCommandData) InteractionDataType ¶
func (d ApplicationCommandData) InteractionDataType() Flag
type ApplicationCommandInteractionDataOption ¶
type ApplicationCommandInteractionDataOption struct { Value *Value `json:"value,omitempty"` Focused *bool `json:"focused,omitempty"` Name string `json:"name"` Options []*ApplicationCommandInteractionDataOption `json:"options,omitempty"` Type Flag `json:"type"` }
Application Command Interaction Data Option Structure https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-application-command-interaction-data-option-structure
type ApplicationCommandInteractionMetadata ¶ added in v1.10.2
type ApplicationCommandInteractionMetadata struct { User *User `json:"user"` AuthorizingIntegrationOwners map[Flag]string `json:"authorizing_integration_owners"` OriginalResponseMessageID *string `json:"original_response_message_id,omitempty"` TargetUser *User `json:"target_user,omitempty"` TargetMessageID *string `json:"target_message_id,omitempty"` ID string `json:"id"` Type Flag `json:"type"` }
Application Command Interaction Metadata Structure https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-application-command-interaction-metadata-structure
func (ApplicationCommandInteractionMetadata) MessageInteractionMetadata ¶ added in v1.10.2
func (d ApplicationCommandInteractionMetadata) MessageInteractionMetadata() Flag
type ApplicationCommandOption ¶
type ApplicationCommandOption struct { MinValue *float64 `json:"min_value,omitempty"` Autocomplete *bool `json:"autocomplete,omitempty"` NameLocalizations *map[string]string `json:"name_localizations,omitempty"` MaxLength *int `json:"max_length,omitempty"` DescriptionLocalizations *map[string]string `json:"description_localizations,omitempty"` Required *bool `json:"required,omitempty"` MinLength *int `json:"min_length,omitempty"` MaxValue *float64 `json:"max_value,omitempty"` Description string `json:"description"` Name string `json:"name"` ChannelTypes Flags `json:"channel_types,omitempty"` Options []*ApplicationCommandOption `json:"options,omitempty"` Choices []*ApplicationCommandOptionChoice `json:"choices,omitempty"` Type Flag `json:"type"` }
Application Command Option Structure https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
type ApplicationCommandOptionChoice ¶
type ApplicationCommandOptionChoice struct { Name string `json:"name"` NameLocalizations *map[string]string `json:"name_localizations,omitempty"` Value Value `json:"value"` }
Application Command Option Choice https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure
type ApplicationCommandPermissions ¶
type ApplicationCommandPermissions struct { ID string `json:"id"` Type Flag `json:"type"` Permission bool `json:"permission"` }
Application Command Permissions Structure https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-structure
type ApplicationCommandPermissionsUpdate ¶
type ApplicationCommandPermissionsUpdate struct {
*GuildApplicationCommandPermissions
}
Application Command Permissions Update https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update
type ApplicationIntegrationTypeConfiguration ¶ added in v1.10.2
type ApplicationIntegrationTypeConfiguration struct {
OAuth2InstallParams *InstallParams `json:"oauth2_install_params,omitempty"`
}
Application Integration Type Configuration Object https://discord.com/developers/docs/resources/application#application-object-application-integration-type-configuration-object
type ApplicationRoleConnection ¶ added in v1.10.1
type ApplicationRoleConnection struct { PlatformName *string `json:"platform_name"` PlatformUsername *string `json:"platform_user"` Metadata map[string]string `json:"metadata"` }
Application Role Connection Structure https://discord.com/developers/docs/resources/user#application-role-connection-object
type ApplicationRoleConnectionMetadata ¶ added in v1.10.1
type ApplicationRoleConnectionMetadata struct { NameLocalizations *map[string]string `json:"name_localizations,omitempty"` DescriptionLocalizations *map[string]string `json:"description_localizations,omitempty"` Key string `json:"key"` Name string `json:"name"` Description string `json:"description"` Type Flag `json:"type"` }
Application Role Connection Metadata Object https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-structure
type Attachment ¶
type Attachment struct { Width **int `json:"width,omitempty"` Height **int `json:"height,omitempty"` Title *string `json:"title,omitempty"` Description *string `json:"description,omitempty"` ContentType *string `json:"content_type,omitempty"` Flags *BitFlag `json:"flags,omitempty"` Waveform *string `json:"waveform,omitempty"` DurationSeconds *float64 `json:"duration_secs,omitempty"` Emphemeral *bool `json:"ephemeral,omitempty"` ID string `json:"id"` ProxyURL string `json:"proxy_url"` URL string `json:"url"` Filename string `json:"filename"` Size int `json:"size"` }
Attachment Object https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
type AuditLog ¶
type AuditLog struct { ApplicationCommands []*ApplicationCommand `json:"application_commands"` AuditLogEntries []*AuditLogEntry `json:"audit_log_entries"` GuildScheduledEvents []*GuildScheduledEvent `json:"guild_scheduled_events"` Integration []*Integration `json:"integrations"` Threads []*Channel `json:"threads"` Users []*User `json:"users"` Webhooks []*Webhook `json:"webhooks"` }
Audit Log Object https://discord.com/developers/docs/resources/audit-log
type AuditLogChange ¶
type AuditLogChange struct { Key string `json:"key"` NewValue json.RawMessage `json:"new_value,omitempty"` OldValue json.RawMessage `json:"old_value,omitempty"` }
Audit Log Change Object https://discord.com/developers/docs/resources/audit-log#audit-log-change-object
type AuditLogEntry ¶
type AuditLogEntry struct { TargetID *string `json:"target_id"` UserID *string `json:"user_id"` Options *AuditLogOptions `json:"options,omitempty"` Reason *string `json:"reason,omitempty"` ID string `json:"id"` Changes []*AuditLogChange `json:"changes,omitempty"` ActionType Flag `json:"action_type"` }
Audit Log Entry Object https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure
type AuditLogOptions ¶
type AuditLogOptions struct { ApplicationID string `json:"application_id"` AutoModerationRuleName string `json:"auto_moderation_rule_name"` AutoModerationRuleTriggerType string `json:"auto_moderation_rule_trigger_type"` ChannelID string `json:"channel_id"` Count string `json:"count"` DeleteMemberDays string `json:"delete_member_days"` ID string `json:"id"` MembersRemoved string `json:"members_removed"` MessageID string `json:"message_id"` RoleName string `json:"role_name"` Type string `json:"type"` }
Optional Audit Entry Info https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
type Authentication ¶
type Authentication struct { // Token represents the Authentication Token used to authenticate the bot. Token string // TokenType represents the type of the Authentication Token. TokenType string // Header represents a Token Authorization Header. Header string }
Authentication represents authentication parameters required to authenticate the bot. https://discord.com/developers/docs/reference#authentication
func BearerToken ¶
func BearerToken(token string) *Authentication
BearerToken uses a given token to return a valid Authentication Object for a bearer token type.
func BotToken ¶
func BotToken(token string) *Authentication
BotToken uses a given token to return a valid Authentication Object for a bot token type.
type Authorization ¶
type Authorization struct { // ClientID represents the application's client_id. ClientID string // ClientSecret represents the application's client_secret. ClientSecret string // RedirectURI represents the registered URL of the application. // // The URL should be non-url-encoded (i.e "https://localhost"), // NOT url-encoded (i.e "https%3A%2F%2Flocalhost"). RedirectURI string // state represents the state parameter used to prevent CSRF and Clickjacking. // https://discord.com/developers/docs/topics/oauth2#state-and-security State string // prompt controls how the authorization flow handles existing authorizations. Prompt string // Scopes represents a list of OAuth2 scopes. Scopes []string }
Authorization represents authorization parameters required to authorize a client's access to resources.
type AuthorizationURL ¶
type AuthorizationURL struct { ResponseType string `url:"response_type,omitempty"` ClientID string `url:"client_id,omitempty"` Scope string `url:"scope,omitempty"` State string `url:"state,omitempty"` RedirectURI string `url:"redirect_uri,omitempty"` Prompt string `url:"prompt,omitempty"` }
Authorization URL GET /oauth2/authorize https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-authorization-url-example
type AutoModerationAction ¶
type AutoModerationAction struct { Metadata *ActionMetadata `json:"metadata,omitempty"` Type Flag `json:"type"` }
Auto Moderation Action Structure https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object
type AutoModerationActionExecution ¶
type AutoModerationActionExecution struct { Action AutoModerationAction `json:"action"` ChannelID *string `json:"channel_id,omitempty"` MessageID *string `json:"message_id,omitempty"` AlertSystemMessageID *string `json:"alert_system_message_id,omitempty"` MatchedKeyword *string `json:"matched_keyword"` MatchedContent *string `json:"matched_content"` GuildID string `json:"guild_id"` RuleID string `json:"rule_id"` UserID string `json:"user_id"` Content string `json:"content"` RuleTriggerType Flag `json:"rule_trigger_type"` }
Auto Moderation Action Execution https://discord.com/developers/docs/topics/gateway-events#auto-moderation-action-execution
type AutoModerationRule ¶
type AutoModerationRule struct { ID string `json:"id"` GuildID string `json:"guild_id"` Name string `json:"name"` CreatorID string `json:"creator_id"` Actions []*AutoModerationAction `json:"actions"` ExemptRoles []string `json:"exempt_roles"` ExemptChannels []string `json:"exempt_channels"` TriggerMetadata TriggerMetadata `json:"trigger_metadata"` EventType Flag `json:"event_type"` TriggerType Flag `json:"trigger_type"` Enabled bool `json:"enabled"` }
Auto Moderation Rule Structure https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-auto-moderation-rule-structure
type AutoModerationRuleCreate ¶
type AutoModerationRuleCreate struct {
*AutoModerationRule
}
Auto Moderation Rule Create https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create
type AutoModerationRuleDelete ¶
type AutoModerationRuleDelete struct {
*AutoModerationRule
}
Auto Moderation Rule Delete https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete
type AutoModerationRuleUpdate ¶
type AutoModerationRuleUpdate struct {
*AutoModerationRule
}
Auto Moderation Rule Update https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update
type Autocomplete ¶
type Autocomplete struct {
Choices []*ApplicationCommandOptionChoice `json:"choices"`
}
Autocomplete https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-autocomplete
func (Autocomplete) InteractionCallbackDataType ¶
func (d Autocomplete) InteractionCallbackDataType() Flag
type AvatarDecorationData ¶ added in v1.10.2
Avatar Decoration Data Structure https://discord.com/developers/docs/resources/user#avatar-decoration-data-object-avatar-decoration-data-structure
type Ban ¶
Guild Ban Object https://discord.com/developers/docs/resources/guild#ban-object
type BatchEditApplicationCommandPermissions ¶
type BatchEditApplicationCommandPermissions struct {
GuildID string
}
Batch Edit Application Command Permissions PUT /applications/{application.id}/guilds/{guild.id}/commands/permissions https://discord.com/developers/docs/interactions/application-commands#batch-edit-application-command-permissions
func (*BatchEditApplicationCommandPermissions) Send ¶
func (r *BatchEditApplicationCommandPermissions) Send(bot *Client) (*GuildApplicationCommandPermissions, error)
Send sends a BatchEditApplicationCommandPermissions request to Discord and returns a GuildApplicationCommandPermissions.
type BeginGuildPrune ¶
type BeginGuildPrune struct { GuildID string `json:"-"` IncludeRoles []string `json:"include_roles"` Days int `json:"days"` ComputePruneCount bool `json:"compute_prune_count"` }
Begin Guild Prune POST /guilds/{guild.id}/prune https://discord.com/developers/docs/resources/guild#begin-guild-prune
func (*BeginGuildPrune) Send ¶
func (r *BeginGuildPrune) Send(bot *Client) error
Send sends a BeginGuildPrune request to Discord and returns a error.
type BitFlag ¶
type BitFlag uint64
BitFlag represents an alias for a Discord API Bitwise Flag denoted by 1 << x.
const ( // GUILD_CREATE // GUILD_UPDATE // GUILD_DELETE // GUILD_ROLE_CREATE // GUILD_ROLE_UPDATE // GUILD_ROLE_DELETE // CHANNEL_CREATE // CHANNEL_UPDATE // CHANNEL_DELETE // CHANNEL_PINS_UPDATE // THREAD_CREATE // THREAD_UPDATE // THREAD_DELETE // THREAD_LIST_SYNC // THREAD_MEMBER_UPDATE // THREAD_MEMBERS_UPDATE * // STAGE_INSTANCE_CREATE // STAGE_INSTANCE_UPDATE // STAGE_INSTANCE_DELETE FlagIntentGUILDS BitFlag = 1 << 0 // GUILD_MEMBER_ADD // GUILD_MEMBER_UPDATE // GUILD_MEMBER_REMOVE // THREAD_MEMBERS_UPDATE * FlagIntentGUILD_MEMBERS BitFlag = 1 << 1 // GUILD_AUDIT_LOG_ENTRY_CREATE // GUILD_BAN_ADD // GUILD_BAN_REMOVE FlagIntentGUILD_MODERATION BitFlag = 1 << 2 // GUILD_EMOJIS_UPDATE // GUILD_STICKERS_UPDATE // GUILD_SOUNDBOARD_SOUND_CREATE // GUILD_SOUNDBOARD_SOUND_UPDATE // GUILD_SOUNDBOARD_SOUND_DELETE // GUILD_SOUNDBOARD_SOUNDS_UPDATE FlagIntentGUILD_EXPRESSIONS BitFlag = 1 << 3 // GUILD_INTEGRATIONS_UPDATE // INTEGRATION_CREATE // INTEGRATION_UPDATE // INTEGRATION_DELETE FlagIntentGUILD_INTEGRATIONS BitFlag = 1 << 4 // WEBHOOKS_UPDATE FlagIntentGUILD_WEBHOOKS BitFlag = 1 << 5 // INVITE_CREATE // INVITE_DELETE FlagIntentGUILD_INVITES BitFlag = 1 << 6 // VOICE_CHANNEL_EFFECT_SEND // VOICE_STATE_UPDATE FlagIntentGUILD_VOICE_STATES BitFlag = 1 << 7 // PRESENCE_UPDATE FlagIntentGUILD_PRESENCES BitFlag = 1 << 8 // MESSAGE_CREATE // MESSAGE_UPDATE // MESSAGE_DELETE // MESSAGE_DELETE_BULK FlagIntentGUILD_MESSAGES BitFlag = 1 << 9 // MESSAGE_REACTION_ADD // MESSAGE_REACTION_REMOVE // MESSAGE_REACTION_REMOVE_ALL // MESSAGE_REACTION_REMOVE_EMOJI FlagIntentGUILD_MESSAGE_REACTIONS BitFlag = 1 << 10 // TYPING_START FlagIntentGUILD_MESSAGE_TYPING BitFlag = 1 << 11 FlagIntentDIRECT_MESSAGE_TYPING BitFlag = 1 << 14 // MESSAGE_CREATE // MESSAGE_UPDATE // MESSAGE_DELETE // CHANNEL_PINS_UPDATE FlagIntentDIRECT_MESSAGES BitFlag = 1 << 12 // MESSAGE_REACTION_ADD // MESSAGE_REACTION_REMOVE // MESSAGE_REACTION_REMOVE_ALL // MESSAGE_REACTION_REMOVE_EMOJI FlagIntentDIRECT_MESSAGE_REACTIONS BitFlag = 1 << 13 FlagIntentMESSAGE_CONTENT BitFlag = 1 << 15 // GUILD_SCHEDULED_EVENT_CREATE // GUILD_SCHEDULED_EVENT_UPDATE // GUILD_SCHEDULED_EVENT_DELETE // GUILD_SCHEDULED_EVENT_USER_ADD // GUILD_SCHEDULED_EVENT_USER_REMOVE FlagIntentGUILD_SCHEDULED_EVENTS BitFlag = 1 << 16 // AUTO_MODERATION_RULE_CREATE // AUTO_MODERATION_RULE_UPDATE // AUTO_MODERATION_RULE_DELETE FlagIntentAUTO_MODERATION_CONFIGURATION BitFlag = 1 << 20 // AUTO_MODERATION_ACTION_EXECUTION FlagIntentAUTO_MODERATION_EXECUTION BitFlag = 1 << 21 // MESSAGE_POLL_VOTE_ADD // MESSAGE_POLL_VOTE_REMOVE FlagIntentGUILD_MESSAGE_POLLS BitFlag = 1 << 24 // MESSAGE_POLL_VOTE_ADD // MESSAGE_POLL_VOTE_REMOVE FlagIntentDIRECT_MESSAGE_POLLS BitFlag = 1 << 25 )
List of Intents https://discord.com/developers/docs/topics/gateway#list-of-intents
const ( FlagApplicationAPPLICATION_AUTO_MODERATION_RULE_CREATE_BADGE BitFlag = 1 << 6 FlagApplicationGATEWAY_PRESENCE BitFlag = 1 << 12 FlagApplicationGATEWAY_PRESENCE_LIMITED BitFlag = 1 << 13 FlagApplicationGATEWAY_GUILD_MEMBERS BitFlag = 1 << 14 FlagApplicationGATEWAY_GUILD_MEMBERS_LIMITED BitFlag = 1 << 15 FlagApplicationVERIFICATION_PENDING_GUILD_LIMIT BitFlag = 1 << 16 FlagApplicationEMBEDDED BitFlag = 1 << 17 FlagApplicationGATEWAY_MESSAGE_CONTENT BitFlag = 1 << 18 FlagApplicationGATEWAY_MESSAGE_CONTENT_LIMITED BitFlag = 1 << 19 FlagApplicationAPPLICATION_COMMAND_BADGE BitFlag = 1 << 23 )
Application Flags https://discord.com/developers/docs/resources/application#application-object-application-flags
const ( FlagMessageCROSSPOSTED BitFlag = 1 << 0 FlagMessageIS_CROSSPOST BitFlag = 1 << 1 FlagMessageSUPPRESS_EMBEDS BitFlag = 1 << 2 FlagMessageSOURCE_MESSAGE_DELETED BitFlag = 1 << 3 FlagMessageURGENT BitFlag = 1 << 4 FlagMessageHAS_THREAD BitFlag = 1 << 5 FlagMessageEPHEMERAL BitFlag = 1 << 6 FlagMessageLOADING BitFlag = 1 << 7 FlagMessageFAILED_TO_MENTION_SOME_ROLES_IN_THREAD BitFlag = 1 << 8 FlagMessageSUPPRESS_NOTIFICATIONS BitFlag = 1 << 12 FlagMessageIS_VOICE_MESSAGE BitFlag = 1 << 13 FlagMessageHAS_SNAPSHOT BitFlag = 1 << 14 )
Message Flags https://discord.com/developers/docs/resources/channel#message-object-message-flags
const ( FlagSKUFlagAVAILABLE BitFlag = 1 << 2 FlagSKUFlagGUILD_SUBSCRIPTION BitFlag = 1 << 7 FlagSKUFlagUSER_SUBSCRIPTION BitFlag = 1 << 8 )
SKU Flags https://discord.com/developers/docs/resources/sku#sku-object-sku-flags
const ( FlagSystemChannelSUPPRESS_JOIN_NOTIFICATIONS BitFlag = 1 << 0 FlagSystemChannelSUPPRESS_PREMIUM_SUBSCRIPTIONS BitFlag = 1 << 1 FlagSystemChannelSUPPRESS_GUILD_REMINDER_NOTIFICATIONS BitFlag = 1 << 2 FlagSystemChannelSUPPRESS_JOIN_NOTIFICATION_REPLIES BitFlag = 1 << 3 FlagSystemChannelSUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATIONS BitFlag = 1 << 4 FlagSystemChannelSUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATION_REPLIES BitFlag = 1 << 5 )
System Channel Flags https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
const ( FlagGuildMemberDID_REJOIN BitFlag = 1 << 0 FlagGuildMemberCOMPLETED_ONBOARDING BitFlag = 1 << 1 FlagGuildMemberBYPASSES_VERIFICATION BitFlag = 1 << 2 FlagGuildMemberSTARTED_ONBOARDING BitFlag = 1 << 3 FlagGuildMemberIS_GUEST BitFlag = 1 << 4 FlagGuildMemberSTARTED_HOME_ACTIONS BitFlag = 1 << 5 FlagGuildMemberCOMPLETED_HOME_ACTIONS BitFlag = 1 << 6 FlagGuildMemberAUTOMOD_QUARANTINED_USERNAME BitFlag = 1 << 7 FlagGuildMemberDM_SETTINGS_UPSELL_ACKNOWLEDGED BitFlag = 1 << 9 )
Guild Member Flags https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-flags
const ( FlagUserNONE BitFlag = 0 FlagUserSTAFF BitFlag = 1 << 0 FlagUserPARTNER BitFlag = 1 << 1 FlagUserHYPESQUAD BitFlag = 1 << 2 FlagUserBUG_HUNTER_LEVEL_1 BitFlag = 1 << 3 FlagUserHYPESQUAD_ONLINE_HOUSE_ONE BitFlag = 1 << 6 FlagUserHYPESQUAD_ONLINE_HOUSE_TWO BitFlag = 1 << 7 FlagUserHYPESQUAD_ONLINE_HOUSE_THREE BitFlag = 1 << 8 FlagUserPREMIUM_EARLY_SUPPORTER BitFlag = 1 << 9 FlagUserTEAM_PSEUDO_USER BitFlag = 1 << 10 FlagUserBUG_HUNTER_LEVEL_2 BitFlag = 1 << 14 FlagUserVERIFIED_BOT BitFlag = 1 << 16 FlagUserVERIFIED_DEVELOPER BitFlag = 1 << 17 FlagUserCERTIFIED_MODERATOR BitFlag = 1 << 18 FlagUserBOT_HTTP_INTERACTIONS BitFlag = 1 << 19 FlagUserACTIVE_DEVELOPER BitFlag = 1 << 22 )
User Flags https://discord.com/developers/docs/resources/user#user-object-user-flags
const ( FlagBitwisePermissionCREATE_INSTANT_INVITE BitFlag = 1 << 0 FlagBitwisePermissionKICK_MEMBERS BitFlag = 1 << 1 FlagBitwisePermissionBAN_MEMBERS BitFlag = 1 << 2 FlagBitwisePermissionADMINISTRATOR BitFlag = 1 << 3 FlagBitwisePermissionMANAGE_CHANNELS BitFlag = 1 << 4 FlagBitwisePermissionMANAGE_GUILD BitFlag = 1 << 5 FlagBitwisePermissionADD_REACTIONS BitFlag = 1 << 6 FlagBitwisePermissionVIEW_AUDIT_LOG BitFlag = 1 << 7 FlagBitwisePermissionPRIORITY_SPEAKER BitFlag = 1 << 8 FlagBitwisePermissionSTREAM BitFlag = 1 << 9 FlagBitwisePermissionVIEW_CHANNEL BitFlag = 1 << 10 FlagBitwisePermissionSEND_MESSAGES BitFlag = 1 << 11 FlagBitwisePermissionSEND_TTS_MESSAGES BitFlag = 1 << 12 FlagBitwisePermissionMANAGE_MESSAGES BitFlag = 1 << 13 FlagBitwisePermissionEMBED_LINKS BitFlag = 1 << 14 FlagBitwisePermissionATTACH_FILES BitFlag = 1 << 15 FlagBitwisePermissionREAD_MESSAGE_HISTORY BitFlag = 1 << 16 FlagBitwisePermissionMENTION_EVERYONE BitFlag = 1 << 17 FlagBitwisePermissionUSE_EXTERNAL_EMOJIS BitFlag = 1 << 18 FlagBitwisePermissionVIEW_GUILD_INSIGHTS BitFlag = 1 << 19 FlagBitwisePermissionCONNECT BitFlag = 1 << 20 FlagBitwisePermissionSPEAK BitFlag = 1 << 21 FlagBitwisePermissionMUTE_MEMBERS BitFlag = 1 << 22 FlagBitwisePermissionDEAFEN_MEMBERS BitFlag = 1 << 23 FlagBitwisePermissionMOVE_MEMBERS BitFlag = 1 << 24 FlagBitwisePermissionUSE_VAD BitFlag = 1 << 25 FlagBitwisePermissionCHANGE_NICKNAME BitFlag = 1 << 26 FlagBitwisePermissionMANAGE_NICKNAMES BitFlag = 1 << 27 FlagBitwisePermissionMANAGE_ROLES BitFlag = 1 << 28 FlagBitwisePermissionMANAGE_WEBHOOKS BitFlag = 1 << 29 FlagBitwisePermissionMANAGE_GUILD_EXPRESSIONS BitFlag = 1 << 30 FlagBitwisePermissionUSE_APPLICATION_COMMANDS BitFlag = 1 << 31 FlagBitwisePermissionREQUEST_TO_SPEAK BitFlag = 1 << 32 FlagBitwisePermissionMANAGE_EVENTS BitFlag = 1 << 33 FlagBitwisePermissionMANAGE_THREADS BitFlag = 1 << 34 FlagBitwisePermissionCREATE_PUBLIC_THREADS BitFlag = 1 << 35 FlagBitwisePermissionCREATE_PRIVATE_THREADS BitFlag = 1 << 36 FlagBitwisePermissionUSE_EXTERNAL_STICKERS BitFlag = 1 << 37 FlagBitwisePermissionSEND_MESSAGES_IN_THREADS BitFlag = 1 << 38 FlagBitwisePermissionUSE_EMBEDDED_ACTIVITIES BitFlag = 1 << 39 FlagBitwisePermissionMODERATE_MEMBERS BitFlag = 1 << 40 FlagBitwisePermissionVIEW_CREATOR_MONETIZATION_ANALYTICS BitFlag = 1 << 41 FlagBitwisePermissionUSE_SOUNDBOARD BitFlag = 1 << 42 FlagBitwisePermissionCREATE_GUILD_EXPRESSIONS BitFlag = 1 << 43 FlagBitwisePermissionCREATE_EVENTS BitFlag = 1 << 44 FlagBitwisePermissionUSE_EXTERNAL_SOUNDS BitFlag = 1 << 45 FlagBitwisePermissionSEND_VOICE_MESSAGES BitFlag = 1 << 46 FlagBitwisePermissionSEND_POLLS BitFlag = 1 << 49 FlagBitwisePermissionUSE_EXTERNAL_APPS BitFlag = 1 << 50 )
Bitwise Permission Flags https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
const ( FlagActivityINSTANCE BitFlag = 1 << 0 FlagActivityJOIN BitFlag = 1 << 1 FlagActivitySPECTATE BitFlag = 1 << 2 FlagActivityJOIN_REQUEST BitFlag = 1 << 3 FlagActivitySYNC BitFlag = 1 << 4 FlagActivityPLAY BitFlag = 1 << 5 FlagActivityPARTY_PRIVACY_FRIENDS BitFlag = 1 << 6 FlagActivityPARTY_PRIVACY_VOICE_CHANNEL BitFlag = 1 << 7 FlagActivityEMBEDDED BitFlag = 1 << 8 )
Activity Flags https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
const (
IN_PROMPT BitFlag = 1 << 0
)
Role Flags https://discord.com/developers/docs/topics/permissions#role-object-role-flags
const (
IS_REMIX BitFlag = 1 << 2
)
Attachment Flags https://discord.com/developers/docs/resources/channel#attachment-object-attachment-flags
type BotAuth ¶
type BotAuth struct { ClientID string `url:"client_id"` Scope string `url:"scope"` GuildID string `url:"guild_id"` Permissions BitFlag `url:"permissions"` DisableGuildSelect bool `url:"disable_guild_select"` }
Bot Auth Parameters GET /oauth2/authorize https://discord.com/developers/docs/topics/oauth2#bot-authorization-flow-bot-auth-parameters
type BotAuthParams ¶
type BotAuthParams struct { // Bot provides the client_id and scopes parameters. Bot *Client // GuildID pre-selects a guild in the authorization prompt. GuildID string // ResponseType provides the type of response the OAuth2 flow will return. // // In the context of bot authorization, response_type is only provided when // a scope outside of `bot` and `applications.commands` is requested. ResponseType string // Permissions represents the permissions the bot is requesting. Permissions BitFlag // DisableGuildSelect disables the ability to select other guilds // in the authorization prompt (when GuildID is provided). DisableGuildSelect bool }
BotAuthParams represents parameters used to generate a bot authorization URL.
type Bucket ¶
type Bucket struct { // Date represents the time at which Discord received the last request of the Bucket. // // Date is only applicable to Global Rate Limit Buckets. Date time.Time // Expiry represents the time at which the Bucket will reset (or become outdated). Expiry time.Time // ID represents the Bucket ID. ID string // Limit represents the amount of requests a Bucket can send per reset. Limit int16 // Remaining represents the amount of requests a Bucket can send until the next reset. Remaining int16 // Pending represents the amount of requests that are sent and awaiting a response. Pending int16 }
Bucket represents a Discord API Rate Limit Bucket.
func (*Bucket) ConfirmDate ¶
ConfirmDate confirms the usage of a given amount of tokens for a Discord API Rate Limit Bucket, using the bucket's current expiry and given (Discord Header) Date time.
Used for the Global Rate Limit Bucket.
func (*Bucket) ConfirmHeader ¶
func (b *Bucket) ConfirmHeader(amount int16, header RateLimitHeader)
ConfirmHeader confirms the usage of a given amount of tokens for a Discord API Rate Limit Bucket, using a given Route ID and respective Discord Rate Limit Header.
Used for Route Rate Limits.
type BulkDeleteMessages ¶
Bulk Delete Messages POST /channels/{channel.id}/messages/bulk-delete https://discord.com/developers/docs/resources/channel#bulk-delete-messages
func (*BulkDeleteMessages) Send ¶
func (r *BulkDeleteMessages) Send(bot *Client) error
Send sends a BulkDeleteMessages request to Discord and returns a error.
type BulkOverwriteGlobalApplicationCommands ¶
type BulkOverwriteGlobalApplicationCommands struct {
ApplicationCommands []*ApplicationCommand `json:"commands"`
}
Bulk Overwrite Global Application Commands PUT /applications/{application.id}/commands https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands
func (*BulkOverwriteGlobalApplicationCommands) MarshalJSON ¶
func (r *BulkOverwriteGlobalApplicationCommands) MarshalJSON() ([]byte, error)
func (*BulkOverwriteGlobalApplicationCommands) Send ¶
func (r *BulkOverwriteGlobalApplicationCommands) Send(bot *Client) ([]*ApplicationCommand, error)
Send sends a BulkOverwriteGlobalApplicationCommands request to Discord and returns a []*ApplicationCommand.
type BulkOverwriteGuildApplicationCommands ¶
type BulkOverwriteGuildApplicationCommands struct { GuildID string `json:"-"` ApplicationCommands []*ApplicationCommand `json:"commands"` }
Bulk Overwrite Guild Application Commands PUT /applications/{application.id}/guilds/{guild.id}/commands https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
func (*BulkOverwriteGuildApplicationCommands) MarshalJSON ¶
func (r *BulkOverwriteGuildApplicationCommands) MarshalJSON() ([]byte, error)
func (*BulkOverwriteGuildApplicationCommands) Send ¶
func (r *BulkOverwriteGuildApplicationCommands) Send(bot *Client) ([]*ApplicationCommand, error)
Send sends a BulkOverwriteGuildApplicationCommands request to Discord and returns a []*ApplicationCommand.
type Button ¶
type Button struct { Label *string `json:"label,omitempty"` Emoji *Emoji `json:"emoji,omitempty"` CustomID *string `json:"custom_id,omitempty"` SKUID *string `json:"sku_id,omitempty"` URL *string `json:"url,omitempty"` Disabled *bool `json:"disabled,omitempty"` Type Flag `json:"type"` Style Flag `json:"style"` }
Button Object https://discord.com/developers/docs/interactions/message-components#button-object
func (Button) ComponentType ¶
type Channel ¶
type Channel struct { Managed *bool `json:"managed,omitempty"` Position *int `json:"position,omitempty"` GuildID *string `json:"guild_id,omitempty"` ParentID **string `json:"parent_id,omitempty"` DefaultForumLayout *Flag `json:"default_forum_layout,omitempty"` LastPinTimestamp **time.Time `json:"last_pin_timestamp,omitempty"` Topic **string `json:"topic,omitempty"` NSFW *bool `json:"nsfw,omitempty"` LastMessageID **string `json:"last_message_id,omitempty"` Bitrate *int `json:"bitrate,omitempty"` UserLimit *int `json:"user_limit,omitempty"` RateLimitPerUser *int `json:"rate_limit_per_user,omitempty"` DefaultThreadRateLimitPerUser *int `json:"default_thread_rate_limit_per_user,omitempty"` Icon **string `json:"icon,omitempty"` OwnerID *string `json:"owner_id,omitempty"` ApplicationID *string `json:"application_id,omitempty"` DefaultSortOrder **Flag `json:"default_sort_order,omitempty"` Type *Flag `json:"type"` Name **string `json:"name,omitempty"` RTCRegion **string `json:"rtc_region,omitempty"` VideoQualityMode *Flag `json:"video_quality_mode,omitempty"` MessageCount *int `json:"message_count,omitempty"` MemberCount *int `json:"member_count,omitempty"` ThreadMetadata *ThreadMetadata `json:"thread_metadata,omitempty"` Member *ThreadMember `json:"member,omitempty"` DefaultAutoArchiveDuration *int `json:"default_auto_archive_duration,omitempty"` Permissions *string `json:"permissions,omitempty"` Flags *BitFlag `json:"flags,omitempty"` TotalMessageSent *int `json:"total_message_sent,omitempty"` DefaultReactionEmoji *DefaultReaction `json:"default_reaction_emoji"` ID string `json:"id"` AppliedTags []string `json:"applied_tags,omitempty"` AvailableTags []*ForumTag `json:"available_tags,omitempty"` Recipients []*User `json:"recipients,omitempty"` PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites,omitempty"` }
Channel Object https://discord.com/developers/docs/resources/channel
type ChannelCreate ¶
type ChannelCreate struct {
*Channel
}
Channel Create https://discord.com/developers/docs/topics/gateway-events#channel-create
type ChannelDelete ¶
type ChannelDelete struct {
*Channel
}
Channel Delete https://discord.com/developers/docs/topics/gateway-events#channel-delete
type ChannelMention ¶
type ChannelMention struct { ID string `json:"id"` GuildID string `json:"guild_id"` Type *Flag `json:"type"` Name string `json:"name"` }
Channel Mention Object https://discord.com/developers/docs/resources/channel#channel-mention-object
type ChannelPinsUpdate ¶
type ChannelPinsUpdate struct { LastPinTimestamp **time.Time `json:"last_pin_timestamp,omitempty"` GuildID string `json:"guild_id,omitempty"` ChannelID string `json:"channel_id"` }
Channel Pins Update https://discord.com/developers/docs/topics/gateway-events#channel-pins-update
type ChannelUpdate ¶
type ChannelUpdate struct {
*Channel
}
Channel Update https://discord.com/developers/docs/topics/gateway-events#channel-update
type Client ¶
type Client struct { // Authentication contains parameters required to authenticate the bot. Authentication *Authentication // Authorization contains parameters required to authorize a client's access to resources. Authorization *Authorization // Config represents parameters used to perform various actions by the client. Config *Config // Handlers represents a bot's event handlers. Handlers *Handlers // VoiceHandlers represents a bot's voice event handlers. VoiceHandlers *VoiceHandlers // Sessions contains sessions a bot uses to interact with the Discord Gateway. Sessions *SessionManager ApplicationID string }
Client represents a Discord Application.
func (*Client) HandleVoice ¶ added in v1.10.2
Handle adds an event handler for the given event to the Voice Connection.
type ClientCredentialsAccessTokenResponse ¶
type ClientCredentialsAccessTokenResponse struct { AccessToken string `json:"access_token,omitempty"` TokenType string `json:"token_type,omitempty"` Scope string `json:"scope,omitempty"` ExpiresIn time.Duration `json:"expires_in,omitempty"` }
Client Credentials Access Token Response https://discord.com/developers/docs/topics/oauth2#client-credentials-grant-client-credentials-access-token-response
type ClientCredentialsTokenRequest ¶
type ClientCredentialsTokenRequest struct { GrantType string `url:"grant_type,omitempty"` Scope string `url:"scope,omitempty"` }
Client Credentials Token Request POST /oauth2/token https://discord.com/developers/docs/topics/oauth2#client-credentials-grant-client-credentials-token-request-example
func (*ClientCredentialsTokenRequest) Send ¶
func (r *ClientCredentialsTokenRequest) Send(bot *Client) (*AccessTokenResponse, error)
Send sends a ClientCredentialsTokenRequest to Discord and returns a ClientCredentialsTokenRequest.
type ClientStatus ¶
type ClientStatus struct { Desktop *string `json:"desktop,omitempty"` Mobile *string `json:"mobile,omitempty"` Web *string `json:"web,omitempty"` }
Client Status Object https://discord.com/developers/docs/topics/gateway-events#client-status-object
type Component ¶
type Component interface {
ComponentType() Flag
}
Component Object https://discord.com/developers/docs/interactions/message-components#component-object
type Config ¶
type Config struct { // Gateway holds configuration variables that pertain to the Discord Gateway. Gateway Gateway // Request holds configuration variables that pertain to the Discord HTTP API. Request Request }
Config represents parameters used to perform various actions by the client.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a default client configuration.
type Connection ¶
type Connection struct { ID string `json:"id"` Name string `json:"name"` Type string `json:"type"` Revoked *bool `json:"revoked,omitempty"` Integrations []*Integration `json:"integrations,omitempty"` Verified bool `json:"verified"` FriendSync bool `json:"friend_sync"` ShowActivity bool `json:"show_activity"` TwoWayLink bool `json:"two_way_link"` Visibility Flag `json:"visibility"` }
User Connection Object https://discord.com/developers/docs/resources/user#connection-object-connection-structure
type ConsumeEntitlement ¶ added in v1.10.2
type ConsumeEntitlement struct {
EntitlementID string
}
Consume an Entitlement POST /applications/{application.id}/entitlements/{entitlement.id}/consume https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement
func (*ConsumeEntitlement) Send ¶ added in v1.10.2
func (r *ConsumeEntitlement) Send(bot *Client) error
Send sends a ConsumeEntitlement request to Discord and returns a error.
type CreateApplicationEmoji ¶ added in v1.10.2
Create Application Emoji POST /applications/{application.id}/emojis https://discord.com/developers/docs/resources/emoji#create-application-emoji
type CreateAutoModerationRule ¶
type CreateAutoModerationRule struct { TriggerMetadata *TriggerMetadata `json:"trigger_metadata,omitempty"` Enabled *bool `json:"enabled,omitempty"` GuildID string `json:"-"` Name string `json:"name"` Actions []*AutoModerationAction `json:"actions"` ExemptRoles []string `json:"exempt_roles,omitempty"` ExemptChannels []string `json:"exempt_channels,omitempty"` EventType Flag `json:"event_type"` TriggerType Flag `json:"trigger_type"` }
Create Auto Moderation Rule POST /guilds/{guild.id}/auto-moderation/rules https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
func (*CreateAutoModerationRule) Send ¶
func (r *CreateAutoModerationRule) Send(bot *Client) (*AutoModerationRule, error)
Send sends a CreateAutoModerationRule request to Discord and returns a AutoModerationRule.
type CreateChannelInvite ¶
type CreateChannelInvite struct { MaxAge *int `json:"max_age"` MaxUses *int `json:"max_uses"` ChannelID string `json:"-"` TargetUserID string `json:"target_user_id"` TargetApplicationID string `json:"target_application_id"` Temporary bool `json:"temporary"` Unique bool `json:"unique"` TargetType Flag `json:"target_type"` }
Create Channel Invite POST /channels/{channel.id}/invites https://discord.com/developers/docs/resources/channel#create-channel-invite
type CreateDM ¶
type CreateDM struct {
RecipientID string `json:"recipient_id"`
}
Create DM POST /users/@me/channels https://discord.com/developers/docs/resources/user#create-dm
type CreateFollowupMessage ¶
type CreateFollowupMessage struct { TTS *bool `json:"tts,omitempty" url:"-"` AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty" url:"-"` ThreadID *string `json:"-" url:"thread_id,omitempty"` Content *string `json:"content,omitempty" url:"-"` Username *string `json:"username,omitempty" url:"-"` AvatarURL *string `json:"avatar_url,omitempty" url:"-"` ThreadName *string `json:"thread_name,omitempty" url:"-"` Flags *BitFlag `json:"flags,omitempty" url:"-"` ApplicationID string `json:"-" url:"-"` InteractionToken string `json:"-" url:"-"` Files []*File `json:"-" url:"-" dasgo:"files"` Components []Component `json:"components,omitempty" url:"-"` Embeds []*Embed `json:"embeds,omitempty" url:"-"` Attachments []*Attachment `json:"attachments,omitempty" url:"-"` }
Create Followup Message POST /webhooks/{application.id}/{interaction.token} https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message
func (*CreateFollowupMessage) Send ¶
func (r *CreateFollowupMessage) Send(bot *Client) (*Message, error)
Send sends a CreateFollowupMessage request to Discord and returns a Message.
func (*CreateFollowupMessage) UnmarshalJSON ¶
func (r *CreateFollowupMessage) UnmarshalJSON(b []byte) error
type CreateGlobalApplicationCommand ¶
type CreateGlobalApplicationCommand struct { NameLocalizations *map[string]string `json:"name_localizations,omitempty"` Description *string `json:"description,omitempty"` DescriptionLocalizations *map[string]string `json:"description_localizations,omitempty"` DefaultMemberPermissions **string `json:"default_member_permissions,omitempty"` Type *Flag `json:"type,omitempty"` NSFW *bool `json:"nsfw,omitempty"` Name string `json:"name,omitempty"` Options []*ApplicationCommandOption `json:"options,omitempty"` IntegrationTypes []Flag `json:"integration_types,omitempty"` Contexts []Flag `json:"contexts"` }
Create Global Application Command POST /applications/{application.id}/commands https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
func (*CreateGlobalApplicationCommand) Send ¶
func (r *CreateGlobalApplicationCommand) Send(bot *Client) (*ApplicationCommand, error)
Send sends a CreateGlobalApplicationCommand request to Discord and returns a ApplicationCommand.
type CreateGroupDM ¶
type CreateGroupDM struct { Nicks map[string]string `json:"nicks"` AccessTokens []*string `json:"access_tokens"` }
Create Group DM POST /users/@me/channels https://discord.com/developers/docs/resources/user#create-group-dm
type CreateGuild ¶
type CreateGuild struct { Region **string `json:"region,omitempty"` Icon *string `json:"icon,omitempty"` VerificationLevel *Flag `json:"verification_level,omitempty"` DefaultMessageNotifications *Flag `json:"default_message_notifications,omitempty"` ExplicitContentFilter *Flag `json:"explicit_content_filter,omitempty"` AfkChannelID *string `json:"afk_channel_id,omitempty"` AfkTimeout *int `json:"afk_timeout,omitempty"` SystemChannelID *string `json:"system_channel_id,omitempty"` SystemChannelFlags *BitFlag `json:"system_channel_flags,omitempty"` Name string `json:"name"` Roles []*Role `json:"roles,omitempty"` Channels []*Channel `json:"channels,omitempty"` }
Create Guild POST /guilds https://discord.com/developers/docs/resources/guild#create-guild
type CreateGuildApplicationCommand ¶
type CreateGuildApplicationCommand struct { NameLocalizations *map[string]string `json:"name_localizations,omitempty"` Description *string `json:"description,omitempty"` DescriptionLocalizations *map[string]string `json:"description_localizations,omitempty"` DefaultMemberPermissions **string `json:"default_member_permissions,omitempty"` Type *Flag `json:"type,omitempty"` NSFW *bool `json:"nsfw,omitempty"` GuildID string `json:"-"` Name string `json:"name"` Options []*ApplicationCommandOption `json:"options,omitempty"` }
Create Guild Application Command POST /applications/{application.id}/guilds/{guild.id}/commands https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command
func (*CreateGuildApplicationCommand) Send ¶
func (r *CreateGuildApplicationCommand) Send(bot *Client) (*ApplicationCommand, error)
Send sends a CreateGuildApplicationCommand request to Discord and returns a ApplicationCommand.
type CreateGuildBan ¶
type CreateGuildBan struct { DeleteMessageSeconds *int `json:"delete_message_seconds,omitempty"` GuildID string `json:"-"` UserID string `json:"-"` }
Create Guild Ban PUT /guilds/{guild.id}/bans/{user.id} https://discord.com/developers/docs/resources/guild#create-guild-ban
func (*CreateGuildBan) Send ¶
func (r *CreateGuildBan) Send(bot *Client) error
Send sends a CreateGuildBan request to Discord and returns a error.
type CreateGuildChannel ¶
type CreateGuildChannel struct { PermissionOverwrites *[]*PermissionOverwrite `json:"permission_overwrites,omitempty"` Type **Flag `json:"type,omitempty"` ParentID **string `json:"parent_id,omitempty"` NSFW **bool `json:"nsfw,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"` DefaultForumLayout **Flag `json:"default_forum_layout,omitempty"` DefaultSortOrder **Flag `json:"default_sort_order,omitempty"` Topic **string `json:"topic,omitempty"` RTCRegion **string `json:"rtc_region,omitempty"` VideoQualityMode **Flag `json:"video_quality_mode,omitempty"` DefaultAutoArchiveDuration **int `json:"default_auto_archive_duration,omitempty"` DefaultReactionEmoji **DefaultReaction `json:"default_reaction_emoji,omitempty"` AvailableTags *[]*ForumTag `json:"available_tags,omitempty"` Name string `json:"name"` GuildID string `json:"-"` }
Create Guild Channel POST /guilds/{guild.id}/channels https://discord.com/developers/docs/resources/guild#create-guild-channel
type CreateGuildEmoji ¶
type CreateGuildEmoji struct { GuildID string `json:"-"` Name string `json:"name"` Image string `json:"image"` Roles []string `json:"roles"` }
Create Guild Emoji POST /guilds/{guild.id}/emojis https://discord.com/developers/docs/resources/emoji#create-guild-emoji
type CreateGuildRole ¶
type CreateGuildRole struct { Name *string `json:"name,omitempty"` Permissions *string `json:"permissions,omitempty"` Color *int `json:"color,omitempty"` Hoist *bool `json:"hoist,omitempty"` Icon **string `json:"icon,omitempty"` UnicodeEmoji **string `json:"unicode_emoji,omitempty"` Mentionable *bool `json:"mentionable,omitempty"` GuildID string `json:"-"` }
Create Guild Role POST /guilds/{guild.id}/roles https://discord.com/developers/docs/resources/guild#create-guild-role
type CreateGuildScheduledEvent ¶
type CreateGuildScheduledEvent struct { ScheduledStartTime time.Time `json:"scheduled_start_time"` ChannelID *string `json:"channel_id,omitempty"` EntityMetadata *GuildScheduledEventEntityMetadata `json:"entity_metadata,omitempty"` ScheduledEndTime *time.Time `json:"scheduled_end_time,omitempty"` Description *string `json:"description,omitempty"` EntityType *Flag `json:"entity_type,omitempty"` Image *string `json:"image,omitempty"` GuildID string `json:"-"` Name string `json:"name"` PrivacyLevel Flag `json:"privacy_level"` }
Create Guild Scheduled Event POST /guilds/{guild.id}/scheduled-events https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
func (*CreateGuildScheduledEvent) Send ¶
func (r *CreateGuildScheduledEvent) Send(bot *Client) (*GuildScheduledEvent, error)
Send sends a CreateGuildScheduledEvent request to Discord and returns a GuildScheduledEvent.
type CreateGuildSoundboardSound ¶ added in v1.10.2
type CreateGuildSoundboardSound struct { Volume **float64 `json:"volume,omitempty"` EmojiID **string `json:"emoji_id,omitempty"` EmojiName **string `json:"emoji_name,omitempty"` GuildID string `json:"-"` Name string `json:"name"` Sound string `json:"sound"` }
Create Guild Soundboard Sound POST /guilds/{guild.id}/soundboard-sounds https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound
func (*CreateGuildSoundboardSound) Send ¶ added in v1.10.2
func (r *CreateGuildSoundboardSound) Send(bot *Client) (*SoundboardSound, error)
Send sends a CreateGuildSoundboardSound request to Discord and returns a SoundboardSound.
type CreateGuildSticker ¶
type CreateGuildSticker struct { GuildID string `json:"-"` Name string `json:"name"` Description string `json:"description"` Tags *string `json:"tags"` File File `json:"-" dasgo:"file"` }
Create Guild Sticker POST /guilds/{guild.id}/stickers https://discord.com/developers/docs/resources/sticker#create-guild-sticker
type CreateGuildTemplate ¶
type CreateGuildTemplate struct { Description **string `json:"description,omitempty"` GuildID string `json:"-"` Name string `json:"name"` }
Create Guild Template POST /guilds/{guild.id}/templates https://discord.com/developers/docs/resources/guild-template#create-guild-template
func (*CreateGuildTemplate) Send ¶
func (r *CreateGuildTemplate) Send(bot *Client) (*GuildTemplate, error)
Send sends a CreateGuildTemplate request to Discord and returns a GuildTemplate.
type CreateGuildfromGuildTemplate ¶
type CreateGuildfromGuildTemplate struct { Icon *string `json:"icon,omitempty"` TemplateCode string `json:"-"` Name string `json:"name"` }
Create Guild from Guild Template POST /guilds/templates/{template.code} https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
func (*CreateGuildfromGuildTemplate) Send ¶
func (r *CreateGuildfromGuildTemplate) Send(bot *Client) ([]*GuildTemplate, error)
Send sends a CreateGuildfromGuildTemplate request to Discord and returns a []*GuildTemplate.
type CreateInteractionResponse ¶
type CreateInteractionResponse struct { *InteractionResponse InteractionID string InteractionToken string }
Create Interaction Response POST /interactions/{interaction.id}/{interaction.token}/callback https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response
func (*CreateInteractionResponse) Send ¶
func (r *CreateInteractionResponse) Send(bot *Client) error
Send sends a CreateInteractionResponse request to Discord and returns a error.
func (*CreateInteractionResponse) UnmarshalJSON ¶
func (e *CreateInteractionResponse) UnmarshalJSON(b []byte) error
type CreateMessage ¶
type CreateMessage struct { MessageReference *MessageReference `json:"message_reference,omitempty"` Content *string `json:"content,omitempty"` Nonce *Nonce `json:"nonce,omitempty"` TTS *bool `json:"tts,omitempty"` AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"` Flags *BitFlag `json:"flags,omitempty"` EnforceNonce *bool `json:"enforce_nonce,omitempty"` ChannelID string `json:"-"` Embeds []*Embed `json:"embeds,omitempty"` Components []Component `json:"components,omitempty"` StickerIDS []string `json:"sticker_ids,omitempty"` Files []*File `json:"-" dasgo:"files,omitempty"` Attachments []*Attachment `json:"attachments,omitempty"` }
Create Message POST /channels/{channel.id}/messages https://discord.com/developers/docs/resources/channel#create-message
type CreateReaction ¶
Create Reaction PUT /channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me https://discord.com/developers/docs/resources/channel#create-reaction
func (*CreateReaction) Send ¶
func (r *CreateReaction) Send(bot *Client) error
Send sends a CreateReaction request to Discord and returns a error.
type CreateStageInstance ¶
type CreateStageInstance struct { PrivacyLevel *Flag `json:"privacy_level,omitempty"` SendStartNotification *bool `json:"send_start_notification,omitempty"` GuildScheduledEventID *string `json:"guild_scheduled_event_id,omitempty"` ChannelID string `json:"channel_id"` Topic string `json:"topic"` }
Create Stage Instance POST /stage-instances https://discord.com/developers/docs/resources/stage-instance#create-stage-instance
func (*CreateStageInstance) Send ¶
func (r *CreateStageInstance) Send(bot *Client) (*StageInstance, error)
Send sends a CreateStageInstance request to Discord and returns a StageInstance.
type CreateTestEntitlement ¶ added in v1.10.2
type CreateTestEntitlement struct { SKUID string `json:"sku_id"` OwnerID string `json:"owner_id"` OwnerType Flag `json:"owner_type"` }
Create Test Entitlement POST /applications/{application.id}/entitlements https://discord.com/developers/docs/resources/entitlement#create-test-entitlement
func (*CreateTestEntitlement) Send ¶ added in v1.10.2
func (r *CreateTestEntitlement) Send(bot *Client) (*Entitlement, error)
Send sends a CreateTestEntitlement request to Discord and returns a Entitlement.
type CreateWebhook ¶
type CreateWebhook struct { Avatar **string `json:"avatar,omitempty"` ChannelID string `json:"-"` Name string `json:"name"` }
Create Webhook POST /channels/{channel.id}/webhooks https://discord.com/developers/docs/resources/webhook#create-webhook
type CrosspostMessage ¶
Crosspost Message POST /channels/{channel.id}/messages/{message.id}/crosspost https://discord.com/developers/docs/resources/channel#crosspost-message
type CurrentAuthorizationInformationResponse ¶
type CurrentAuthorizationInformationResponse struct { Application *Application `json:"application"` Expires *time.Time `json:"expires"` User *User `json:"user,omitempty"` Scopes []int `json:"scopes"` }
Current Authorization Information Response Structure https://discord.com/developers/docs/topics/oauth2#get-current-authorization-information
type DefaultReaction ¶
type DefaultReaction struct { EmojiID *string `json:"emoji_id"` EmojiName *string `json:"emoji_name"` }
Default Reaction Structure https://discord.com/developers/docs/resources/channel#default-reaction-object-default-reaction-structure
type DeleteAllReactions ¶
Delete All Reactions DELETE /channels/{channel.id}/messages/{message.id}/reactions https://discord.com/developers/docs/resources/channel#delete-all-reactions
func (*DeleteAllReactions) Send ¶
func (r *DeleteAllReactions) Send(bot *Client) error
Send sends a DeleteAllReactions request to Discord and returns a error.
type DeleteAllReactionsforEmoji ¶
Delete All Reactions for Emoji DELETE /channels/{channel.id}/messages/{message.id}/reactions/{emoji} https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji
func (*DeleteAllReactionsforEmoji) Send ¶
func (r *DeleteAllReactionsforEmoji) Send(bot *Client) error
Send sends a DeleteAllReactionsforEmoji request to Discord and returns a error.
type DeleteApplicationEmoji ¶ added in v1.10.2
type DeleteApplicationEmoji struct {
EmojiID string
}
Delete Application Emoji DELETE /applications/{application.id}/emojis/{emoji.id} https://discord.com/developers/docs/resources/emoji#delete-application-emoji
func (*DeleteApplicationEmoji) Send ¶ added in v1.10.2
func (r *DeleteApplicationEmoji) Send(bot *Client) error
Send sends a DeleteApplicationEmoji request to Discord and returns a error.
type DeleteAutoModerationRule ¶
Delete Auto Moderation Rule DELETE /guilds/{guild.id}/auto-moderation/rules/{auto_moderation_rule.id} https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule
func (*DeleteAutoModerationRule) Send ¶
func (r *DeleteAutoModerationRule) Send(bot *Client) error
Send sends a DeleteAutoModerationRule request to Discord and returns a error.
type DeleteChannelPermission ¶
Delete Channel Permission DELETE /channels/{channel.id}/permissions/{overwrite.id} https://discord.com/developers/docs/resources/channel#delete-channel-permission
func (*DeleteChannelPermission) Send ¶
func (r *DeleteChannelPermission) Send(bot *Client) error
Send sends a DeleteChannelPermission request to Discord and returns a error.
type DeleteCloseChannel ¶
type DeleteCloseChannel struct {
ChannelID string
}
Delete/Close Channel DELETE /channels/{channel.id} https://discord.com/developers/docs/resources/channel#deleteclose-channel
type DeleteFollowupMessage ¶
Delete Followup Message DELETE /webhooks/{application.id}/{interaction.token}/messages/{message.id} https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message
func (*DeleteFollowupMessage) Send ¶
func (r *DeleteFollowupMessage) Send(bot *Client) error
Send sends a DeleteFollowupMessage request to Discord and returns a error.
type DeleteGlobalApplicationCommand ¶
type DeleteGlobalApplicationCommand struct {
CommandID string
}
Delete Global Application Command DELETE /applications/{application.id}/commands/{command.id} https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command
func (*DeleteGlobalApplicationCommand) Send ¶
func (r *DeleteGlobalApplicationCommand) Send(bot *Client) error
Send sends a DeleteGlobalApplicationCommand request to Discord and returns a error.
type DeleteGuild ¶
type DeleteGuild struct {
GuildID string
}
Delete Guild DELETE /guilds/{guild.id} https://discord.com/developers/docs/resources/guild#delete-guild
func (*DeleteGuild) Send ¶
func (r *DeleteGuild) Send(bot *Client) error
Send sends a DeleteGuild request to Discord and returns a error.
type DeleteGuildApplicationCommand ¶
Delete Guild Application Command DELETE /applications/{application.id}/guilds/{guild.id}/commands/{command.id} https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command
func (*DeleteGuildApplicationCommand) Send ¶
func (r *DeleteGuildApplicationCommand) Send(bot *Client) error
Send sends a DeleteGuildApplicationCommand request to Discord and returns a error.
type DeleteGuildEmoji ¶
Delete Guild Emoji DELETE /guilds/{guild.id}/emojis/{emoji.id} https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
func (*DeleteGuildEmoji) Send ¶
func (r *DeleteGuildEmoji) Send(bot *Client) error
Send sends a DeleteGuildEmoji request to Discord and returns a error.
type DeleteGuildIntegration ¶
Delete Guild Integration DELETE /guilds/{guild.id}/integrations/{integration.id} https://discord.com/developers/docs/resources/guild#delete-guild-integration
func (*DeleteGuildIntegration) Send ¶
func (r *DeleteGuildIntegration) Send(bot *Client) error
Send sends a DeleteGuildIntegration request to Discord and returns a error.
type DeleteGuildRole ¶
Delete Guild Role DELETE /guilds/{guild.id}/roles/{role.id} https://discord.com/developers/docs/resources/guild#delete-guild-role
func (*DeleteGuildRole) Send ¶
func (r *DeleteGuildRole) Send(bot *Client) error
Send sends a DeleteGuildRole request to Discord and returns a error.
type DeleteGuildScheduledEvent ¶
Delete Guild Scheduled Event DELETE /guilds/{guild.id}/scheduled-events/{guild_scheduled_event.id} https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event
func (*DeleteGuildScheduledEvent) Send ¶
func (r *DeleteGuildScheduledEvent) Send(bot *Client) error
Send sends a DeleteGuildScheduledEvent request to Discord and returns a error.
type DeleteGuildSoundboardSound ¶ added in v1.10.2
Delete Guild Soundboard Sound DELETE /guilds/{guild.id}/soundboard-sounds/{sound.id} https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound
func (*DeleteGuildSoundboardSound) Send ¶ added in v1.10.2
func (r *DeleteGuildSoundboardSound) Send(bot *Client) error
Send sends a DeleteGuildSoundboardSound request to Discord and returns a error.
type DeleteGuildSticker ¶
Delete Guild Sticker DELETE /guilds/{guild.id}/stickers/{sticker.id} https://discord.com/developers/docs/resources/sticker#delete-guild-sticker
func (*DeleteGuildSticker) Send ¶
func (r *DeleteGuildSticker) Send(bot *Client) error
Send sends a DeleteGuildSticker request to Discord and returns a error.
type DeleteGuildTemplate ¶
Delete Guild Template DELETE /guilds/{guild.id}/templates/{template.code} https://discord.com/developers/docs/resources/guild-template#delete-guild-template
func (*DeleteGuildTemplate) Send ¶
func (r *DeleteGuildTemplate) Send(bot *Client) (*GuildTemplate, error)
Send sends a DeleteGuildTemplate request to Discord and returns a GuildTemplate.
type DeleteInvite ¶
type DeleteInvite struct {
InviteCode string
}
Delete Invite DELETE /invites/{invite.code} https://discord.com/developers/docs/resources/invite#delete-invite
type DeleteMessage ¶
Delete Message DELETE /channels/{channel.id}/messages/{message.id} https://discord.com/developers/docs/resources/channel#delete-message
func (*DeleteMessage) Send ¶
func (r *DeleteMessage) Send(bot *Client) error
Send sends a DeleteMessage request to Discord and returns a error.
type DeleteOriginalInteractionResponse ¶
type DeleteOriginalInteractionResponse struct {
InteractionToken string
}
Delete Original Interaction Response DELETE /webhooks/{application.id}/{interaction.token}/messages/@original https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response
func (*DeleteOriginalInteractionResponse) Send ¶
func (r *DeleteOriginalInteractionResponse) Send(bot *Client) error
Send sends a DeleteOriginalInteractionResponse request to Discord and returns a error.
type DeleteOwnReaction ¶
Delete Own Reaction DELETE /channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me https://discord.com/developers/docs/resources/channel#delete-own-reaction
func (*DeleteOwnReaction) Send ¶
func (r *DeleteOwnReaction) Send(bot *Client) error
Send sends a DeleteOwnReaction request to Discord and returns a error.
type DeleteStageInstance ¶
type DeleteStageInstance struct {
ChannelID string
}
Delete Stage Instance DELETE /stage-instances/{channel.id} https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance
func (*DeleteStageInstance) Send ¶
func (r *DeleteStageInstance) Send(bot *Client) error
Send sends a DeleteStageInstance request to Discord and returns a error.
type DeleteTestEntitlement ¶ added in v1.10.2
type DeleteTestEntitlement struct {
EntitlementID string
}
Delete Test Entitlement DELETE /applications/{application.id}/entitlements/{entitlement.id} https://discord.com/developers/docs/resources/entitlement#delete-test-entitlement
func (*DeleteTestEntitlement) Send ¶ added in v1.10.2
func (r *DeleteTestEntitlement) Send(bot *Client) error
Send sends a DeleteTestEntitlement request to Discord and returns a error.
type DeleteUserReaction ¶
Delete User Reaction DELETE /channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id} https://discord.com/developers/docs/resources/channel#delete-user-reaction
func (*DeleteUserReaction) Send ¶
func (r *DeleteUserReaction) Send(bot *Client) error
Send sends a DeleteUserReaction request to Discord and returns a error.
type DeleteWebhook ¶
type DeleteWebhook struct {
WebhookID string
}
Delete Webhook DELETE /webhooks/{webhook.id} https://discord.com/developers/docs/resources/webhook#delete-webhook
func (*DeleteWebhook) Send ¶
func (r *DeleteWebhook) Send(bot *Client) error
Send sends a DeleteWebhook request to Discord and returns a error.
type DeleteWebhookMessage ¶
type DeleteWebhookMessage struct { ThreadID *string `url:"thread_id,omitempty"` WebhookID string `url:"-"` WebhookToken string `url:"-"` MessageID string `url:"-"` }
Delete Webhook Message DELETE /webhooks/{webhook.id}/{webhook.token}/messages/{message.id} https://discord.com/developers/docs/resources/webhook#delete-webhook-message
func (*DeleteWebhookMessage) Send ¶
func (r *DeleteWebhookMessage) Send(bot *Client) error
Send sends a DeleteWebhookMessage request to Discord and returns a error.
type DeleteWebhookwithToken ¶
Delete Webhook with Token DELETE /webhooks/{webhook.id}/{webhook.token} https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token
func (*DeleteWebhookwithToken) Send ¶
func (r *DeleteWebhookwithToken) Send(bot *Client) error
Send sends a DeleteWebhookwithToken request to Discord and returns a error.
type EditApplicationCommandPermissions ¶
type EditApplicationCommandPermissions struct { GuildID string `json:"-"` CommandID string `json:"-"` Permissions []*ApplicationCommandPermissions `json:"permissions"` }
Edit Application Command Permissions PUT /applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions
func (*EditApplicationCommandPermissions) Send ¶
func (r *EditApplicationCommandPermissions) Send(bot *Client) (*GuildApplicationCommandPermissions, error)
Send sends a EditApplicationCommandPermissions request to Discord and returns a GuildApplicationCommandPermissions.
type EditChannelPermissions ¶
type EditChannelPermissions struct { Allow **string `json:"allow,omitempty"` Deny **string `json:"deny,omitempty"` ChannelID string `json:"-"` OverwriteID string `json:"-"` Type Flag `json:"type"` }
Edit Channel Permissions PUT /channels/{channel.id}/permissions/{overwrite.id} https://discord.com/developers/docs/resources/channel#edit-channel-permissions
func (*EditChannelPermissions) Send ¶
func (r *EditChannelPermissions) Send(bot *Client) error
Send sends a EditChannelPermissions request to Discord and returns a error.
type EditCurrentApplication ¶ added in v1.10.2
type EditCurrentApplication struct { Icon *string `json:"icon"` InstallParams *InstallParams `json:"install_params"` IntegrationTypesConfig map[string]Flag `json:"integration_types_config"` CoverImage *string `json:"cover_image"` Description string `json:"string"` RoleConnectionsVerificationURL string `json:"role_connections_verification_url"` CustomInstallURL string `json:"custom_install_url"` InteractionsEndpointURL string `json:"interactions_endpoint_url"` EventWebhooksURL string `json:"event_webhooks_url"` Tags []string `json:"tags"` EventWebhooksTypes []string `json:"event_webhooks_types"` Flags BitFlag `json:"flags"` EventWebhooksStatus Flag `json:"event_webhooks_status"` }
Edit Current Application PATCH /applications/@me https://discord.com/developers/docs/resources/application#edit-current-application
func (*EditCurrentApplication) Send ¶ added in v1.10.2
func (r *EditCurrentApplication) Send(bot *Client) (*Application, error)
Send sends a EditCurrentApplication request to Discord and returns a Application.
type EditFollowupMessage ¶
type EditFollowupMessage struct { ThreadID *string `json:"-" url:"thread_id,omitempty"` Content **string `json:"content,omitempty" url:"-"` Embeds *[]*Embed `json:"embeds,omitempty" url:"-"` Components *[]Component `json:"components,omitempty" url:"-"` AllowedMentions **AllowedMentions `json:"allowed_mentions,omitempty" url:"-"` Attachments *[]*Attachment `json:"attachments,omitempty" url:"-"` ApplicationID string `json:"-" url:"-"` InteractionToken string `json:"-" url:"-"` MessageID string `json:"-" url:"-"` Files []*File `json:"-" url:"-" dasgo:"files"` }
Edit Followup Message PATCH /webhooks/{application.id}/{interaction.token}/messages/{message.id} https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message
func (*EditFollowupMessage) Send ¶
func (r *EditFollowupMessage) Send(bot *Client) (*Message, error)
Send sends a EditFollowupMessage request to Discord and returns a Message.
func (*EditFollowupMessage) UnmarshalJSON ¶
func (r *EditFollowupMessage) UnmarshalJSON(b []byte) error
type EditGlobalApplicationCommand ¶
type EditGlobalApplicationCommand struct { Name *string `json:"name,omitempty"` NameLocalizations *map[string]string `json:"name_localizations,omitempty"` Description *string `json:"description,omitempty"` DescriptionLocalizations *map[string]string `json:"description_localizations,omitempty"` DefaultMemberPermissions **string `json:"default_member_permissions,omitempty"` NSFW *bool `json:"nsfw,omitempty"` CommandID string `json:"-"` Options []*ApplicationCommandOption `json:"options,omitempty"` }
Edit Global Application Command PATCH /applications/{application.id}/commands/{command.id} https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command
func (*EditGlobalApplicationCommand) Send ¶
func (r *EditGlobalApplicationCommand) Send(bot *Client) (*ApplicationCommand, error)
Send sends a EditGlobalApplicationCommand request to Discord and returns a ApplicationCommand.
type EditGuildApplicationCommand ¶
type EditGuildApplicationCommand struct { Name *string `json:"name,omitempty"` NameLocalizations *map[string]string `json:"name_localizations,omitempty"` Description *string `json:"description,omitempty"` DescriptionLocalizations *map[string]string `json:"description_localizations,omitempty"` DefaultMemberPermissions **string `json:"default_member_permissions,omitempty"` NSFW *bool `json:"nsfw,omitempty"` GuildID string `json:"-"` CommandID string `json:"-"` Options []*ApplicationCommandOption `json:"options,omitempty"` }
Edit Guild Application Command PATCH /applications/{application.id}/guilds/{guild.id}/commands/{command.id} https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command
func (*EditGuildApplicationCommand) Send ¶
func (r *EditGuildApplicationCommand) Send(bot *Client) (*ApplicationCommand, error)
Send sends a EditGuildApplicationCommand request to Discord and returns a ApplicationCommand.
type EditMessage ¶
type EditMessage struct { Content **string `json:"content,omitempty"` Embeds *[]*Embed `json:"embeds,omitempty"` Flags **BitFlag `json:"flags,omitempty"` AllowedMentions **AllowedMentions `json:"allowed_mentions,omitempty"` Components *[]Component `json:"components,omitempty"` Attachments *[]*Attachment `json:"attachments,omitempty"` ChannelID string `json:"-"` MessageID string `json:"-"` Files []*File `json:"-" dasgo:"files"` }
Edit Message PATCH /channels/{channel.id}/messages/{message.id} https://discord.com/developers/docs/resources/channel#edit-message
func (*EditMessage) Send ¶
func (r *EditMessage) Send(bot *Client) (*Message, error)
Send sends a EditMessage request to Discord and returns a Message.
func (*EditMessage) UnmarshalJSON ¶
func (r *EditMessage) UnmarshalJSON(b []byte) error
type EditOriginalInteractionResponse ¶
type EditOriginalInteractionResponse struct { ThreadID *string `json:"-" url:"thread_id,omitempty"` Content **string `json:"content,omitempty" url:"-"` Embeds *[]*Embed `json:"embeds,omitempty" url:"-"` Components *[]Component `json:"components,omitempty" url:"-"` AllowedMentions **AllowedMentions `json:"allowed_mentions,omitempty" url:"-"` Attachments *[]*Attachment `json:"attachments,omitempty" url:"-"` ApplicationID string `json:"-" url:"-"` InteractionToken string `json:"-" url:"-"` Files []*File `json:"-" url:"-" dasgo:"files"` }
Edit Original Interaction Response PATCH /webhooks/{application.id}/{interaction.token}/messages/@original https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response
func (*EditOriginalInteractionResponse) Send ¶
func (r *EditOriginalInteractionResponse) Send(bot *Client) (*Message, error)
Send sends a EditOriginalInteractionResponse request to Discord and returns a Message.
func (*EditOriginalInteractionResponse) UnmarshalJSON ¶
func (r *EditOriginalInteractionResponse) UnmarshalJSON(b []byte) error
type EditWebhookMessage ¶
type EditWebhookMessage struct { ThreadID *string `url:"thread_id,omitempty"` Content **string `json:"content,omitempty" url:"-"` Embeds *[]*Embed `json:"embeds,omitempty" url:"-"` Components *[]Component `json:"components,omitempty" url:"-"` AllowedMentions **AllowedMentions `json:"allowed_mentions,omitempty" url:"-"` Attachments *[]*Attachment `json:"attachments,omitempty" url:"-"` Poll *Poll `json:"poll,omitempty" url:"-"` WebhookID string `json:"-" url:"-"` WebhookToken string `json:"-" url:"-"` MessageID string `json:"-" url:"-"` Files []*File `json:"-" url:"-" dasgo:"files"` }
Edit Webhook Message PATCH /webhooks/{webhook.id}/{webhook.token}/messages/{message.id} https://discord.com/developers/docs/resources/webhook#edit-webhook-message
func (*EditWebhookMessage) Send ¶
func (r *EditWebhookMessage) Send(bot *Client) (*Message, error)
Send sends a EditWebhookMessage request to Discord and returns a Message.
func (*EditWebhookMessage) UnmarshalJSON ¶
func (r *EditWebhookMessage) UnmarshalJSON(b []byte) error
type Embed ¶
type Embed struct { Title *string `json:"title,omitempty"` Type *string `json:"type,omitempty"` Description *string `json:"description,omitempty"` URL *string `json:"url,omitempty"` Timestamp *time.Time `json:"timestamp,omitempty"` Color *int `json:"color,omitempty"` Image *EmbedImage `json:"image,omitempty"` Thumbnail *EmbedThumbnail `json:"thumbnail,omitempty"` Video *EmbedVideo `json:"video,omitempty"` Provider *EmbedProvider `json:"provider,omitempty"` Author *EmbedAuthor `json:"author,omitempty"` Fields []*EmbedField `json:"fields,omitempty"` }
Embed Object https://discord.com/developers/docs/resources/channel#embed-object
type EmbedAuthor ¶
type EmbedAuthor struct { URL *string `json:"url,omitempty"` IconURL *string `json:"icon_url,omitempty"` ProxyIconURL *string `json:"proxy_icon_url,omitempty"` Name string `json:"name"` }
Embed Author Structure https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
type EmbedField ¶
type EmbedField struct { Inline *bool `json:"inline,omitempty"` Name string `json:"name"` Value string `json:"value"` }
Embed Field Structure https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
type EmbedFooter ¶
type EmbedFooter struct {}
Embed Footer Structure https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
type EmbedImage ¶
type EmbedImage struct { ProxyURL *string `json:"proxy_url,omitempty"` Height *int `json:"height,omitempty"` Width *int `json:"width,omitempty"` URL string `json:"url"` }
Embed Image Structure https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
type EmbedProvider ¶
type EmbedProvider struct { Name *string `json:"name,omitempty"` URL *string `json:"url,omitempty"` }
Embed Provider Structure https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
type EmbedThumbnail ¶
type EmbedThumbnail struct { ProxyURL *string `json:"proxy_url,omitempty"` Height *int `json:"height,omitempty"` Width *int `json:"width,omitempty"` URL string `json:"url"` }
Embed Thumbnail Structure https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
type EmbedVideo ¶
type EmbedVideo struct { URL *string `json:"url,omitempty"` ProxyURL *string `json:"proxy_url,omitempty"` Height *int `json:"height,omitempty"` Width *int `json:"width,omitempty"` }
Embed Video Structure https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
type Emoji ¶
type Emoji struct { ID *string `json:"id"` Name *string `json:"name,omitempty"` User *User `json:"user,omitempty"` RequireColons *bool `json:"require_colons,omitempty"` Managed *bool `json:"managed,omitempty"` Animated *bool `json:"animated,omitempty"` Available *bool `json:"available,omitempty"` Roles []string `json:"roles,omitempty"` }
Emoji Object https://discord.com/developers/docs/resources/emoji#emoji-object-emoji-structure
type EndPoll ¶ added in v1.10.2
End Poll POST /channels/{channel.id}/polls/{message.id}/expire https://discord.com/developers/docs/resources/poll#get-answer-voters
type Entitlement ¶ added in v1.10.2
type Entitlement struct { UserID *string `json:"user_id,omitempty"` StartsAt *time.Time `json:"starts_at"` EndsAt *time.Time `json:"ends_at"` GuildID *string `json:"guild_id,omitempty"` Consumed *bool `json:"consumed,omitempty"` ID string `json:"id"` SKUID string `json:"sku_id"` ApplicationID string `json:"application_id"` Type Flag `json:"type"` Deleted bool `json:"deleted"` }
Entitlement Structure https://discord.com/developers/docs/resources/entitlement#entitlement-object-entitlement-structure
type EntitlementCreate ¶ added in v1.10.2
type EntitlementCreate struct {
*Entitlement
}
Entitlement Create https://discord.com/developers/docs/events/gateway-events#entitlement-create
type EntitlementDelete ¶ added in v1.10.2
type EntitlementDelete struct {
*Entitlement
}
Entitlement Delete https://discord.com/developers/docs/events/gateway-events#entitlement-delete
type EntitlementUpdate ¶ added in v1.10.2
type EntitlementUpdate struct {
*Entitlement
}
Entitlement Update https://discord.com/developers/docs/events/gateway-events#entitlement-update
type ErrorEvent ¶
type ErrorEvent struct { // ClientID represents the Application ID of the event handler caller. ClientID string // Event represents the name of the event involved in this error. Event string // Err represents the error that occurred while performing the action. Err error // Action represents the action that prompted the error. // // ErrorEventAction's can be one of four values: // ErrorEventActionUnmarshal: an error occurred while unmarshalling the Event from a JSON. // ErrorEventActionMarshal: an error occurred while marshalling the Event to a JSON. // ErrorEventActionRead: an error occurred while reading the Event from a Websocket Connection. // ErrorEventActionWrite: an error occurred while writing the Event to a Websocket Connection. Action string }
ErrorEvent represents a WebSocket error that occurs when an attempt to {action} an event fails.
func (ErrorEvent) Error ¶
func (e ErrorEvent) Error() string
type ErrorEventHandler ¶
type ErrorEventHandler struct { // Err represents the error that occurred while performing the action. Err error // ClientID represents the Application ID of the event handler owner. ClientID string // Event represents the event of the involved handler. Event string }
ErrorEventHandler represents an Event Handler error that occurs when an attempt to add or remove an event handler fails.
func (ErrorEventHandler) Error ¶
func (e ErrorEventHandler) Error() string
type ErrorRequest ¶
type ErrorRequest struct { // Err represents the error that occurred while performing the action. Err error // ClientID represents the Application ID of the request sender. ClientID string // CorrelationID represents the ID used to correlate the request to other logs. CorrelationID string // RouteID represents the ID (hash) of the Disgo Route. RouteID string // ResourceID represents the ID (hash) of the resource for the route. ResourceID string // Endpoint represents the endpoint the request was sent to. Endpoint string }
ErrorRequest represents an HTTP Request error that occurs when an attempt to send a request fails.
func (ErrorRequest) Error ¶
func (e ErrorRequest) Error() string
type ErrorSession ¶
type ErrorSession struct { // Err represents the error that occurred. Err error // SessionID represents the ID of the Session. SessionID string // State represents the state of the session. State string // Type represents the type of connection (e.g., Discord Gateway, Discord Voice). Type string }
ErrorSession represents a WebSocket Session error that occurs during an active session.
func (ErrorSession) Error ¶
func (e ErrorSession) Error() string
type ErrorSessionDisconnect ¶ added in v1.10.21
type ErrorSessionDisconnect struct { // Action represents the error that prompted the disconnection (if applicable). Action error // Err represents the error that occurred while disconnecting. Err error }
ErrorSessionDisconnect represents a disconnection error that occurs when an attempt to gracefully disconnect from a session fails.
func (ErrorSessionDisconnect) Error ¶ added in v1.10.21
func (e ErrorSessionDisconnect) Error() string
type ErrorStatusCode ¶ added in v1.10.21
type ErrorStatusCode struct { // StatusCode represents the HTTP Status Code received from a response. StatusCode int }
ErrorStatusCode represents an HTTP Request error that occurs when an unexpected response is returned.
func (ErrorStatusCode) Error ¶ added in v1.10.21
func (e ErrorStatusCode) Error() string
type Event ¶
type Event interface{}
Gateway Events https://discord.com/developers/docs/topics/gateway#gateway-events
type ExecuteGitHubCompatibleWebhook ¶
type ExecuteGitHubCompatibleWebhook struct { ThreadID *string `url:"thread_id,omitempty"` Wait *bool `url:"wait,omitempty"` WebhookID string `url:"-"` WebhookToken string `url:"-"` }
Execute GitHub-Compatible Webhook POST /webhooks/{webhook.id}/{webhook.token}/github https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook
func (*ExecuteGitHubCompatibleWebhook) Send ¶
func (r *ExecuteGitHubCompatibleWebhook) Send(bot *Client) error
Send sends a ExecuteGitHubCompatibleWebhook request to Discord and returns a error.
type ExecuteSlackCompatibleWebhook ¶
type ExecuteSlackCompatibleWebhook struct { ThreadID *string `url:"thread_id,omitempty"` Wait *bool `url:"wait,omitempty"` WebhookID string `url:"-"` WebhookToken string `url:"-"` }
Execute Slack-Compatible Webhook POST /webhooks/{webhook.id}/{webhook.token}/slack https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook
func (*ExecuteSlackCompatibleWebhook) Send ¶
func (r *ExecuteSlackCompatibleWebhook) Send(bot *Client) error
Send sends a ExecuteSlackCompatibleWebhook request to Discord and returns a error.
type ExecuteWebhook ¶
type ExecuteWebhook struct { Flags *BitFlag `json:"flags,omitempty" url:"-"` Wait *bool `json:"-" url:"wait,omitempty"` ThreadID *string `json:"-" url:"thread_id,omitempty"` Content *string `json:"content,omitempty" url:"-"` Username *string `json:"username,omitempty" url:"-"` AvatarURL *string `json:"avatar_url,omitempty" url:"-"` TTS *bool `json:"tts,omitempty" url:"-"` AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty" url:"-"` Poll *Poll `json:"poll" url:"-"` ThreadName *string `json:"thread_name,omitempty" url:"-"` WebhookToken string `json:"-" url:"-"` WebhookID string `json:"-" url:"-"` Embeds []*Embed `json:"embeds,omitempty" url:"-"` Attachments []*Attachment `json:"attachments,omitempty" url:"-"` Files []*File `json:"-" url:"-" dasgo:"files"` AppliedTags []string `json:"applied_tags" url:"-"` Components []Component `json:"components,omitempty" url:"-"` }
Execute Webhook POST /webhooks/{webhook.id}/{webhook.token} https://discord.com/developers/docs/resources/webhook#execute-webhook
func (*ExecuteWebhook) Send ¶
func (r *ExecuteWebhook) Send(bot *Client) error
Send sends a ExecuteWebhook request to Discord and returns a error.
func (*ExecuteWebhook) UnmarshalJSON ¶
func (r *ExecuteWebhook) UnmarshalJSON(b []byte) error
type ExtendedBotAuthorizationAccessTokenResponse ¶
type ExtendedBotAuthorizationAccessTokenResponse struct { Guild *Guild `json:"guild,omitempty"` TokenType string `json:"token_type,omitempty"` AccessToken string `json:"access_token,omitempty"` Scope string `json:"scope,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` ExpiresIn time.Duration `json:"expires_in,omitempty"` }
Extended Bot Authorization Access Token Response https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-access-token-response
type Flag ¶
type Flag uint8
Flag represents an alias for a Discord API Flag ranging from 0 - 255.
const ( FlagApplicationCommandTypeCHAT_INPUT Flag = 1 FlagApplicationCommandTypeUSER Flag = 2 FlagApplicationCommandTypeMESSAGE Flag = 3 FlagApplicationCommandTypePRIMARY_ENTRY_POINT Flag = 4 )
Application Command Types https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types
const ( FlagApplicationCommandOptionTypeSUB_COMMAND Flag = 1 FlagApplicationCommandOptionTypeSUB_COMMAND_GROUP Flag = 2 FlagApplicationCommandOptionTypeSTRING Flag = 3 FlagApplicationCommandOptionTypeINTEGER Flag = 4 FlagApplicationCommandOptionTypeBOOLEAN Flag = 5 FlagApplicationCommandOptionTypeUSER Flag = 6 FlagApplicationCommandOptionTypeCHANNEL Flag = 7 FlagApplicationCommandOptionTypeROLE Flag = 8 FlagApplicationCommandOptionTypeMENTIONABLE Flag = 9 FlagApplicationCommandOptionTypeNUMBER Flag = 10 FlagApplicationCommandOptionTypeATTACHMENT Flag = 11 )
Application Command Option Type https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type
const ( FlagEntryPointCommandHandlerTypesAPP_HANDLER Flag = 1 FlagEntryPointCommandHandlerTypesDISCORD_LAUNCH_ACTIVITY Flag = 2 )
Entry Point Command Handler Types https://discord.com/developers/docs/interactions/application-commands#application-command-object-entry-point-command-handler-types
const ( FlagApplicationCommandPermissionTypeROLE Flag = 1 FlagApplicationCommandPermissionTypeUSER Flag = 2 FlagApplicationCommandPermissionTypeCHANNEL Flag = 3 )
Application Command Permission Type https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type
const ( FlagComponentTypeInvalid Flag = 0 FlagComponentTypeActionRow Flag = 1 FlagComponentTypeButton Flag = 2 FlagComponentTypeStringSelect Flag = 3 FlagComponentTypeTextInput Flag = 4 FlagComponentTypeUserSelect Flag = 5 FlagComponentTypeRoleSelect Flag = 6 FlagComponentTypeMentionableSelect Flag = 7 FlagComponentTypeChannelSelect Flag = 8 )
Component Types https://discord.com/developers/docs/interactions/message-components#component-object-component-types
const ( FlagButtonStylePRIMARY Flag = 1 FlagButtonStyleBLURPLE Flag = 1 FlagButtonStyleSecondary Flag = 2 FlagButtonStyleGREY Flag = 2 FlagButtonStyleSuccess Flag = 3 FlagButtonStyleGREEN Flag = 3 FlagButtonStyleDanger Flag = 4 FlagButtonStyleRED Flag = 4 FlagButtonStyleLINK Flag = 5 FlagButtonStylePremium Flag = 6 )
Button Styles https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
Text Input Styles https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-styles
const ( FlagInteractionTypePING Flag = 1 FlagInteractionTypeAPPLICATION_COMMAND Flag = 2 FlagInteractionTypeMESSAGE_COMPONENT Flag = 3 FlagInteractionTypeAPPLICATION_COMMAND_AUTOCOMPLETE Flag = 4 FlagInteractionTypeMODAL_SUBMIT Flag = 5 )
Interaction Type https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type
const ( FlagInteractionContextTypeGUILD Flag = 0 FlagInteractionContextTypeBOT_DM Flag = 1 FlagInteractionContextTypePRIVATE_CHANNEL = 2 )
Interaction Context Type https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types
const ( FlagInteractionCallbackTypePONG Flag = 1 FlagInteractionCallbackTypeCHANNEL_MESSAGE_WITH_SOURCE Flag = 4 FlagInteractionCallbackTypeDEFERRED_CHANNEL_MESSAGE_WITH_SOURCE Flag = 5 FlagInteractionCallbackTypeDEFERRED_UPDATE_MESSAGE Flag = 6 FlagInteractionCallbackTypeUPDATE_MESSAGE Flag = 7 FlagInteractionCallbackTypeAPPLICATION_COMMAND_AUTOCOMPLETE_RESULT Flag = 8 FlagInteractionCallbackTypeMODAL Flag = 9 FlagInteractionCallbackTypeLAUNCH_ACTIVITY Flag = 12 )
Interaction Callback Type https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type
const ( FlagApplicationIntegrationTypeGUILD_INSTALL Flag = 0 FlagApplicationIntegrationTypeUSER_INSTALL Flag = 1 )
Application Integration Types https://discord.com/developers/docs/resources/application#application-object-application-integration-types
const ( FlagApplicationEventWebhookStatusDISABLED Flag = 1 FlagApplicationEventWebhookStatusENABLED Flag = 2 FlagApplicationEventWebhookStatusDISABLED_BY_DISCORD Flag = 3 )
Application Event Webhook Status https://discord.com/developers/docs/resources/application#application-object-application-event-webhook-status
const ( FlagApplicationRoleConnectionMetadataTypeINTEGER_LESS_THAN_OR_EQUAL Flag = 1 FlagApplicationRoleConnectionMetadataTypeINTEGER_GREATER_THAN_OR_EQUAL Flag = 2 FlagApplicationRoleConnectionMetadataTypeINTEGER_EQUAL Flag = 3 FlagApplicationRoleConnectionMetadataTypeINTEGER_NOT_EQUAL Flag = 4 FlagApplicationRoleConnectionMetadataTypeDATETIME_LESS_THAN_OR_EQUAL Flag = 5 FlagApplicationRoleConnectionMetadataTypeDATETIME_GREATER_THAN_OR_EQUAL Flag = 6 FlagApplicationRoleConnectionMetadataTypeBOOLEAN_EQUAL Flag = 7 FlagApplicationRoleConnectionMetadataTypeBOOLEAN_NOT_EQUAL Flag = 8 )
Application Role Connection Metadata Types https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-type
const ( FlagAuditLogEventGUILD_UPDATE Flag = 1 FlagAuditLogEventCHANNEL_CREATE Flag = 10 FlagAuditLogEventCHANNEL_UPDATE Flag = 11 FlagAuditLogEventCHANNEL_DELETE Flag = 12 FlagAuditLogEventCHANNEL_OVERWRITE_CREATE Flag = 13 FlagAuditLogEventCHANNEL_OVERWRITE_UPDATE Flag = 14 FlagAuditLogEventCHANNEL_OVERWRITE_DELETE Flag = 15 FlagAuditLogEventMEMBER_KICK Flag = 20 FlagAuditLogEventMEMBER_PRUNE Flag = 21 FlagAuditLogEventMEMBER_BAN_ADD Flag = 22 FlagAuditLogEventMEMBER_BAN_REMOVE Flag = 23 FlagAuditLogEventMEMBER_UPDATE Flag = 24 FlagAuditLogEventMEMBER_ROLE_UPDATE Flag = 25 FlagAuditLogEventMEMBER_MOVE Flag = 26 FlagAuditLogEventMEMBER_DISCONNECT Flag = 27 FlagAuditLogEventBOT_ADD Flag = 28 FlagAuditLogEventROLE_CREATE Flag = 30 FlagAuditLogEventROLE_UPDATE Flag = 31 FlagAuditLogEventROLE_DELETE Flag = 32 FlagAuditLogEventINVITE_CREATE Flag = 40 FlagAuditLogEventINVITE_UPDATE Flag = 41 FlagAuditLogEventINVITE_DELETE Flag = 42 FlagAuditLogEventWEBHOOK_CREATE Flag = 50 FlagAuditLogEventWEBHOOK_UPDATE Flag = 51 FlagAuditLogEventWEBHOOK_DELETE Flag = 52 FlagAuditLogEventEMOJI_CREATE Flag = 60 FlagAuditLogEventEMOJI_UPDATE Flag = 61 FlagAuditLogEventEMOJI_DELETE Flag = 62 FlagAuditLogEventMESSAGE_DELETE Flag = 72 FlagAuditLogEventMESSAGE_BULK_DELETE Flag = 73 FlagAuditLogEventMESSAGE_PIN Flag = 74 FlagAuditLogEventMESSAGE_UNPIN Flag = 75 FlagAuditLogEventINTEGRATION_CREATE Flag = 80 FlagAuditLogEventINTEGRATION_UPDATE Flag = 81 FlagAuditLogEventINTEGRATION_DELETE Flag = 82 FlagAuditLogEventSTAGE_INSTANCE_CREATE Flag = 83 FlagAuditLogEventSTAGE_INSTANCE_UPDATE Flag = 84 FlagAuditLogEventSTAGE_INSTANCE_DELETE Flag = 85 FlagAuditLogEventSTICKER_CREATE Flag = 90 FlagAuditLogEventSTICKER_UPDATE Flag = 91 FlagAuditLogEventSTICKER_DELETE Flag = 92 FlagAuditLogEventGUILD_SCHEDULED_EVENT_CREATE Flag = 100 FlagAuditLogEventGUILD_SCHEDULED_EVENT_UPDATE Flag = 101 FlagAuditLogEventGUILD_SCHEDULED_EVENT_DELETE Flag = 102 FlagAuditLogEventTHREAD_CREATE Flag = 110 FlagAuditLogEventTHREAD_UPDATE Flag = 111 FlagAuditLogEventTHREAD_DELETE Flag = 112 FlagAuditLogEventAPPLICATION_COMMAND_PERMISSION_UPDATE Flag = 121 FlagAuditLogEventAUTO_MODERATION_RULE_CREATE Flag = 140 FlagAuditLogEventAUTO_MODERATION_RULE_UPDATE Flag = 141 FlagAuditLogEventAUTO_MODERATION_RULE_DELETE Flag = 142 FlagAuditLogEventAUTO_MODERATION_BLOCK_MESSAGE Flag = 143 FlagAuditLogEventAUTO_MODERATION_FLAG_TO_CHANNEL Flag = 144 FlagAuditLogEventAUTO_MODERATION_USER_COMMUNICATION_DISABLED Flag = 145 FlagAuditLogEventCREATOR_MONETIZATION_REQUEST_CREATED Flag = 150 FlagAuditLogEventCREATOR_MONETIZATION_TERMS_ACCEPTED Flag = 151 FlagAuditLogEventONBOARDING_PROMPT_CREATE Flag = 163 FlagAuditLogEventONBOARDING_PROMPT_UPDATE Flag = 164 FlagAuditLogEventONBOARDING_PROMPT_DELETE Flag = 165 FlagAuditLogEventONBOARDING_CREATE Flag = 166 FlagAuditLogEventONBOARDING_UPDATE Flag = 167 FlagAuditLogEventHOME_SETTINGS_CREATE Flag = 190 FlagAuditLogEventHOME_SETTINGS_UPDATE Flag = 191 )
Audit Log Events https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events
const ( FlagTriggerTypeKEYWORD Flag = 1 FlagTriggerTypeHARMFUL_LINK Flag = 2 FlagTriggerTypeSPAM Flag = 3 FlagTriggerTypeKEYWORD_PRESET Flag = 4 FlagTriggerTypeMENTION_SPAM Flag = 5 FlagTriggerTypeMEMBER_PROFILE Flag = 6 )
Trigger Types https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types
const ( FlagKeywordPresetTypePROFANITY Flag = 1 FlagKeywordPresetTypeSEXUAL_CONTENT Flag = 2 FlagKeywordPresetTypeSLURS Flag = 3 )
Keyword Preset Types https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-preset-types
Event Types https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-event-types
const ( FlagActionTypeBLOCK_MESSAGE Flag = 1 FlagActionTypeSEND_ALERT_MESSAGE Flag = 2 FlagActionTypeTIMEOUT Flag = 3 FlagActionTypeBLOCK_MEMBER_INTERACTION Flag = 4 )
Action Types https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-types
const ( FlagChannelTypeGUILD_TEXT Flag = 0 FlagChannelTypeDM Flag = 1 FlagChannelTypeGUILD_VOICE Flag = 2 FlagChannelTypeGROUP_DM Flag = 3 FlagChannelTypeGUILD_CATEGORY Flag = 4 FlagChannelTypeGUILD_ANNOUNCEMENT Flag = 5 FlagChannelTypeANNOUNCEMENT_THREAD Flag = 10 FlagChannelTypePUBLIC_THREAD Flag = 11 FlagChannelTypePRIVATE_THREAD Flag = 12 FlagChannelTypeGUILD_STAGE_VOICE Flag = 13 FlagChannelTypeGUILD_DIRECTORY Flag = 14 FlagChannelTypeGUILD_FORUM Flag = 15 FlagChannelTypeGUILD_MEDIA Flag = 16 )
Channel Types https://discord.com/developers/docs/resources/channel#channel-object-channel-types
Video Quality Modes https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
Sort Order Types https://discord.com/developers/docs/resources/channel#channel-object-sort-order-types
const ( FlagForumLayoutTypeNOT_SET Flag = 0 FlagForumLayoutTypeLIST_VIEW Flag = 1 FlagForumLayoutTypeGALLERY_VIEW Flag = 2 )
Forum Layout Types https://discord.com/developers/docs/resources/channel#channel-object-forum-layout-types
const ( FlagMessageTypeDEFAULT Flag = 0 FlagMessageTypeRECIPIENT_ADD Flag = 1 FlagMessageTypeRECIPIENT_REMOVE Flag = 2 FlagMessageTypeCALL Flag = 3 FlagMessageTypeCHANNEL_NAME_CHANGE Flag = 4 FlagMessageTypeCHANNEL_ICON_CHANGE Flag = 5 FlagMessageTypeCHANNEL_PINNED_MESSAGE Flag = 6 FlagMessageTypeUSER_JOIN Flag = 7 FlagMessageTypeGUILD_BOOST Flag = 8 FlagMessageTypeGUILD_BOOST_TIER_1 Flag = 9 FlagMessageTypeGUILD_BOOST_TIER_2 Flag = 10 FlagMessageTypeGUILD_BOOST_TIER_3 Flag = 11 FlagMessageTypeCHANNEL_FOLLOW_ADD Flag = 12 FlagMessageTypeGUILD_DISCOVERY_DISQUALIFIED Flag = 14 FlagMessageTypeGUILD_DISCOVERY_REQUALIFIED Flag = 15 FlagMessageTypeGUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING Flag = 16 FlagMessageTypeGUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING Flag = 17 FlagMessageTypeTHREAD_CREATED Flag = 18 FlagMessageTypeREPLY Flag = 19 FlagMessageTypeCHAT_INPUT_COMMAND Flag = 20 FlagMessageTypeTHREAD_STARTER_MESSAGE Flag = 21 FlagMessageTypeGUILD_INVITE_REMINDER Flag = 22 FlagMessageTypeCONTEXT_MENU_COMMAND Flag = 23 FlagMessageTypeAUTO_MODERATION_ACTION Flag = 24 FlagMessageTypeROLE_SUBSCRIPTION_PURCHASE Flag = 25 FlagMessageTypeINTERACTION_PREMIUM_UPSELL Flag = 26 FlagMessageTypeSTAGE_START Flag = 27 FlagMessageTypeSTAGE_END Flag = 28 FlagMessageTypeSTAGE_SPEAKER Flag = 29 FlagMessageTypeSTAGE_RAISE_HAND Flag = 30 FlagMessageTypeSTAGE_TOPIC Flag = 31 FlagMessageTypeGUILD_APPLICATION_PREMIUM_SUBSCRIPTION Flag = 32 FlagMessageTypeGUILD_INCIDENT_ALERT_MODE_ENABLED Flag = 36 FlagMessageTypeGUILD_INCIDENT_ALERT_MODE_DISABLED Flag = 37 FlagMessageTypeGUILD_INCIDENT_REPORT_RAID Flag = 38 FlagMessageTypeGUILD_INCIDENT_REPORT_FALSE_ALARM Flag = 39 FlagMessageTypePURCHASE_NOTIFICATION Flag = 44 FlagMessageTypePOLL_RESULT Flag = 46 )
Message Types https://discord.com/developers/docs/resources/channel#message-object-message-types
const ( FlagMessageActivityTypeJOIN Flag = 1 FlagMessageActivityTypeSPECTATE Flag = 2 FlagMessageActivityTypeLISTEN Flag = 3 FlagMessageActivityTypeJOIN_REQUEST Flag = 5 )
Message Activity Types https://discord.com/developers/docs/resources/channel#message-object-message-activity-types
Message Reference Types https://discord.com/developers/docs/resources/message#message-reference-types
const ( FlagSKUTypeDURABLE Flag = 2 FlagSKUTypeCONSUMABLE Flag = 3 FlagSKUTypeSUBSCRIPTION Flag = 5 FlagSKUTypeSUBSCRIPTION_GROUP Flag = 6 )
SKU Types https://discord.com/developers/docs/resources/sku#sku-object-sku-types
const ( FlagEntitlementTypePURCHASE Flag = 1 FlagEntitlementTypePREMIUM_SUBSCRIPTION Flag = 2 FlagEntitlementTypeDEVELOPER_GIFT Flag = 3 FlagEntitlementTypeTEST_MODE_PURCHASE Flag = 4 FlagEntitlementTypeFREE_PURCHASE Flag = 5 FlagEntitlementTypeUSER_GIFT Flag = 6 FlagEntitlementTypePREMIUM_PURCHASE Flag = 7 FlagEntitlementTypeAPPLICATION_SUBSCRIPTION Flag = 8 )
Entitlement Types https://discord.com/developers/docs/resources/entitlement#entitlement-object-entitlement-types
const ( FlagDefaultMessageNotificationLevelALL_MESSAGES Flag = 0 FlagDefaultMessageNotificationLevelONLY_MENTIONS Flag = 1 )
Default Message Notification Level https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
const ( FlagExplicitContentFilterLevelDISABLED Flag = 0 FlagExplicitContentFilterLevelMEMBERS_WITHOUT_ROLES Flag = 1 FlagExplicitContentFilterLevelALL_MEMBERS Flag = 2 )
Explicit Content Filter Level https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
const ( FlagVerificationLevelNONE Flag = 0 FlagVerificationLevelLOW Flag = 1 FlagVerificationLevelMEDIUM Flag = 2 FlagVerificationLevelHIGH Flag = 3 FlagVerificationLevelVERY_HIGH Flag = 4 )
Verification Level https://discord.com/developers/docs/resources/guild#guild-object-verification-level
const ( FlagGuildNSFWLevelDEFAULT Flag = 0 FlagGuildNSFWLevelEXPLICIT Flag = 1 FlagGuildNSFWLevelSAFE Flag = 2 FlagGuildNSFWLevelAGE_RESTRICTED Flag = 3 )
Guild NSFW Level https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level
const ( FlagPremiumTierNONE Flag = 0 FlagPremiumTierONE Flag = 1 FlagPremiumTierTWO Flag = 2 FlagPremiumTierTHREE Flag = 3 )
Premium Tier https://discord.com/developers/docs/resources/guild#guild-object-premium-tier
const ( FlagIntegrationExpireBehaviorREMOVEROLE Flag = 0 FlagIntegrationExpireBehaviorKICK Flag = 1 )
Integration Expire Behaviors https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
Onboarding Mode https://discord.com/developers/docs/resources/guild#guild-onboarding-object-onboarding-mode
const ( FlagGuildScheduledEventEntityTypeSTAGE_INSTANCE Flag = 1 FlagGuildScheduledEventEntityTypeVOICE Flag = 2 FlagGuildScheduledEventEntityTypeEXTERNAL Flag = 3 )
Guild Scheduled Event Entity Types https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-types
const ( FlagGuildScheduledEventStatusSCHEDULED Flag = 1 FlagGuildScheduledEventStatusACTIVE Flag = 2 FlagGuildScheduledEventStatusCOMPLETED Flag = 3 FlagGuildScheduledEventStatusCANCELED Flag = 4 )
Guild Scheduled Event Status https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-status
const ( FlagGuildScheduledEventRecurrenceRuleFrequencyYEARLY Flag = 0 FlagGuildScheduledEventRecurrenceRuleFrequencyMONTHLY Flag = 1 FlagGuildScheduledEventRecurrenceRuleFrequencyWEEKLY Flag = 2 FlagGuildScheduledEventRecurrenceRuleFrequencyDAILY Flag = 3 )
Guild Scheduled Event Recurrence Rule - Frequency https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-frequency
const ( FlagGuildScheduledEventRecurrenceRuleWeekdayMONDAY Flag = 0 FlagGuildScheduledEventRecurrenceRuleWeekdayTUESDAY Flag = 1 FlagGuildScheduledEventRecurrenceRuleWeekdayWEDNESDAY Flag = 2 FlagGuildScheduledEventRecurrenceRuleWeekdayTHURSDAY Flag = 3 FlagGuildScheduledEventRecurrenceRuleWeekdayFRIDAY Flag = 4 FlagGuildScheduledEventRecurrenceRuleWeekdaySATURDAY Flag = 5 FlagGuildScheduledEventRecurrenceRuleWeekdaySUNDAY Flag = 6 )
Guild Scheduled Event Recurrence Rule - Weekday https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-weekday
const ( FlagGuildScheduledEventRecurrenceRuleJANUARY Flag = 1 FlagGuildScheduledEventRecurrenceRuleFEBRUARY Flag = 2 FlagGuildScheduledEventRecurrenceRuleMARCH Flag = 3 FlagGuildScheduledEventRecurrenceRuleAPRIL Flag = 4 FlagGuildScheduledEventRecurrenceRuleMAY Flag = 5 FlagGuildScheduledEventRecurrenceRuleJUNE Flag = 6 FlagGuildScheduledEventRecurrenceRuleJULY Flag = 7 FlagGuildScheduledEventRecurrenceRuleAUGUST Flag = 8 FlagGuildScheduledEventRecurrenceRuleSEPTEMBER Flag = 9 FlagGuildScheduledEventRecurrenceRuleOCTOBER Flag = 10 FlagGuildScheduledEventRecurrenceRuleNOVEMBER Flag = 11 FlagGuildScheduledEventRecurrenceRuleDECEMBER Flag = 12 )
Guild Scheduled Event Recurrence Rule - Month https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-month
const ( FlagInviteTypesGUILD Flag = 0 FlagInviteTypesGROUP_DM Flag = 1 FlagInviteTypesFRIEND Flag = 2 )
Invite Types https://discord.com/developers/docs/resources/invite#invite-object-invite-types
Invite Target Types https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
const ( FlagStickerFormatTypePNG Flag = 1 FlagStickerFormatTypeAPNG Flag = 2 FlagStickerFormatTypeLOTTIE Flag = 3 )
Sticker Format Types https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-format-types
const ( FlagSubscriptionStatusACTIVE Flag = 0 FlagSubscriptionStatusENDING Flag = 1 FlagSubscriptionStatusINACTIVE Flag = 2 )
Subscription Statuses https://discord.com/developers/docs/resources/subscription#subscription-statuses
const ( FlagPremiumTypeNONE Flag = 0 FlagPremiumTypeNITROCLASSIC Flag = 1 FlagPremiumTypeNITRO Flag = 2 FlagPremiumTypeNITROBASIC Flag = 3 )
Premium Types https://discord.com/developers/docs/resources/user#user-object-premium-types
Visibility Types https://discord.com/developers/docs/resources/user#connection-object-visibility-types
const ( FlagWebhookTypeINCOMING Flag = 1 FlagWebhookTypeCHANNELFOLLOWER Flag = 2 FlagWebhookTypeAPPLICATION Flag = 3 )
Webhook Types https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types
Permission Overwrite Types
Membership State Enum https://discord.com/developers/docs/topics/teams#data-models-membership-state-enum
const ( FlagActivityTypePlaying Flag = 0 FlagActivityTypeStreaming Flag = 1 FlagActivityTypeListening Flag = 2 FlagActivityTypeWatching Flag = 3 FlagActivityTypeCustom Flag = 4 FlagActivityTypeCompeting Flag = 5 )
Activity Types https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types
Animation Types https://discord.com/developers/docs/events/gateway-events#voice-channel-effect-send-animation-types
const (
FlagGuildScheduledEventPrivacyLevelGUILD_ONLY Flag = 2
)
Guild Scheduled Event Privacy Level https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level
const (
FlagPollLayoutTypeDEFAULT Flag = 1
)
Poll Layout Types https://discord.com/developers/docs/resources/poll#layout-type
const (
FlagStageInstancePrivacyLevelGUILD_ONLY Flag = 2
)
Stage Instance Privacy Level https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-privacy-level
type Flags ¶ added in v1.10.1
type Flags []Flag
Flags represents an alias for a []Flag for JSON marshal purposes.
func (Flags) MarshalJSON ¶ added in v1.10.1
type FollowAnnouncementChannel ¶
type FollowAnnouncementChannel struct { ChannelID string `json:"-"` WebhookChannelID string `json:"webhook_channel_id"` }
Follow Announcement Channel POST /channels/{channel.id}/followers https://discord.com/developers/docs/resources/channel#follow-announcement-channel
func (*FollowAnnouncementChannel) Send ¶
func (r *FollowAnnouncementChannel) Send(bot *Client) (*FollowedChannel, error)
Send sends a FollowAnnouncementChannel request to Discord and returns a FollowedChannel.
type FollowedChannel ¶
type FollowedChannel struct { ChannelID string `json:"channel_id"` WebhookID string `json:"webhook_id"` }
Followed Channel Structure https://discord.com/developers/docs/resources/channel#followed-channel-object-followed-channel-structure
type ForumAndMediaThreadMessageParams ¶ added in v1.10.2
type ForumAndMediaThreadMessageParams struct { Content *string `json:"content,omitempty"` AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"` Flags *BitFlag `json:"flags,omitempty"` Embeds []*Embed `json:"embeds,omitempty"` Components []Component `json:"components,omitempty"` StickerIDS []string `json:"sticker_ids,omitempty"` Attachments []*Attachment `json:"attachments,omitempty"` }
Forum and Media Thread Message Params Object https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel-forum-and-media-thread-message-params-object
func (*ForumAndMediaThreadMessageParams) UnmarshalJSON ¶ added in v1.10.2
func (r *ForumAndMediaThreadMessageParams) UnmarshalJSON(b []byte) error
type ForumTag ¶
type ForumTag struct { EmojiID *string `json:"emoji_id"` EmojiName *string `json:"emoji_name"` ID string `json:"id"` Name string `json:"name"` Moderated bool `json:"moderated"` }
Forum Tag Structure https://discord.com/developers/docs/resources/channel#forum-tag-object-forum-tag-structure
type Gateway ¶
type Gateway struct { // ShardManager controls how the bot is sharded. ShardManager ShardManager // RateLimiter represents an object that provides rate limit functionality. RateLimiter RateLimiter // Intents represents a Discord Gateway Intent. // // You must specify a Gateway Intent in order to receive specific information from an event. // // https://discord.com/developers/docs/topics/gateway#gateway-intents IntentSet map[BitFlag]bool // GatewayPresenceUpdate represents the presence or status update of a bot. // // GatewayPresenceUpdate is used when the bot connects to a session. // // https://discord.com/developers/docs/topics/gateway#update-presence GatewayPresenceUpdate *GatewayPresenceUpdate // Intents represents a Discord Gateway Intent. // // You must specify a Gateway Intent in order to receive specific information from an event. // // https://discord.com/developers/docs/topics/gateway#gateway-intents Intents BitFlag }
Gateway represents Discord Gateway parameters used to perform various actions by the client.
func DefaultGateway ¶
func DefaultGateway() Gateway
DefaultGateway returns a default Gateway configuration.
Privileged Intents are disabled by default. https://discord.com/developers/docs/topics/gateway#privileged-intents
func (Gateway) DisableIntent ¶
DisableIntent disables an intent.
Disclaimer: The Bitwise OR operation (used) to add an intent is a DESTRUCTIVE operation.
This means that it can NOT be reversed. As a result, this function will NOT remove an intent that is already enabled.
func (*Gateway) EnableIntent ¶
EnableIntent enables an intent.
This function does NOT check whether the intent is already enabled. Use the Gateway.IntentSet to check whether the intent is already enabled.
DISCLAIMER. Bots that use `DefaultGateway()` or `DefaultConfig()` to initialize the Client have privileged intents = `true` in the IntentSet by default, which disables the privileged intent.
func (*Gateway) EnableIntentsPrivileged ¶ added in v1.10.21
func (g *Gateway) EnableIntentsPrivileged()
EnableIntentsPrivileged enables all privileged intents. https://discord.com/developers/docs/topics/gateway#privileged-intents
This function does NOT check whether the intent is already enabled. Use the Gateway.IntentSet to check whether the intent is already enabled.
DISCLAIMER. Bots that use `DefaultGateway()` or `DefaultConfig()` to initialize the Client have privileged intents = `true` in the IntentSet by default, which disables the privileged intent.
type GatewayCloseEventCode ¶
Gateway Close Event Codes https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
type GatewayPayload ¶
type GatewayPayload struct { SequenceNumber *int64 `json:"s,omitempty"` EventName *string `json:"t,omitempty"` Data json.RawMessage `json:"d"` Op int `json:"op"` }
Gateway Payload Structure https://discord.com/developers/docs/topics/gateway-events#payload-structure
type GatewayPresenceUpdate ¶
type GatewayPresenceUpdate struct { Since *int `json:"since"` Status string `json:"status"` Game []*Activity `json:"game"` AFK bool `json:"afk"` }
Gateway Presence Update Structure https://discord.com/developers/docs/topics/gateway-events#update-presence-gateway-presence-update-structure
func (*GatewayPresenceUpdate) SendEvent ¶
func (c *GatewayPresenceUpdate) SendEvent(bot *Client, session *Session) error
SendEvent sends an Opcode 3 UpdatePresence event to the Discord Gateway.
func (*GatewayPresenceUpdate) SendEvents ¶ added in v1.10.1
func (c *GatewayPresenceUpdate) SendEvents(bot *Client, sm ShardManager) error
SendEvents sends an Opcode 3 UpdatePresence event to the Discord Gateway.
type GatewayURLQueryString ¶
type GatewayURLQueryString struct { Compress *string `url:"compress,omitempty"` Encoding string `url:"encoding"` V int `url:"v"` }
Gateway URL Query String Params https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-query-string-params
type GatewayVoiceStateUpdate ¶
type GatewayVoiceStateUpdate struct { ChannelID *string `json:"channel_id"` GuildID string `json:"guild_id"` SelfMute bool `json:"self_mute"` SelfDeaf bool `json:"self_deaf"` }
Gateway Voice State Update Structure https://discord.com/developers/docs/topics/gateway-events#update-voice-state-gateway-voice-state-update-structure
type GetAnswerVoters ¶ added in v1.10.2
type GetAnswerVoters struct { After *string `url:"after,omitempty"` Limit *int `url:"limit"` ChannelID string `url:"-"` MessageID string `url:"-"` AnswerID string `url:"-"` }
Get Answer Voters GET /channels/{channel.id}/polls/{message.id}/answers/{answer_id} https://discord.com/developers/docs/resources/poll#get-answer-voters
func (*GetAnswerVoters) Send ¶ added in v1.10.2
func (r *GetAnswerVoters) Send(bot *Client) (*GetAnswerVotersResponse, error)
Send sends a GetAnswerVoters request to Discord and returns a GetAnswerVotersResponse.
type GetAnswerVotersResponse ¶ added in v1.10.2
type GetAnswerVotersResponse struct {
Users []*User `json:"users"`
}
Get Answer Voters Response https://discord.com/developers/docs/resources/poll#get-answer-voters-response-body
type GetApplicationActivityInstance ¶ added in v1.10.2
type GetApplicationActivityInstance struct {
InstanceID string
}
Get Application Activity Instance GET /applications/{application.id}/activity-instances/{instance_id} https://discord.com/developers/docs/resources/application#get-application-activity-instance
func (*GetApplicationActivityInstance) Send ¶ added in v1.10.2
func (r *GetApplicationActivityInstance) Send(bot *Client) (*ActivityInstance, error)
Send sends a GetApplicationActivityInstance request to Discord and returns a ActivityInstance.
type GetApplicationCommandPermissions ¶
Get Application Command Permissions GET /applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions
func (*GetApplicationCommandPermissions) Send ¶
func (r *GetApplicationCommandPermissions) Send(bot *Client) (*GuildApplicationCommandPermissions, error)
Send sends a GetApplicationCommandPermissions request to Discord and returns a GuildApplicationCommandPermissions.
type GetApplicationEmoji ¶ added in v1.10.2
type GetApplicationEmoji struct {
EmojiID string
}
Get Application Emoji GET /applications/{application.id}/emojis/{emoji.id} https://discord.com/developers/docs/resources/emoji#get-application-emoji
type GetApplicationRoleConnectionMetadataRecords ¶ added in v1.10.1
type GetApplicationRoleConnectionMetadataRecords struct { }
Get Application Role Connection Metadata Records GET /applications/{application.id}/role-connections/metadata https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
func (*GetApplicationRoleConnectionMetadataRecords) Send ¶ added in v1.10.1
func (r *GetApplicationRoleConnectionMetadataRecords) Send(bot *Client) ([]*ApplicationRoleConnectionMetadata, error)
Send sends a GetApplicationRoleConnectionMetadataRecords request to Discord and returns a []*ApplicationRoleConnectionMetadata.
type GetAutoModerationRule ¶
Get Auto Moderation Rule GET /guilds/{guild.id}/auto-moderation/rules/{auto_moderation_rule.id} https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule
func (*GetAutoModerationRule) Send ¶
func (r *GetAutoModerationRule) Send(bot *Client) (*AutoModerationRule, error)
Send sends a GetAutoModerationRule request to Discord and returns a AutoModerationRule.
type GetChannel ¶
type GetChannel struct {
ChannelID string
}
Get Channel GET /channels/{channel.id} https://discord.com/developers/docs/resources/channel#get-channel
type GetChannelInvites ¶
type GetChannelInvites struct {
ChannelID string
}
Get Channel Invites GET /channels/{channel.id}/invites https://discord.com/developers/docs/resources/channel#get-channel-invites
type GetChannelMessage ¶
Get Channel Message GET /channels/{channel.id}/messages/{message.id} https://discord.com/developers/docs/resources/channel#get-channel-message
type GetChannelMessages ¶
type GetChannelMessages struct { Around *string `url:"around,omitempty"` Before *string `url:"before,omitempty"` After *string `url:"after,omitempty"` Limit *int `url:"limit,omitempty"` ChannelID string `url:"-"` }
Get Channel Messages GET /channels/{channel.id}/messages https://discord.com/developers/docs/resources/channel#get-channel-messages
type GetChannelWebhooks ¶
type GetChannelWebhooks struct {
ChannelID string
}
Get Channel Webhooks GET /channels/{channel.id}/webhooks https://discord.com/developers/docs/resources/webhook#get-channel-webhooks
type GetCurrentApplication ¶ added in v1.10.2
type GetCurrentApplication struct{}
Get Current Application GET /applications/@me https://discord.com/developers/docs/resources/application#get-current-application
func (*GetCurrentApplication) Send ¶ added in v1.10.2
func (r *GetCurrentApplication) Send(bot *Client) (*Application, error)
Send sends a GetCurrentApplication request to Discord and returns a Application.
type GetCurrentAuthorizationInformation ¶
type GetCurrentAuthorizationInformation struct{}
Get Current Authorization Information GET /oauth2/@me https://discord.com/developers/docs/topics/oauth2#get-current-authorization-information
func (*GetCurrentAuthorizationInformation) Send ¶
func (r *GetCurrentAuthorizationInformation) Send(bot *Client) (*CurrentAuthorizationInformationResponse, error)
Send sends a GetCurrentAuthorizationInformation request to Discord and returns a CurrentAuthorizationInformationResponse.
type GetCurrentBotApplicationInformation ¶
type GetCurrentBotApplicationInformation struct{}
Get Current Bot Application Information GET /oauth2/applications/@me https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information
func (*GetCurrentBotApplicationInformation) Send ¶
func (r *GetCurrentBotApplicationInformation) Send(bot *Client) (*Application, error)
Send sends a GetCurrentBotApplicationInformation request to Discord and returns a Application.
type GetCurrentUser ¶
type GetCurrentUser struct{}
Get Current User GET/users/@me https://discord.com/developers/docs/resources/user#get-current-user
type GetCurrentUserApplicationRoleConnection ¶ added in v1.10.2
type GetCurrentUserApplicationRoleConnection struct { }
Get User Application Role Connection GET /users/@me/applications/{application.id}/role-connection https://discord.com/developers/docs/resources/user#get-user-application-role-connection
func (*GetCurrentUserApplicationRoleConnection) Send ¶ added in v1.10.2
func (r *GetCurrentUserApplicationRoleConnection) Send(bot *Client) (*ApplicationRoleConnection, error)
Send sends a GetCurrentUserApplicationRoleConnection request to Discord and returns a ApplicationRoleConnection.
type GetCurrentUserConnections ¶ added in v1.10.2
type GetCurrentUserConnections struct{}
Get User Connections GET /users/@me/connections https://discord.com/developers/docs/resources/user#get-user-connections
func (*GetCurrentUserConnections) Send ¶ added in v1.10.2
func (r *GetCurrentUserConnections) Send(bot *Client) ([]*Connection, error)
Send sends a GetCurrentUserConnections request to Discord and returns a []*Connection.
type GetCurrentUserGuildMember ¶
type GetCurrentUserGuildMember struct {
GuildID string
}
Get Current User Guild Member GET /users/@me/guilds/{guild.id}/member https://discord.com/developers/docs/resources/user#get-current-user-guild-member
func (*GetCurrentUserGuildMember) Send ¶
func (r *GetCurrentUserGuildMember) Send(bot *Client) (*GuildMember, error)
Send sends a GetCurrentUserGuildMember request to Discord and returns a GuildMember.
type GetCurrentUserGuilds ¶
type GetCurrentUserGuilds struct { Before *string `json:"before,omitempty"` After *string `json:"after,omitempty"` Limit *int `json:"limit,omitempty"` WithCounts *bool `json:"with_counts,omitempty"` }
Get Current User Guilds GET /users/@me/guilds https://discord.com/developers/docs/resources/user#get-current-user-guilds
type GetEntitlement ¶ added in v1.10.2
type GetEntitlement struct {
EntitlementID string
}
Get Entitlement GET /applications/{application.id}/entitlements/{entitlement.id} https://discord.com/developers/docs/resources/entitlement#get-entitlement
func (*GetEntitlement) Send ¶ added in v1.10.2
func (r *GetEntitlement) Send(bot *Client) (*Entitlement, error)
Send sends a GetEntitlement request to Discord and returns a Entitlement.
type GetFollowupMessage ¶
type GetFollowupMessage struct { ThreadID *string `url:"thread_id,omitempty"` InteractionToken string `url:"-"` MessageID string `url:"-"` }
Get Followup Message GET /webhooks/{application.id}/{interaction.token}/messages/{message.id} https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message
type GetGateway ¶
type GetGateway struct{}
Get Gateway GET /gateway https://discord.com/developers/docs/topics/gateway#get-gateway
func (*GetGateway) Send ¶
func (r *GetGateway) Send(bot *Client) (*GetGatewayBotResponse, error)
Send sends a GetGateway request to Discord and returns a GetGatewayBotResponse.
type GetGatewayBot ¶
type GetGatewayBot struct{}
Get Gateway Bot GET /gateway/bot https://discord.com/developers/docs/topics/gateway#get-gateway-bot
func (*GetGatewayBot) Send ¶
func (r *GetGatewayBot) Send(bot *Client) (*GetGatewayBotResponse, error)
Send sends a GetGatewayBot request to Discord and returns a GetGatewayBotResponse.
type GetGatewayBotResponse ¶
type GetGatewayBotResponse struct { URL string `json:"url"` Shards int `json:"shards"` SessionStartLimit SessionStartLimit `json:"session_start_limit"` }
Get Gateway Bot Response https://discord.com/developers/docs/topics/gateway#get-gateway-example-response
type GetGatewayResponse ¶
type GetGatewayResponse struct {
URL string `json:"url,omitempty"`
}
Get Gateway Response https://discord.com/developers/docs/topics/gateway#get-gateway-example-response
type GetGlobalApplicationCommand ¶
type GetGlobalApplicationCommand struct {
CommandID string
}
Get Global Application Command GET /applications/{application.id}/commands/{command.id} https://discord.com/developers/docs/interactions/application-commands#get-global-application-command
func (*GetGlobalApplicationCommand) Send ¶
func (r *GetGlobalApplicationCommand) Send(bot *Client) (*ApplicationCommand, error)
Send sends a GetGlobalApplicationCommand request to Discord and returns a ApplicationCommand.
type GetGlobalApplicationCommands ¶
type GetGlobalApplicationCommands struct {
WithLocalizations *bool `url:"with_localizations,omitempty"`
}
Get Global Application Commands GET /applications/{application.id}/commands https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands
func (*GetGlobalApplicationCommands) Send ¶
func (r *GetGlobalApplicationCommands) Send(bot *Client) ([]*ApplicationCommand, error)
Send sends a GetGlobalApplicationCommands request to Discord and returns a []*ApplicationCommand.
type GetGuild ¶
Get Guild GET /guilds/{guild.id} https://discord.com/developers/docs/resources/guild#get-guild
type GetGuildApplicationCommand ¶
Get Guild Application Command GET /applications/{application.id}/guilds/{guild.id}/commands/{command.id} https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command
func (*GetGuildApplicationCommand) Send ¶
func (r *GetGuildApplicationCommand) Send(bot *Client) (*ApplicationCommand, error)
Send sends a GetGuildApplicationCommand request to Discord and returns a ApplicationCommand.
type GetGuildApplicationCommandPermissions ¶
type GetGuildApplicationCommandPermissions struct {
GuildID string
}
Get Guild Application Command Permissions GET /applications/{application.id}/guilds/{guild.id}/commands/permissions https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions
func (*GetGuildApplicationCommandPermissions) Send ¶
func (r *GetGuildApplicationCommandPermissions) Send(bot *Client) (*GuildApplicationCommandPermissions, error)
Send sends a GetGuildApplicationCommandPermissions request to Discord and returns a GuildApplicationCommandPermissions.
type GetGuildApplicationCommands ¶
type GetGuildApplicationCommands struct { WithLocalizations *bool `url:"with_localizations,omitempty"` GuildID string `url:"-"` }
Get Guild Application Commands GET /applications/{application.id}/guilds/{guild.id}/commands https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
func (*GetGuildApplicationCommands) Send ¶
func (r *GetGuildApplicationCommands) Send(bot *Client) ([]*ApplicationCommand, error)
Send sends a GetGuildApplicationCommands request to Discord and returns a []*ApplicationCommand.
type GetGuildAuditLog ¶
type GetGuildAuditLog struct { GuildID string `url:"-"` // https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events UserID string `url:"user_id,omitempty"` Before string `url:"before,omitempty"` After string `url:"after,omitempty"` Limit int `url:"limit,omitempty"` ActionType Flag `url:"action_type,omitempty"` }
Get Guild Audit Log GET /guilds/{guild.id}/audit-logs https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log
type GetGuildBan ¶
Get Guild Ban GET /guilds/{guild.id}/bans/{user.id} https://discord.com/developers/docs/resources/guild#get-guild-ban
type GetGuildBans ¶
type GetGuildBans struct { Limit *int `url:"limit,omitempty"` Before *string `url:"before,omitempty"` After *string `url:"after,omitempty"` GuildID string `url:"-"` }
Get Guild Bans GET /guilds/{guild.id}/bans https://discord.com/developers/docs/resources/guild#get-guild-bans
type GetGuildChannels ¶
type GetGuildChannels struct {
GuildID string
}
Get Guild Channels GET /guilds/{guild.id}/channels https://discord.com/developers/docs/resources/guild#get-guild-channels
type GetGuildEmoji ¶
Get Guild Emoji GET /guilds/{guild.id}/emojis/{emoji.id} https://discord.com/developers/docs/resources/emoji#get-guild-emoji
type GetGuildIntegrations ¶
type GetGuildIntegrations struct {
GuildID string
}
Get Guild Integrations GET /guilds/{guild.id}/integrations https://discord.com/developers/docs/resources/guild#get-guild-integrations
func (*GetGuildIntegrations) Send ¶
func (r *GetGuildIntegrations) Send(bot *Client) ([]*Integration, error)
Send sends a GetGuildIntegrations request to Discord and returns a []*Integration.
type GetGuildInvites ¶
type GetGuildInvites struct {
GuildID string
}
Get Guild Invites GET /guilds/{guild.id}/invites https://discord.com/developers/docs/resources/guild#get-guild-invites
type GetGuildMember ¶
Get Guild Member GET /guilds/{guild.id}/members/{user.id} https://discord.com/developers/docs/resources/guild#get-guild-member
func (*GetGuildMember) Send ¶
func (r *GetGuildMember) Send(bot *Client) (*GuildMember, error)
Send sends a GetGuildMember request to Discord and returns a GuildMember.
type GetGuildOnboarding ¶ added in v1.10.1
type GetGuildOnboarding struct {
GuildID string
}
Get Guild Onboarding GET /guilds/{guild.id}/onboarding https://discord.com/developers/docs/resources/guild#get-guild-onboarding
func (*GetGuildOnboarding) Send ¶ added in v1.10.1
func (r *GetGuildOnboarding) Send(bot *Client) (*GuildOnboarding, error)
Send sends a GetGuildOnboarding request to Discord and returns a GuildOnboarding.
type GetGuildPreview ¶
type GetGuildPreview struct {
GuildID string
}
Get Guild Preview GET /guilds/{guild.id}/preview https://discord.com/developers/docs/resources/guild#get-guild-preview
func (*GetGuildPreview) Send ¶
func (r *GetGuildPreview) Send(bot *Client) (*GuildPreview, error)
Send sends a GetGuildPreview request to Discord and returns a GuildPreview.
type GetGuildPruneCount ¶
type GetGuildPruneCount struct { GuildID string `url:"-"` IncludeRoles []string `url:"include_roles,omitempty"` Days int `url:"days,omitempty"` }
Get Guild Prune Count GET /guilds/{guild.id}/prune https://discord.com/developers/docs/resources/guild#get-guild-prune-count
func (*GetGuildPruneCount) Send ¶
func (r *GetGuildPruneCount) Send(bot *Client) (*GetGuildPruneCountResponse, error)
Send sends a GetGuildPruneCount request to Discord and returns a GetGuildPruneCountResponse.
type GetGuildPruneCountResponse ¶
type GetGuildPruneCountResponse struct {
Pruned int `json:"pruned"`
}
Get Guild Prune Count Response Body https://discord.com/developers/docs/resources/guild#get-guild-prune-count
type GetGuildRole ¶ added in v1.10.2
Get Guild Role GET /guilds/{guild.id}/roles/{role.id} https://discord.com/developers/docs/resources/guild#get-guild-role
type GetGuildRoles ¶
type GetGuildRoles struct {
GuildID string
}
Get Guild Roles GET /guilds/{guild.id}/roles https://discord.com/developers/docs/resources/guild#get-guild-roles
type GetGuildScheduledEvent ¶
type GetGuildScheduledEvent struct { WithUserCount *bool `url:"with_user_count,omitempty"` GuildID string `url:"-"` GuildScheduledEventID string `url:"-"` }
Get Guild Scheduled Event GET /guilds/{guild.id}/scheduled-events/{guild_scheduled_event.id} https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event
func (*GetGuildScheduledEvent) Send ¶
func (r *GetGuildScheduledEvent) Send(bot *Client) (*GuildScheduledEvent, error)
Send sends a GetGuildScheduledEvent request to Discord and returns a GuildScheduledEvent.
type GetGuildScheduledEventUsers ¶
type GetGuildScheduledEventUsers struct { Limit *int `url:"limit,omitempty"` WithMember *bool `url:"with_member,omitempty"` Before *string `url:"before,omitempty"` After *string `url:"after,omitempty"` GuildID string `url:"-"` GuildScheduledEventID string `url:"-"` }
Get Guild Scheduled Event Users GET /guilds/{guild.id}/scheduled-events/{guild_scheduled_event.id}/users https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users
func (*GetGuildScheduledEventUsers) Send ¶
func (r *GetGuildScheduledEventUsers) Send(bot *Client) ([]*GuildScheduledEventUser, error)
Send sends a GetGuildScheduledEventUsers request to Discord and returns a []*GuildScheduledEventUser.
type GetGuildSoundboardSound ¶ added in v1.10.2
Get Guild Soundboard Sound GET /guilds/{guild.id}/soundboard-sounds/{sound.id} https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound
func (*GetGuildSoundboardSound) Send ¶ added in v1.10.2
func (r *GetGuildSoundboardSound) Send(bot *Client) (*SoundboardSound, error)
Send sends a GetGuildSoundboardSound request to Discord and returns a SoundboardSound.
type GetGuildSticker ¶
Get Guild Sticker GET /guilds/{guild.id}/stickers/{sticker.id} https://discord.com/developers/docs/resources/sticker#get-guild-sticker
type GetGuildTemplate ¶
type GetGuildTemplate struct {
TemplateCode string
}
Get Guild Template GET /guilds/templates/{template.code} https://discord.com/developers/docs/resources/guild-template#get-guild-template
func (*GetGuildTemplate) Send ¶
func (r *GetGuildTemplate) Send(bot *Client) (*GuildTemplate, error)
Send sends a GetGuildTemplate request to Discord and returns a GuildTemplate.
type GetGuildTemplates ¶
type GetGuildTemplates struct {
GuildID string
}
Get Guild Templates GET /guilds/{guild.id}/templates https://discord.com/developers/docs/resources/guild-template#get-guild-templates
func (*GetGuildTemplates) Send ¶
func (r *GetGuildTemplates) Send(bot *Client) ([]*GuildTemplate, error)
Send sends a GetGuildTemplates request to Discord and returns a []*GuildTemplate.
type GetGuildVanityURL ¶
type GetGuildVanityURL struct { Code *string `json:"code"` GuildID string `json:"-"` Uses int `json:"uses,omitempty"` }
Get Guild Vanity URL GET /guilds/{guild.id}/vanity-url https://discord.com/developers/docs/resources/guild#get-guild-vanity-url
type GetGuildVoiceRegions ¶
type GetGuildVoiceRegions struct {
GuildID string
}
Get Guild Voice Regions GET /guilds/{guild.id}/regions https://discord.com/developers/docs/resources/guild#get-guild-voice-regions
func (*GetGuildVoiceRegions) Send ¶
func (r *GetGuildVoiceRegions) Send(bot *Client) ([]*VoiceRegion, error)
Send sends a GetGuildVoiceRegions request to Discord and returns a []*VoiceRegion.
type GetGuildWebhooks ¶
type GetGuildWebhooks struct {
GuildID string
}
Get Guild Webhooks GET /guilds/{guild.id}/webhooks https://discord.com/developers/docs/resources/webhook#get-guild-webhooks
type GetGuildWelcomeScreen ¶
type GetGuildWelcomeScreen struct {
GuildID string
}
Get Guild Welcome Screen GET /guilds/{guild.id}/welcome-screen https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
func (*GetGuildWelcomeScreen) Send ¶
func (r *GetGuildWelcomeScreen) Send(bot *Client) (*WelcomeScreen, error)
Send sends a GetGuildWelcomeScreen request to Discord and returns a WelcomeScreen.
type GetGuildWidget ¶
type GetGuildWidget struct {
GuildID string
}
Get Guild Widget GET /guilds/{guild.id}/widget.json https://discord.com/developers/docs/resources/guild#get-guild-widget
func (*GetGuildWidget) Send ¶
func (r *GetGuildWidget) Send(bot *Client) (*GuildWidget, error)
Send sends a GetGuildWidget request to Discord and returns a GuildWidget.
type GetGuildWidgetImage ¶
type GetGuildWidgetImage struct { // Widget Style Options // https://discord.com/developers/docs/resources/guild#get-guild-widget-image-widget-style-options Style *string `url:"style,omitempty"` GuildID string `url:"-"` }
Get Guild Widget Image GET /guilds/{guild.id}/widget.png https://discord.com/developers/docs/resources/guild#get-guild-widget-image
func (*GetGuildWidgetImage) Send ¶
func (r *GetGuildWidgetImage) Send(bot *Client) (*EmbedImage, error)
Send sends a GetGuildWidgetImage request to Discord and returns a EmbedImage.
type GetGuildWidgetSettings ¶
type GetGuildWidgetSettings struct {
GuildID string
}
Get Guild Widget Settings GET /guilds/{guild.id}/widget https://discord.com/developers/docs/resources/guild#get-guild-widget-settings
func (*GetGuildWidgetSettings) Send ¶
func (r *GetGuildWidgetSettings) Send(bot *Client) (*GuildWidget, error)
Send sends a GetGuildWidgetSettings request to Discord and returns a GuildWidget.
type GetInvite ¶
type GetInvite struct { WithCounts *bool `url:"with_counts,omitempty"` WithExpiration *bool `url:"with_expiration,omitempty"` GuildScheduledEventID *string `url:"guild_scheduled_event_id,omitempty"` InviteCode string `url:"-"` }
Get Invite GET /invites/{invite.code} https://discord.com/developers/docs/resources/invite#get-invite
type GetOriginalInteractionResponse ¶
type GetOriginalInteractionResponse struct { ThreadID *string `url:"thread_id,omitempty"` InteractionToken string `url:"-"` }
Get Original Interaction Response GET /webhooks/{application.id}/{interaction.token}/messages/@original https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response
func (*GetOriginalInteractionResponse) Send ¶
func (r *GetOriginalInteractionResponse) Send(bot *Client) error
Send sends a GetOriginalInteractionResponse request to Discord and returns a error.
type GetPinnedMessages ¶
type GetPinnedMessages struct {
ChannelID string
}
Get Pinned Messages GET /channels/{channel.id}/pins https://discord.com/developers/docs/resources/channel#get-pinned-messages
type GetReactions ¶
type GetReactions struct { Type *Flag `url:"type,omitempty"` After *string `url:"after,omitempty"` Limit *int `url:"limit,omitempty"` ChannelID string `url:"-"` MessageID string `url:"-"` Emoji string `url:"-"` }
Get Reactions GET /channels/{channel.id}/messages/{message.id}/reactions/{emoji} https://discord.com/developers/docs/resources/channel#get-reactions
type GetSKUSubscription ¶ added in v1.10.2
Get SKU Subscription GET /skus/{sku.id}/subscriptions/{subscription.id} https://discord.com/developers/docs/resources/subscription#get-sku-subscription
func (*GetSKUSubscription) Send ¶ added in v1.10.2
func (r *GetSKUSubscription) Send(bot *Client) (*Subscription, error)
Send sends a GetSKUSubscription request to Discord and returns a Subscription.
type GetStageInstance ¶
type GetStageInstance struct {
ChannelID string
}
Get Stage Instance GET /stage-instances/{channel.id} https://discord.com/developers/docs/resources/stage-instance#get-stage-instance
func (*GetStageInstance) Send ¶
func (r *GetStageInstance) Send(bot *Client) (*StageInstance, error)
Send sends a GetStageInstance request to Discord and returns a StageInstance.
type GetSticker ¶
type GetSticker struct {
StickerID string
}
Get Sticker GET /stickers/{sticker.id} https://discord.com/developers/docs/resources/sticker#get-sticker
type GetStickerPack ¶ added in v1.10.2
type GetStickerPack struct {
PackID string `url:"-"`
}
Get Sticker Pack GET /sticker-packs/{pack.id} https://discord.com/developers/docs/resources/sticker#get-sticker-pack
type GetThreadMember ¶
type GetThreadMember struct { WithMember *bool `url:"with_member,omitempty"` ChannelID string `url:"-"` UserID string `url:"-"` }
Get Thread Member GET /channels/{channel.id}/thread-members/{user.id} https://discord.com/developers/docs/resources/channel#get-thread-member
func (*GetThreadMember) Send ¶
func (r *GetThreadMember) Send(bot *Client) (*ThreadMember, error)
Send sends a GetThreadMember request to Discord and returns a ThreadMember.
type GetUser ¶
type GetUser struct {
UserID string
}
Get User GET/users/{user.id} https://discord.com/developers/docs/resources/user#get-user
type GetWebhook ¶
type GetWebhook struct {
WebhookID string
}
Get Webhook GET /webhooks/{webhook.id} https://discord.com/developers/docs/resources/webhook#get-webhook
type GetWebhookMessage ¶
type GetWebhookMessage struct { ThreadID *string `url:"thread_id,omitempty"` WebhookID string `url:"-"` WebhookToken string `url:"-"` MessageID string `url:"-"` }
Get Webhook Message GET /webhooks/{webhook.id}/{webhook.token}/messages/{message.id} https://discord.com/developers/docs/resources/webhook#get-webhook-message
type GetWebhookwithToken ¶
Get Webhook with Token GET /webhooks/{webhook.id}/{webhook.token} https://discord.com/developers/docs/resources/webhook#get-webhook-with-token
type GroupDMAddRecipient ¶
type GroupDMAddRecipient struct { Nickname *string `json:"nick"` ChannelID string `json:"-"` UserID string `json:"-"` AccessToken string `json:"access_token"` }
Group DM Add Recipient PUT /channels/{channel.id}/recipients/{user.id} https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
func (*GroupDMAddRecipient) Send ¶
func (r *GroupDMAddRecipient) Send(bot *Client) error
Send sends a GroupDMAddRecipient request to Discord and returns a error.
type GroupDMRemoveRecipient ¶
Group DM Remove Recipient DELETE /channels/{channel.id}/recipients/{user.id} https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient
func (*GroupDMRemoveRecipient) Send ¶
func (r *GroupDMRemoveRecipient) Send(bot *Client) error
Send sends a GroupDMRemoveRecipient request to Discord and returns a error.
type Guild ¶
type Guild struct { PremiumSubscriptionCount *int `json:"premium_subscription_count,omitempty"` IconHash **string `json:"icon_hash,omitempty"` Icon *string `json:"icon"` SystemChannelID *string `json:"system_channel_id"` Splash *string `json:"splash"` DiscoverySplash *string `json:"discovery_splash"` Owner *bool `json:"owner,omitempty"` Permissions *string `json:"permissions,omitempty"` AfkChannelID *string `json:"afk_channel_id"` ApplicationID *string `json:"application_id"` WidgetEnabled *bool `json:"widget_enabled,omitempty"` WidgetChannelID **string `json:"widget_channel_id,omitempty"` WelcomeScreen *WelcomeScreen `json:"welcome_screen,omitempty"` ApproximatePresenceCount *int `json:"approximate_presence_count,omitempty"` ApproximateMemberCount *int `json:"approximate_member_count,omitempty"` MaxStageVideoChannelUsers *int `json:"max_stage_video_channel_users,omitempty"` MaxVideoChannelUsers *int `json:"max_video_channel_users,omitempty"` PublicUpdatesChannelID *string `json:"public_updates_channel_id"` Banner *string `json:"banner"` SafetyAlertsChannelID *string `json:"safety_alerts_channel_id"` Description *string `json:"description"` VanityUrl *string `json:"vanity_url_code"` RulesChannelID *string `json:"rules_channel_id"` MaxPresences **int `json:"max_presences,omitempty"` MaxMembers *int `json:"max_members,omitempty"` Name string `json:"name"` ID string `json:"id"` OwnerID string `json:"owner_id"` PreferredLocale string `json:"preferred_locale"` Roles []*Role `json:"roles"` Emojis []*Emoji `json:"emojis"` Features []*string `json:"features"` Stickers []*Sticker `json:"stickers,omitempty"` AfkTimeout int `json:"afk_timeout"` SystemChannelFlags BitFlag `json:"system_channel_flags"` DefaultMessageNotifications Flag `json:"default_message_notifications"` MFALevel Flag `json:"mfa_level"` NSFWLevel Flag `json:"nsfw_level"` VerificationLevel Flag `json:"verification_level"` PremiumProgressBarEnabled bool `json:"premium_progress_bar_enabled"` ExplicitContentFilter Flag `json:"explicit_content_filter"` PremiumTier Flag `json:"premium_tier"` }
Guild Object https://discord.com/developers/docs/resources/guild#guild-object
type GuildApplicationCommandPermissions ¶
type GuildApplicationCommandPermissions struct { ID string `json:"id"` ApplicationID string `json:"application_id"` GuildID string `json:"guild_id"` Permissions []*ApplicationCommandPermissions `json:"permissions"` }
Guild Application Command Permissions Object https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure
type GuildAuditLogEntryCreate ¶ added in v1.10.1
type GuildAuditLogEntryCreate struct {
*AuditLogEntry
}
Guild Audit Log Entry Create https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create
type GuildBanAdd ¶
Guild Ban Add https://discord.com/developers/docs/topics/gateway-events#guild-ban-add
type GuildBanRemove ¶
Guild Ban Remove https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove
type GuildCreate ¶
type GuildCreate struct { *Guild // https://discord.com/developers/docs/topics/threads#gateway-events Threads []*Channel `json:"threads,omitempty"` }
Guild Create https://discord.com/developers/docs/topics/gateway-events#guild-create
type GuildDelete ¶
type GuildDelete struct {
*Guild
}
Guild Delete https://discord.com/developers/docs/topics/gateway-events#guild-delete
type GuildEmojisUpdate ¶
Guild Emojis Update https://discord.com/developers/docs/topics/gateway-events#guild-emojis-update
type GuildIntegrationsUpdate ¶
type GuildIntegrationsUpdate struct {
GuildID string `json:"guild_id"`
}
Guild Integrations Update https://discord.com/developers/docs/topics/gateway-events#guild-integrations-update
type GuildMember ¶
type GuildMember struct { JoinedAt time.Time `json:"joined_at"` PremiumSince **time.Time `json:"premium_since,omitempty"` Avatar **string `json:"avatar,omitempty"` Banner **string `json:"banner,omitempty"` Nick **string `json:"nick,omitempty"` User *User `json:"user,omitempty"` Pending *bool `json:"pending,omitempty"` Permissions *string `json:"permissions,omitempty"` CommunicationDisabledUntil **time.Time `json:"communication_disabled_until,omitempty"` AvatarDecorationData **AvatarDecorationData `json:"avatar_decoration_data,omitempty"` Roles []string `json:"roles"` Flags BitFlag `json:"flags"` Deaf bool `json:"deaf"` Mute bool `json:"mute"` }
Guild Member Object https://discord.com/developers/docs/resources/guild#guild-member-object
type GuildMemberAdd ¶
type GuildMemberAdd struct { *GuildMember GuildID string `json:"guild_id"` }
Guild Member Add https://discord.com/developers/docs/topics/gateway-events#guild-member-add
type GuildMemberRemove ¶
Guild Member Remove https://discord.com/developers/docs/topics/gateway-events#guild-member-remove
type GuildMemberUpdate ¶
type GuildMemberUpdate struct { *GuildMember GuildID string `json:"guild_id"` }
Guild Member Update https://discord.com/developers/docs/topics/gateway-events#guild-member-update
type GuildMembersChunk ¶
type GuildMembersChunk struct { Nonce *string `json:"nonce,omitempty"` GuildID string `json:"guild_id"` Members []*GuildMember `json:"members"` Presences []*PresenceUpdate `json:"presences,omitempty"` NotFound []string `json:"not_found,omitempty"` ChunkIndex int `json:"chunk_index"` ChunkCount int `json:"chunk_count"` }
Guild Members Chunk https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk
type GuildOnboarding ¶ added in v1.10.1
type GuildOnboarding struct { GuildID string `json:"guild_id"` Prompts []*OnboardingPrompt `json:"prompt"` DefaultChannelIDs []string `json:"default_channel_ids"` Enabled bool `json:"enabled"` Mode Flag `json:"mode"` }
Guild Onboarding Structure https://discord.com/developers/docs/resources/guild#guild-onboarding-object
type GuildPreview ¶
type GuildPreview struct { Icon *string `json:"icon"` Splash *string `json:"splash"` DiscoverySplash *string `json:"discovery_splash"` Description *string `json:"description"` ID string `json:"id"` Name string `json:"name"` Emojis []*Emoji `json:"emojis"` Features []*string `json:"features"` Stickers []*Sticker `json:"stickers"` ApproximateMemberCount int `json:"approximate_member_count"` ApproximatePresenceCount int `json:"approximate_presence_count"` }
Guild Preview Object https://discord.com/developers/docs/resources/guild#guild-preview-object-guild-preview-structure
type GuildRoleCreate ¶
Guild Role Create https://discord.com/developers/docs/topics/gateway-events#guild-role-create
type GuildRoleDelete ¶
Guild Role Delete https://discord.com/developers/docs/topics/gateway-events#guild-role-delete
type GuildRoleUpdate ¶
Guild Role Update https://discord.com/developers/docs/topics/gateway-events#guild-role-update
type GuildScheduledEvent ¶
type GuildScheduledEvent struct { ScheduledStartTime time.Time `json:"scheduled_start_time"` EntityID *string `json:"entity_id"` RecurrenceRule *GuildScheduledEventRecurrenceRule `json:"recurrence_rule"` ChannelID *string `json:"channel_id"` CreatorID **string `json:"creator_id,omitempty"` Image **string `json:"image,omitempty"` Description **string `json:"description,omitempty"` ScheduledEndTime *time.Time `json:"scheduled_end_time"` UserCount *int `json:"user_count,omitempty"` Creator *User `json:"creator,omitempty"` EntityMetadata *GuildScheduledEventEntityMetadata `json:"entity_metadata"` Name string `json:"name"` ID string `json:"id"` GuildID string `json:"guild_id"` EntityType Flag `json:"entity_type"` Status Flag `json:"status"` PrivacyLevel Flag `json:"privacy_level"` }
Guild Scheduled Event Object https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure
type GuildScheduledEventCreate ¶
type GuildScheduledEventCreate struct {
*GuildScheduledEvent
}
Guild Scheduled Event Create https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-create
type GuildScheduledEventDelete ¶
type GuildScheduledEventDelete struct {
*GuildScheduledEvent
}
Guild Scheduled Event Delete https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-delete
type GuildScheduledEventEntityMetadata ¶
type GuildScheduledEventEntityMetadata struct {
Location string `json:"location,omitempty"`
}
Guild Scheduled Event Entity Metadata https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata
type GuildScheduledEventRecurrenceRule ¶ added in v1.10.2
type GuildScheduledEventRecurrenceRule struct { Start time.Time `json:"start"` End *time.Time `json:"end"` Count *int `json:"count"` ByWeekday []Flag `json:"by_weekday"` ByNWeekday []*GuildScheduledEventRecurrenceRuleNWeekday `json:"by_n_weekday"` ByMonth []Flag `json:"by_month"` ByMonthDay []int `json:"by_month_day"` ByYearDay []int `json:"by_year_day"` Interval int `json:"interval"` Frequency Flag `json:"frequency"` }
Guild Scheduled Event Recurrence Rule Structure https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-structure
type GuildScheduledEventRecurrenceRuleNWeekday ¶ added in v1.10.2
Guild Scheduled Event Recurrence Rule - N_Weekday Structure https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-weekday
type GuildScheduledEventUpdate ¶
type GuildScheduledEventUpdate struct {
*GuildScheduledEvent
}
Guild Scheduled Event Update https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-update
type GuildScheduledEventUser ¶
type GuildScheduledEventUser struct { User *User `json:"user"` Member *GuildMember `json:"member,omitempty"` GuildScheduledEventID string `json:"guild_scheduled_event_id"` }
Guild Scheduled Event User Object https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-user-object-guild-scheduled-event-user-structure
type GuildScheduledEventUserAdd ¶
type GuildScheduledEventUserAdd struct { GuildScheduledEventID string `json:"guild_scheduled_event_id"` UserID string `json:"user_id"` GuildID string `json:"guild_id"` }
Guild Scheduled Event User Add https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-add
type GuildScheduledEventUserRemove ¶
type GuildScheduledEventUserRemove struct { GuildScheduledEventID string `json:"guild_scheduled_event_id"` UserID string `json:"user_id"` GuildID string `json:"guild_id"` }
Guild Scheduled Event User Remove https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-remove
type GuildSoundboardSoundCreate ¶ added in v1.10.2
type GuildSoundboardSoundCreate struct {
*SoundboardSound
}
Guild Soundboard Sound Create https://discord.com/developers/docs/events/gateway-events#guild-soundboard-sound-create
type GuildSoundboardSoundDelete ¶ added in v1.10.2
type GuildSoundboardSoundDelete struct { SoundID string `json:"sound_id"` GuildID string `json:"guild_id"` }
Guild Soundboard Sound Delete https://discord.com/developers/docs/events/gateway-events#guild-soundboard-sound-delete
type GuildSoundboardSoundUpdate ¶ added in v1.10.2
type GuildSoundboardSoundUpdate struct {
*SoundboardSound
}
Guild Soundboard Sound Update https://discord.com/developers/docs/events/gateway-events#guild-soundboard-sound-update
type GuildSoundboardSoundsUpdate ¶ added in v1.10.2
type GuildSoundboardSoundsUpdate struct { GuildID string `json:"guild_id"` SoundboardSounds []*SoundboardSound `json:"soundboard_sounds"` }
Guild Soundboard Sounds Update https://discord.com/developers/docs/events/gateway-events#guild-soundboard-sounds-update
type GuildStickersUpdate ¶
type GuildStickersUpdate struct { GuildID string `json:"guild_id"` Stickers []*Sticker `json:"stickers"` }
Guild Stickers Update https://discord.com/developers/docs/topics/gateway-events#guild-stickers-update
type GuildTemplate ¶
type GuildTemplate struct { CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Description *string `json:"description"` Creator *User `json:"creator"` SerializedSourceGuild *Guild `json:"serialized_source_guild"` IsDirty *bool `json:"is_dirty"` Code string `json:"code"` Name string `json:"name"` CreatorID string `json:"creator_id"` SourceGuildID string `json:"source_guild_id"` UsageCount int `json:"usage_count"` }
Guild Template Object https://discord.com/developers/docs/resources/guild-template#guild-template-object
type GuildUpdate ¶
type GuildUpdate struct {
*Guild
}
Guild Update https://discord.com/developers/docs/topics/gateway-events#guild-update
type GuildWidget ¶
type GuildWidget struct { ID string `json:"id"` Name string `json:"name"` InstantInvite *string `json:"instant_invite"` Channels []*Channel `json:"channels"` Members []*User `json:"members"` PresenceCount int `json:"presence_count"` }
Guild Widget Object https://discord.com/developers/docs/resources/guild#et-gguild-widget-object-get-guild-widget-structure*
type GuildWidgetSettings ¶
type GuildWidgetSettings struct { ChannelID *string `json:"channel_id"` Enabled bool `json:"enabled"` }
Guild Widget Settings Object https://discord.com/developers/docs/resources/guild#guild-widget-settings-object
type Handlers ¶
type Handlers struct { Hello []func(*Hello) Ready []func(*Ready) Resumed []func(*Resumed) Reconnect []func(*Reconnect) InvalidSession []func(*InvalidSession) ApplicationCommandPermissionsUpdate []func(*ApplicationCommandPermissionsUpdate) AutoModerationRuleCreate []func(*AutoModerationRuleCreate) AutoModerationRuleUpdate []func(*AutoModerationRuleUpdate) AutoModerationRuleDelete []func(*AutoModerationRuleDelete) AutoModerationActionExecution []func(*AutoModerationActionExecution) ChannelCreate []func(*ChannelCreate) ChannelUpdate []func(*ChannelUpdate) ChannelDelete []func(*ChannelDelete) ChannelPinsUpdate []func(*ChannelPinsUpdate) ThreadCreate []func(*ThreadCreate) ThreadUpdate []func(*ThreadUpdate) ThreadDelete []func(*ThreadDelete) ThreadListSync []func(*ThreadListSync) ThreadMemberUpdate []func(*ThreadMemberUpdate) ThreadMembersUpdate []func(*ThreadMembersUpdate) EntitlementCreate []func(*EntitlementCreate) EntitlementUpdate []func(*EntitlementUpdate) EntitlementDelete []func(*EntitlementDelete) GuildCreate []func(*GuildCreate) GuildUpdate []func(*GuildUpdate) GuildDelete []func(*GuildDelete) GuildAuditLogEntryCreate []func(*GuildAuditLogEntryCreate) GuildBanAdd []func(*GuildBanAdd) GuildBanRemove []func(*GuildBanRemove) GuildEmojisUpdate []func(*GuildEmojisUpdate) GuildStickersUpdate []func(*GuildStickersUpdate) GuildIntegrationsUpdate []func(*GuildIntegrationsUpdate) GuildMemberAdd []func(*GuildMemberAdd) GuildMemberRemove []func(*GuildMemberRemove) GuildMemberUpdate []func(*GuildMemberUpdate) GuildMembersChunk []func(*GuildMembersChunk) GuildRoleCreate []func(*GuildRoleCreate) GuildRoleUpdate []func(*GuildRoleUpdate) GuildRoleDelete []func(*GuildRoleDelete) GuildScheduledEventCreate []func(*GuildScheduledEventCreate) GuildScheduledEventUpdate []func(*GuildScheduledEventUpdate) GuildScheduledEventDelete []func(*GuildScheduledEventDelete) GuildScheduledEventUserAdd []func(*GuildScheduledEventUserAdd) GuildScheduledEventUserRemove []func(*GuildScheduledEventUserRemove) GuildSoundboardSoundCreate []func(*GuildSoundboardSoundCreate) GuildSoundboardSoundUpdate []func(*GuildSoundboardSoundUpdate) GuildSoundboardSoundDelete []func(*GuildSoundboardSoundDelete) GuildSoundboardSoundsUpdate []func(*GuildSoundboardSoundsUpdate) SoundboardSounds []func(*SoundboardSounds) IntegrationCreate []func(*IntegrationCreate) IntegrationUpdate []func(*IntegrationUpdate) IntegrationDelete []func(*IntegrationDelete) InteractionCreate []func(*InteractionCreate) InviteCreate []func(*InviteCreate) InviteDelete []func(*InviteDelete) MessageCreate []func(*MessageCreate) MessageUpdate []func(*MessageUpdate) MessageDelete []func(*MessageDelete) MessageDeleteBulk []func(*MessageDeleteBulk) MessageReactionAdd []func(*MessageReactionAdd) MessageReactionRemove []func(*MessageReactionRemove) MessageReactionRemoveAll []func(*MessageReactionRemoveAll) MessageReactionRemoveEmoji []func(*MessageReactionRemoveEmoji) PresenceUpdate []func(*PresenceUpdate) StageInstanceCreate []func(*StageInstanceCreate) StageInstanceDelete []func(*StageInstanceDelete) StageInstanceUpdate []func(*StageInstanceUpdate) SubscriptionCreate []func(*SubscriptionCreate) SubscriptionUpdate []func(*SubscriptionUpdate) SubscriptionDelete []func(*SubscriptionDelete) TypingStart []func(*TypingStart) UserUpdate []func(*UserUpdate) VoiceChannelEffectSend []func(*VoiceChannelEffectSend) VoiceStateUpdate []func(*VoiceStateUpdate) VoiceServerUpdate []func(*VoiceServerUpdate) WebhooksUpdate []func(*WebhooksUpdate) MessagePollVoteAdd []func(*MessagePollVoteAdd) MessagePollVoteRemove []func(*MessagePollVoteRemove) // contains filtered or unexported fields }
Handlers represents a bot's event handlers.
type Heartbeat ¶
type Heartbeat struct {
Data int64 `json:"d"`
}
Heartbeat Structure https://discord.com/developers/docs/topics/gateway-events#heartbeat
func (*Heartbeat) SendEvents ¶ added in v1.10.1
func (c *Heartbeat) SendEvents(bot *Client, sm ShardManager) error
SendEvents sends an Opcode 1 Heartbeat event to the Discord Gateway.
type Hello ¶
type Hello struct {
HeartbeatInterval int `json:"heartbeat_interval"`
}
Hello Structure https://discord.com/developers/docs/topics/gateway-events#hello-hello-structure
type Identify ¶
type Identify struct { Compress *bool `json:"compress,omitempty"` LargeThreshold *int `json:"large_threshold,omitempty"` Shard *[2]int `json:"shard,omitempty"` Presence *GatewayPresenceUpdate `json:"presence,omitempty"` Properties IdentifyConnectionProperties `json:"properties"` Token string `json:"token"` Intents BitFlag `json:"intents"` }
Identify Structure https://discord.com/developers/docs/topics/gateway-events#identify-identify-structure
func (*Identify) SendEvents ¶ added in v1.10.1
func (c *Identify) SendEvents(bot *Client, sm ShardManager) error
SendEvents sends an Opcode 2 Identify event to the Discord Gateway.
type IdentifyConnectionProperties ¶
type IdentifyConnectionProperties struct { OS string `json:"os"` Browser string `json:"browser"` Device string `json:"device"` }
Identify Connection Properties https://discord.com/developers/docs/topics/gateway-events#identify-identify-connection-properties
type InstallParams ¶
type InstallParams struct { Permissions string `json:"permissions"` Scopes []string `json:"scopes"` }
Install Params Object https://discord.com/developers/docs/resources/application#install-params-object
type Integration ¶
type Integration struct { ExpireGracePeriod *int `json:"expire_grace_period,omitempty"` ExpireBehavior *Flag `json:"expire_behavior,omitempty"` Application *Application `json:"application,omitempty"` Revoked *bool `json:"revoked,omitempty"` SubscriberCount *int `json:"subscriber_count,omitempty"` RoleID *string `json:"role_id,omitempty"` SyncedAt *time.Time `json:"synced_at,omitempty"` EnableEmoticons *bool `json:"enable_emoticons,omitempty"` Syncing *bool `json:"syncing,omitempty"` User *User `json:"user,omitempty"` Account IntegrationAccount `json:"account"` Name string `json:"name"` ID string `json:"id"` Type string `json:"type"` Scopes []string `json:"scopes,omitempty"` Enabled bool `json:"enabled"` }
Integration Object https://discord.com/developers/docs/resources/guild#integration-object
type IntegrationAccount ¶
Integration Account Object https://discord.com/developers/docs/resources/guild#integration-account-object
type IntegrationApplication ¶
type IntegrationApplication struct { Icon *string `json:"icon"` Bot *User `json:"bot,omitempty"` ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` }
Integration Application Object https://discord.com/developers/docs/resources/guild#integration-application-object-integration-application-structure
type IntegrationCreate ¶
type IntegrationCreate struct { *Integration GuildID string `json:"guild_id"` }
Integration Create https://discord.com/developers/docs/topics/gateway-events#integration-create
type IntegrationDelete ¶
type IntegrationDelete struct { ApplicationID *string `json:"application_id,omitempty"` IntegrationID string `json:"id"` GuildID string `json:"guild_id"` }
Integration Delete https://discord.com/developers/docs/topics/gateway-events#integration-delete
type IntegrationUpdate ¶
type IntegrationUpdate struct { *Integration GuildID string `json:"guild_id"` }
Integration Update https://discord.com/developers/docs/topics/gateway-events#integration-update
type Interaction ¶
type Interaction struct { Data InteractionData `json:"data,omitempty"` Member *GuildMember `json:"member,omitempty"` Locale *string `json:"locale,omitempty"` User *User `json:"user,omitempty"` AuthorizingIntegrationOwners map[Flag]string `json:"authorizing_integration_owners"` GuildID *string `json:"guild_id,omitempty"` Channel *Channel `json:"channel,omitempty"` ChannelID *string `json:"channel_id,omitempty"` GuildLocale *string `json:"guild_locale,omitempty"` Context *Flag `json:"context,omitempty"` AppPermissions *BitFlag `json:"app_permissions,omitempty,string"` Guild *Guild `json:"guild,omitempty"` Message *Message `json:"message,omitempty"` ApplicationID string `json:"application_id"` ID string `json:"id"` Token string `json:"token"` Entitlements []*Entitlement `json:"entitlement"` Version int `json:"version,omitempty"` Type Flag `json:"type"` }
Interaction Object https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-structure
func (*Interaction) ApplicationCommand ¶
func (i *Interaction) ApplicationCommand() *ApplicationCommandData
ApplicationCommand type converts an InteractionData field into an ApplicationCommandData struct.
func (*Interaction) MessageComponent ¶
func (i *Interaction) MessageComponent() *MessageComponentData
MessageComponent type converts an InteractionData field into a MessageComponentData struct.
func (*Interaction) ModalSubmit ¶
func (i *Interaction) ModalSubmit() *ModalSubmitData
ModalSubmit type converts an InteractionData field into a ModalSubmitData struct.
func (*Interaction) UnmarshalJSON ¶
func (r *Interaction) UnmarshalJSON(b []byte) error
type InteractionCallbackData ¶
type InteractionCallbackData interface {
InteractionCallbackDataType() Flag
}
Interaction Callback Data Structure https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-data-structure
type InteractionCreate ¶
type InteractionCreate struct {
*Interaction
}
Interaction Create https://discord.com/developers/docs/topics/gateway-events#interaction-create
func (*InteractionCreate) UnmarshalJSON ¶
func (e *InteractionCreate) UnmarshalJSON(b []byte) error
type InteractionData ¶
type InteractionData interface {
InteractionDataType() Flag
}
Interaction Data https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
type InteractionResponse ¶
type InteractionResponse struct { Data InteractionCallbackData `json:"data,omitempty"` Type Flag `json:"type"` }
Interaction Response Structure https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-response-structure
func (*InteractionResponse) UnmarshalJSON ¶
func (r *InteractionResponse) UnmarshalJSON(b []byte) error
type InvalidSession ¶
type InvalidSession struct {
Data bool `json:"d"`
}
Invalid Session https://discord.com/developers/docs/topics/gateway-events#invalid-session
type Invite ¶
type Invite struct { Guild *Guild `json:"guild,omitempty"` Channel *Channel `json:"channel"` Inviter *User `json:"inviter,omitempty"` TargetType *Flag `json:"target_type,omitempty"` TargetUser *User `json:"target_user,omitempty"` TargetApplication *Application `json:"target_application,omitempty"` ApproximatePresenceCount *int `json:"approximate_presence_count,omitempty"` ApproximateMemberCount *int `json:"approximate_member_count,omitempty"` ExpiresAt **time.Time `json:"expires_at,omitempty"` GuildScheduledEvent *GuildScheduledEvent `json:"guild_scheduled_event,omitempty"` Code string `json:"code"` Type Flag `json:"type"` }
Invite Object https://discord.com/developers/docs/resources/invite#invite-object
type InviteCreate ¶
type InviteCreate struct { CreatedAt time.Time `json:"created_at"` GuildID *string `json:"guild_id,omitempty"` Inviter *User `json:"inviter,omitempty"` TargetType *int `json:"target_user_type,omitempty"` TargetUser *User `json:"target_user,omitempty"` TargetApplication *Application `json:"target_application,omitempty"` ChannelID string `json:"channel_id"` Code string `json:"code"` MaxAge int `json:"max_age"` MaxUses int `json:"max_uses"` Uses int `json:"uses"` Temporary bool `json:"temporary"` }
Invite Create https://discord.com/developers/docs/topics/gateway-events#invite-create
type InviteDelete ¶
type InviteDelete struct { ChannelID string `json:"channel_id"` GuildID *string `json:"guild_id,omitempty"` Code string `json:"code"` }
Invite Delete https://discord.com/developers/docs/topics/gateway-events#invite-delete
type InviteMetadata ¶
type InviteMetadata struct { CreatedAt time.Time `json:"created_at"` Uses int `json:"uses"` MaxUses int `json:"max_uses"` MaxAge int `json:"max_age"` Temporary bool `json:"temporary"` }
Invite Metadata Object https://discord.com/developers/docs/resources/invite#invite-metadata-object-invite-metadata-structure
type JoinThread ¶
type JoinThread struct {
ChannelID string
}
Join Thread PUT /channels/{channel.id}/thread-members/@me https://discord.com/developers/docs/resources/channel#join-thread
func (*JoinThread) Send ¶
func (r *JoinThread) Send(bot *Client) error
Send sends a JoinThread request to Discord and returns a error.
type LeaveGuild ¶
type LeaveGuild struct {
GuildID string
}
Leave Guild DELETE /users/@me/guilds/{guild.id} https://discord.com/developers/docs/resources/user#leave-guild
func (*LeaveGuild) Send ¶
func (r *LeaveGuild) Send(bot *Client) error
Send sends a LeaveGuild request to Discord and returns a error.
type LeaveThread ¶
type LeaveThread struct {
ChannelID string
}
Leave Thread DELETE /channels/{channel.id}/thread-members/@me https://discord.com/developers/docs/resources/channel#leave-thread
func (*LeaveThread) Send ¶
func (r *LeaveThread) Send(bot *Client) error
Send sends a LeaveThread request to Discord and returns a error.
type ListActiveGuildThreads ¶
type ListActiveGuildThreads struct {
GuildID string `json:"-"`
}
List Active Guild Threads GET /guilds/{guild.id}/threads/active https://discord.com/developers/docs/resources/guild#list-active-guild-threads
func (*ListActiveGuildThreads) Send ¶
func (r *ListActiveGuildThreads) Send(bot *Client) (*ListActiveGuildThreadsResponse, error)
Send sends a ListActiveGuildThreads request to Discord and returns a ListActiveGuildThreadsResponse.
type ListActiveGuildThreadsResponse ¶
type ListActiveGuildThreadsResponse struct { Threads []*Channel `json:"threads"` Members []*ThreadMember `json:"members"` }
List Active Guild Threads Response Body https://discord.com/developers/docs/resources/guild#list-active-guild-threads-response-body
type ListApplicationEmojis ¶ added in v1.10.2
type ListApplicationEmojis struct { }
List Application Emojis GET /applications/{application.id}/emojis https://discord.com/developers/docs/resources/emoji#list-application-emojis
func (*ListApplicationEmojis) Send ¶ added in v1.10.2
func (r *ListApplicationEmojis) Send(bot *Client) (*ListApplicationEmojisResponse, error)
Send sends a ListApplicationEmojis request to Discord and returns a ListApplicationEmojisResponse.
type ListApplicationEmojisResponse ¶ added in v1.10.2
type ListApplicationEmojisResponse struct {
Items []*Emoji `json:"items"`
}
List Application Emojis Response https://discord.com/developers/docs/resources/emoji#list-application-emojis
type ListAutoModerationRulesForGuild ¶
type ListAutoModerationRulesForGuild struct {
GuildID string
}
List Auto Moderation Rules for Guild GET /guilds/{guild.id}/auto-moderation/rules https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild
func (*ListAutoModerationRulesForGuild) Send ¶
func (r *ListAutoModerationRulesForGuild) Send(bot *Client) ([]*AutoModerationAction, error)
Send sends a ListAutoModerationRulesForGuild request to Discord and returns a []*AutoModerationAction.
type ListDefaultSoundboardSounds ¶ added in v1.10.2
type ListDefaultSoundboardSounds struct{}
List Default Soundboard Sounds GET /soundboard-default-sounds https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds
func (*ListDefaultSoundboardSounds) Send ¶ added in v1.10.2
func (r *ListDefaultSoundboardSounds) Send(bot *Client) ([]*SoundboardSound, error)
Send sends a ListDefaultSoundboardSounds request to Discord and returns a []*SoundboardSound.
type ListEntitlements ¶ added in v1.10.2
type ListEntitlements struct { UserID *string `url:"user_id,omitempty"` Before *string `url:"before,omitempty"` After *string `url:"after,omitempty"` Limit *int `url:"limit,omitempty"` GuildID *string `url:"guild_id,omitempty"` ExcludeEnded *bool `url:"exclude_ended,omitempty"` ExcludeDeleted *bool `url:"exclude_deleted,omitempty"` SKUIDs []string `url:"sku_ids,omitempty"` }
List Entitlements GET /applications/{application.id}/entitlements https://discord.com/developers/docs/resources/entitlement#list-entitlements
func (*ListEntitlements) Send ¶ added in v1.10.2
func (r *ListEntitlements) Send(bot *Client) ([]*Entitlement, error)
Send sends a ListEntitlements request to Discord and returns a []*Entitlement.
type ListGuildEmojis ¶
type ListGuildEmojis struct {
GuildID string
}
List Guild Emojis GET /guilds/{guild.id}/emojis https://discord.com/developers/docs/resources/emoji#list-guild-emojis
type ListGuildMembers ¶
type ListGuildMembers struct { Limit *int `url:"limit,omitempty"` After *string `url:"after,omitempty"` GuildID string `url:"-"` }
List Guild Members GET /guilds/{guild.id}/members https://discord.com/developers/docs/resources/guild#list-guild-members
func (*ListGuildMembers) Send ¶
func (r *ListGuildMembers) Send(bot *Client) ([]*GuildMember, error)
Send sends a ListGuildMembers request to Discord and returns a []*GuildMember.
type ListGuildSoundboardSounds ¶ added in v1.10.2
type ListGuildSoundboardSounds struct {
GuildID string
}
List Guild Soundboard Sounds GET /guilds/{guild.id}/soundboard-sounds https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds
func (*ListGuildSoundboardSounds) Send ¶ added in v1.10.2
func (r *ListGuildSoundboardSounds) Send(bot *Client) (*SoundboardSound, error)
Send sends a ListGuildSoundboardSounds request to Discord and returns a SoundboardSound.
type ListGuildSoundboardSoundsResponse ¶ added in v1.10.2
type ListGuildSoundboardSoundsResponse struct {
Items []*SoundboardSound `json:"items"`
}
List Guild Soundboard Sounds Response https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds-response-structure
type ListGuildStickers ¶
type ListGuildStickers struct {
GuildID string
}
List Guild Stickers GET /guilds/{guild.id}/stickers https://discord.com/developers/docs/resources/sticker#list-guild-stickers
type ListJoinedPrivateArchivedThreads ¶
type ListJoinedPrivateArchivedThreads struct { Before *time.Time `url:"before,omitempty"` Limit *int `url:"limit,omitempty"` ChannelID string `url:"-"` }
List Joined Private Archived Threads GET /channels/{channel.id}/users/@me/threads/archived/private https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads
func (*ListJoinedPrivateArchivedThreads) Send ¶
func (r *ListJoinedPrivateArchivedThreads) Send(bot *Client) (*ListJoinedPrivateArchivedThreadsResponse, error)
Send sends a ListJoinedPrivateArchivedThreads request to Discord and returns a ListJoinedPrivateArchivedThreadsResponse.
type ListJoinedPrivateArchivedThreadsResponse ¶
type ListJoinedPrivateArchivedThreadsResponse struct { Threads []*Channel `json:"threads"` Members []*ThreadMember `json:"members"` HasMore bool `json:"has_more"` }
List Joined Private Archived Threads Response Body https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads-response-body
type ListPrivateArchivedThreads ¶
type ListPrivateArchivedThreads struct { Before *time.Time `url:"before,omitempty"` Limit *int `url:"limit,omitempty"` ChannelID string `url:"-"` }
List Private Archived Threads GET /channels/{channel.id}/threads/archived/private https://discord.com/developers/docs/resources/channel#list-private-archived-threads
func (*ListPrivateArchivedThreads) Send ¶
func (r *ListPrivateArchivedThreads) Send(bot *Client) (*ListPrivateArchivedThreadsResponse, error)
Send sends a ListPrivateArchivedThreads request to Discord and returns a ListPrivateArchivedThreadsResponse.
type ListPrivateArchivedThreadsResponse ¶
type ListPrivateArchivedThreadsResponse struct { Threads []*Channel `json:"threads"` Members []*ThreadMember `json:"members"` HasMore bool `json:"has_more"` }
List Private Archived Threads Response Body https://discord.com/developers/docs/resources/channel#list-private-archived-threads-response-body
type ListPublicArchivedThreads ¶
type ListPublicArchivedThreads struct { Before *time.Time `url:"before,omitempty"` Limit *int `url:"limit,omitempty"` ChannelID string `url:"-"` }
List Public Archived Threads GET /channels/{channel.id}/threads/archived/public https://discord.com/developers/docs/resources/channel#list-public-archived-threads
func (*ListPublicArchivedThreads) Send ¶
func (r *ListPublicArchivedThreads) Send(bot *Client) (*ListPublicArchivedThreadsResponse, error)
Send sends a ListPublicArchivedThreads request to Discord and returns a ListPublicArchivedThreadsResponse.
type ListPublicArchivedThreadsResponse ¶
type ListPublicArchivedThreadsResponse struct { Threads []*Channel `json:"threads"` Members []*ThreadMember `json:"members"` HasMore bool `json:"has_more"` }
List Public Archived Threads Response Body https://discord.com/developers/docs/resources/channel#list-public-archived-threads-response-body
type ListSKUSubscriptions ¶ added in v1.10.2
type ListSKUSubscriptions struct { Before *string `url:"before,omitempty"` After *string `url:"after,omitempty"` Limit *int `url:"limit,omitempty"` UserID *string `url:"user_id,omitempty"` SKUID string `url:"-"` }
List SKU Subscriptions GET skus/{sku.id}/subscriptions https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions
func (*ListSKUSubscriptions) Send ¶ added in v1.10.2
func (r *ListSKUSubscriptions) Send(bot *Client) ([]*Subscription, error)
Send sends a ListSKUSubscriptions request to Discord and returns a []*Subscription.
type ListSKUs ¶ added in v1.10.2
type ListSKUs struct { }
List SKUs GET applications/{application.id}/skus https://discord.com/developers/docs/resources/sku#list-skus
type ListScheduledEventsforGuild ¶
type ListScheduledEventsforGuild struct { WithUserCount *bool `url:"with_user_count,omitempty"` GuildID string `url:"-"` }
List Scheduled Events for Guild GET /guilds/{guild.id}/scheduled-events https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild
func (*ListScheduledEventsforGuild) Send ¶
func (r *ListScheduledEventsforGuild) Send(bot *Client) ([]*GuildScheduledEvent, error)
Send sends a ListScheduledEventsforGuild request to Discord and returns a []*GuildScheduledEvent.
type ListStickerPacks ¶ added in v1.10.2
type ListStickerPacks struct{}
List Sticker Packs GET /sticker-packs https://discord.com/developers/docs/resources/sticker#list-sticker-packs
func (*ListStickerPacks) Send ¶ added in v1.10.2
func (r *ListStickerPacks) Send(bot *Client) (*ListStickerPacksResponse, error)
Send sends a ListStickerPacks request to Discord and returns a ListStickerPacksResponse.
type ListStickerPacksResponse ¶ added in v1.10.2
type ListStickerPacksResponse struct {
StickerPacks []*StickerPack `json:"sticker_packs"`
}
List Sticker Packs Response https://discord.com/developers/docs/resources/sticker#list-sticker-packs-response-structure
type ListThreadMembers ¶
type ListThreadMembers struct { WithMember *bool `url:"with_member,omitempty"` After *string `url:"after,omitempty"` Limit *int `url:"limit,omitempty"` ChannelID string `url:"-"` }
List Thread Members GET /channels/{channel.id}/thread-members https://discord.com/developers/docs/resources/channel#list-thread-members
func (*ListThreadMembers) Send ¶
func (r *ListThreadMembers) Send(bot *Client) ([]*ThreadMember, error)
Send sends a ListThreadMembers request to Discord and returns a []*ThreadMember.
type ListVoiceRegions ¶
type ListVoiceRegions struct{}
List Voice Regions GET /voice/regions https://discord.com/developers/docs/resources/voice#list-voice-regions
func (*ListVoiceRegions) Send ¶
func (r *ListVoiceRegions) Send(bot *Client) ([]*VoiceRegion, error)
Send sends a ListVoiceRegions request to Discord and returns a []*VoiceRegion.
type Message ¶
type Message struct { Timestamp time.Time `json:"timestamp"` Thread *Channel `json:"thread"` RoleSubscriptionData *RoleSubscriptionData `json:"role_subscription_data,omitempty"` Member *GuildMember `json:"member,omitempty"` Activity *MessageActivity `json:"activity,omitempty"` EditedTimestamp *time.Time `json:"edited_timestamp"` GuildID *string `json:"guild_id,omitempty"` Call *MessageCall `json:"call,omitempty"` Poll *Poll `json:"poll,omitempty"` Resolved *ResolvedData `json:"resolved,omitempty"` Flags *BitFlag `json:"flags,omitempty"` Position *int `json:"position,omitempty"` Interaction *MessageInteraction `json:"interaction"` ApplicationID *string `json:"application_id,omitempty"` Nonce *Nonce `json:"nonce,omitempty"` ReferencedMessage **Message `json:"referenced_message,omitempty"` WebhookID *string `json:"webhook_id,omitempty"` MessageReference *MessageReference `json:"message_reference,omitempty"` Application *Application `json:"application,omitempty"` Author *User `json:"author"` InteractionMetadata MessageComponentInteractionMetadata `json:"interaction_metadata,omitempty"` ChannelID string `json:"channel_id"` ID string `json:"id"` Content string `json:"content"` Components []Component `json:"components"` Reactions []*Reaction `json:"reactions,omitempty"` Embeds []*Embed `json:"embeds"` MessageSnapshots []*MessageSnapshot `json:"message_snapshots,omitempty"` StickerItems []*StickerItem `json:"sticker_items"` Attachments []*Attachment `json:"attachments"` MentionChannels []*ChannelMention `json:"mention_channels,omitempty"` MentionRoles []string `json:"mention_roles"` Mentions []*User `json:"mentions"` Pinned bool `json:"pinned"` MentionEveryone bool `json:"mention_everyone"` TTS bool `json:"tts"` Type Flag `json:"type"` }
Message Object https://discord.com/developers/docs/resources/channel#message-object
func (*Message) UnmarshalJSON ¶
type MessageActivity ¶
Message Activity Structure https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure
type MessageCall ¶ added in v1.10.2
type MessageCall struct { EndedTimestamp **time.Time `json:"ended_timestamp,omitempty"` Participants []string `json:"participants"` }
Message Call Object Structure https://discord.com/developers/docs/resources/message#message-call-object
type MessageComponentData ¶
type MessageComponentData struct { Resolved *ResolvedData `json:"resolved,omitempty"` CustomID string `json:"custom_id"` Values []*SelectMenuOption `json:"values,omitempty"` ComponentType Flag `json:"component_type"` }
Message Component Data Structure https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-message-component-data-structure
func (MessageComponentData) InteractionDataType ¶
func (d MessageComponentData) InteractionDataType() Flag
type MessageComponentInteractionMetadata ¶ added in v1.10.2
type MessageComponentInteractionMetadata struct { User *User `json:"user"` AuthorizingIntegrationOwners map[Flag]string `json:"authorizing_integration_owners"` OriginalResponseMessageID *string `json:"original_response_message_id,omitempty"` ID string `json:"id"` InteractedMessageID string `json:"interacted_message_id"` Type Flag `json:"type"` }
Message Component Interaction Metadata Structure https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-message-component-interaction-metadata-structure
func (MessageComponentInteractionMetadata) MessageInteractionMetadata ¶ added in v1.10.2
func (d MessageComponentInteractionMetadata) MessageInteractionMetadata() Flag
type MessageCreate ¶
type MessageCreate struct {
*Message
}
Message Create https://discord.com/developers/docs/topics/gateway-events#message-create
func (*MessageCreate) UnmarshalJSON ¶
func (e *MessageCreate) UnmarshalJSON(b []byte) error
type MessageDelete ¶
type MessageDelete struct { GuildID *string `json:"guild_id,omitempty"` MessageID string `json:"id"` ChannelID string `json:"channel_id"` }
Message Delete https://discord.com/developers/docs/topics/gateway-events#message-delete
type MessageDeleteBulk ¶
type MessageDeleteBulk struct { GuildID *string `json:"guild_id,omitempty"` ChannelID string `json:"channel_id"` MessageIDs []string `json:"ids"` }
Message Delete Bulk https://discord.com/developers/docs/topics/gateway-events#message-delete-bulk
type MessageInteraction ¶
type MessageInteraction struct { User *User `json:"user"` Member *GuildMember `json:"member,omitempty"` ID string `json:"id"` Name string `json:"name"` Type Flag `json:"type"` }
Message Interaction Structure https://discord.com/developers/docs/interactions/receiving-and-responding#message-interaction-object-message-interaction-structure
type MessageInteractionMetadata ¶ added in v1.10.2
type MessageInteractionMetadata interface {
MessageInteractionMetadata() Flag
}
Message Interaction Metadata Object https://discord.com/developers/docs/resources/message#message-interaction-metadata-object
type MessagePollVoteAdd ¶ added in v1.10.2
type MessagePollVoteAdd struct { GuildID *string `json:"guild_id,omitempty"` UserID string `json:"user_id"` ChannelID string `json:"channel_id"` MessageID string `json:"message_id"` AnswerID int `json:"answer_id"` }
Message Poll Vote Add https://discord.com/developers/docs/events/gateway-events#message-poll-vote-add
type MessagePollVoteRemove ¶ added in v1.10.2
type MessagePollVoteRemove struct { GuildID *string `json:"guild_id,omitempty"` UserID string `json:"user_id"` ChannelID string `json:"channel_id"` MessageID string `json:"message_id"` AnswerID int `json:"answer_id"` }
Message Poll Vote Remove https://discord.com/developers/docs/events/gateway-events#message-poll-vote-remove
type MessageReactionAdd ¶
type MessageReactionAdd struct { MessageAuthorID *string `json:"message_author_id"` GuildID *string `json:"guild_id,omitempty"` Member *GuildMember `json:"member,omitempty"` Emoji *Emoji `json:"emoji"` UserID string `json:"user_id"` ChannelID string `json:"channel_id"` MessageID string `json:"message_id"` BurstColors []string `json:"burst_colors,omitempty"` Burst bool `json:"burst"` Type Flag `json:"type"` }
Message Reaction Add https://discord.com/developers/docs/topics/gateway-events#message-reaction-add
type MessageReactionRemove ¶
type MessageReactionRemove struct { GuildID *string `json:"guild_id,omitempty"` Emoji *Emoji `json:"emoji"` UserID string `json:"user_id"` ChannelID string `json:"channel_id"` MessageID string `json:"message_id"` Burst bool `json:"burst"` Type Flag `json:"type"` }
Message Reaction Remove https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove
type MessageReactionRemoveAll ¶
type MessageReactionRemoveAll struct { GuildID *string `json:"guild_id,omitempty"` ChannelID string `json:"channel_id"` MessageID string `json:"message_id"` }
Message Reaction Remove All https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all
type MessageReactionRemoveEmoji ¶
type MessageReactionRemoveEmoji struct { GuildID *string `json:"guild_id,omitempty"` Emoji *Emoji `json:"emoji"` ChannelID string `json:"channel_id"` MessageID string `json:"message_id"` }
Message Reaction Remove Emoji https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-emoji
type MessageReference ¶
type MessageReference struct { MessageID *string `json:"message_id,omitempty"` ChannelID *string `json:"channel_id,omitempty"` GuildID *string `json:"guild_id,omitempty"` FailIfNotExists *bool `json:"fail_if_not_exists,omitempty"` Type Flag `json:"type"` }
Message Reference Object https://discord.com/developers/docs/resources/channel#message-reference-object
type MessageSnapshot ¶ added in v1.10.2
type MessageSnapshot struct {
Message *Message `json:"message"`
}
Message Snapshot Structure https://discord.com/developers/docs/resources/message#message-snapshot-structure
type MessageUpdate ¶
type MessageUpdate struct {
*Message
}
Message Update https://discord.com/developers/docs/topics/gateway-events#message-update
func (*MessageUpdate) UnmarshalJSON ¶
func (e *MessageUpdate) UnmarshalJSON(b []byte) error
type Messages ¶
type Messages struct { TTS *bool `json:"tts,omitempty"` Content *string `json:"content,omitempty"` AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"` Flags *BitFlag `json:"flags,omitempty"` Poll *Poll `json:"poll,omitempty"` Embeds []*Embed `json:"embeds,omitempty"` Components []Component `json:"components,omitempty"` Attachments []*Attachment `json:"attachments,omitempty"` }
func (Messages) InteractionCallbackDataType ¶
func (*Messages) UnmarshalJSON ¶
type Modal ¶
type Modal struct { CustomID string `json:"custom_id"` Title string `json:"title"` Components []Component `json:"components"` }
func (Modal) InteractionCallbackDataType ¶
func (*Modal) UnmarshalJSON ¶
type ModalSubmitData ¶
type ModalSubmitData struct { CustomID string `json:"custom_id"` Components []Component `json:"components"` }
Modal Submit Data Structure https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure
func (ModalSubmitData) InteractionDataType ¶
func (d ModalSubmitData) InteractionDataType() Flag
func (*ModalSubmitData) UnmarshalJSON ¶
func (r *ModalSubmitData) UnmarshalJSON(b []byte) error
type ModalSubmitInteractionMetadata ¶ added in v1.10.2
type ModalSubmitInteractionMetadata struct { TriggeringInteractionMetadata MessageInteractionMetadata `json:"triggering_interaction_metadata"` User *User `json:"user"` AuthorizingIntegrationOwners map[Flag]string `json:"authorizing_integration_owners"` OriginalResponseMessageID *string `json:"original_response_message_id,omitempty"` ID string `json:"id"` Type Flag `json:"type"` }
Modal Submit Interaction Metadata Structure https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-modal-submit-interaction-metadata-structure
func (ModalSubmitInteractionMetadata) MessageInteractionMetadata ¶ added in v1.10.2
func (d ModalSubmitInteractionMetadata) MessageInteractionMetadata() Flag
type ModifyApplicationEmoji ¶ added in v1.10.2
Modify Application Emoji PATCH /applications/{application.id}/emojis/{emoji.id} https://discord.com/developers/docs/resources/emoji#modify-application-emoji
type ModifyAutoModerationRule ¶
type ModifyAutoModerationRule struct { GuildID string `json:"-"` AutoModerationRuleID string `json:"-"` Name *string `json:"name,omitempty"` EventType *Flag `json:"event_type,omitempty"` TriggerType *Flag `json:"trigger_type,omitempty"` TriggerMetadata *TriggerMetadata `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"` }
Modify Auto Moderation Rule PATCH /guilds/{guild.id}/auto-moderation/rules/{auto_moderation_rule.id} https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
func (*ModifyAutoModerationRule) Send ¶
func (r *ModifyAutoModerationRule) Send(bot *Client) (*AutoModerationRule, error)
Send sends a ModifyAutoModerationRule request to Discord and returns a AutoModerationRule.
type ModifyChannel ¶
type ModifyChannel struct {
ChannelID string
}
Modify Channel PATCH /channels/{channel.id} https://discord.com/developers/docs/resources/channel#modify-channel
type ModifyChannelGroupDM ¶
type ModifyChannelGroupDM struct { Name *string `json:"name,omitempty"` Icon *string `json:"icon,omitempty"` ChannelID string `json:"-"` }
Modify Channel Group DM PATCH /channels/{channel.id} https://discord.com/developers/docs/resources/channel#modify-channel-json-params-group-dm
type ModifyChannelGuild ¶
type ModifyChannelGuild struct { UserLimit **int `json:"user_limit,omitempty"` DefaultSortOrder **Flag `json:"default_sort_order,omitempty"` PermissionOverwrites *[]*PermissionOverwrite `json:"permission_overwrites,omitempty"` Position **int `json:"position,omitempty"` Topic **string `json:"topic,omitempty"` NSFW **bool `json:"nsfw,omitempty"` RateLimitPerUser **int `json:"rate_limit_per_user,omitempty"` Bitrate **int `json:"bitrate,omitempty"` Type *Flag `json:"type,omitempty"` Name *string `json:"name,omitempty"` RTCRegion **string `json:"rtc_region,omitempty"` ParentID **string `json:"parent_id,omitempty"` VideoQualityMode **Flag `json:"video_quality_mode,omitempty"` DefaultAutoArchiveDuration **int `json:"default_auto_archive_duration,omitempty"` Flags *BitFlag `json:"flags,omitempty"` DefaultThreadRateLimitPerUser *int `json:"default_thread_rate_limit_per_user,omitempty"` DefaultReactionEmoji **DefaultReaction `json:"default_reaction_emoji,omitempty"` ChannelID string `json:"-"` AvailableTags []*ForumTag `json:"available_tags,omitempty"` }
Modify Channel Guild PATCH /channels/{channel.id} https://discord.com/developers/docs/resources/channel#modify-channel-json-params-guild-channel
type ModifyChannelThread ¶
type ModifyChannelThread struct { ChannelID string `json:"-"` Name *string `json:"name,omitempty"` Archived *bool `json:"archived,omitempty"` AutoArchiveDuration *int `json:"auto_archive_duration,omitempty"` Locked *bool `json:"locked,omitempty"` Invitable *bool `json:"invitable,omitempty"` RateLimitPerUser **int `json:"rate_limit_per_user,omitempty"` Flags *BitFlag `json:"flags,omitempty"` AppliedTags []string `json:"applied_tags,omitempty"` }
Modify Channel PATCH /channels/{channel.id} https://discord.com/developers/docs/resources/channel#modify-channel-json-params-thread
type ModifyCurrentMember ¶
Modify Current Member PATCH /guilds/{guild.id}/members/@me https://discord.com/developers/docs/resources/guild#modify-current-member
func (*ModifyCurrentMember) Send ¶
func (r *ModifyCurrentMember) Send(bot *Client) (*GuildMember, error)
Send sends a ModifyCurrentMember request to Discord and returns a GuildMember.
type ModifyCurrentUser ¶
type ModifyCurrentUser struct { Username *string `json:"username,omitempty"` Avatar *string `json:"avatar,omitempty"` Banner *string `json:"banner,omitempty"` }
Modify Current User PATCH /users/@me https://discord.com/developers/docs/resources/user#modify-current-user
type ModifyCurrentUserVoiceState ¶
type ModifyCurrentUserVoiceState struct { ChannelID *string `json:"channel_id,omitempty"` Suppress *bool `json:"suppress,omitempty"` RequestToSpeakTimestamp **time.Time `json:"request_to_speak_timestamp,omitempty"` GuildID string `json:"-"` }
Modify Current User Voice State PATCH /guilds/{guild.id}/voice-states/@me https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
func (*ModifyCurrentUserVoiceState) Send ¶
func (r *ModifyCurrentUserVoiceState) Send(bot *Client) error
Send sends a ModifyCurrentUserVoiceState request to Discord and returns a error.
type ModifyGuild ¶
type ModifyGuild struct { DiscoverySplash **string `json:"discovery_splash,omitempty"` PreferredLocale **string `json:"preferred_locale,omitempty"` SafetyAlertsChannelID **string `json:"safety_alerts_channel_id,omitempty"` SystemChannelID **string `json:"system_channel_id,omitempty"` Banner **string `json:"banner,omitempty"` AFKChannelID **string `json:"afk_channel_id,omitempty"` PremiumProgressBarEnabled *bool `json:"premium_progress_bar_enabled,omitempty"` Icon **string `json:"icon,omitempty"` Description **string `json:"description,omitempty"` Splash **string `json:"splash,omitempty"` VerificationLevel **Flag `json:"verification_level,omitempty"` ExplicitContentFilter **Flag `json:"explicit_content_filter,omitempty"` DefaultMessageNotifications **Flag `json:"default_message_notifications,omitempty"` SystemChannelFlags *BitFlag `json:"system_channel_flags,omitempty"` RulesChannelID **string `json:"rules_channel_id,omitempty"` PublicUpdatesChannelID **string `json:"public_updates_channel_id,omitempty"` Name *string `json:"name,omitempty"` OwnerID string `json:"owner_id,omitempty"` GuildID string `json:"-"` Features []*string `json:"features,omitempty"` AfkTimeout int `json:"afk_timeout,omitempty"` }
Modify Guild PATCH /guilds/{guild.id} https://discord.com/developers/docs/resources/guild#modify-guild
type ModifyGuildChannelPositionParameters ¶
type ModifyGuildChannelPositionParameters struct { Position **int `json:"position,omitempty"` LockPermissions **bool `json:"lock_permissions,omitempty"` ParentID **string `json:"parent_id,omitempty"` ID string `json:"id"` }
Modify Guild Channel Position Parameters https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions-json-params
type ModifyGuildChannelPositions ¶
type ModifyGuildChannelPositions struct { GuildID string `json:"-"` Parameters []*ModifyGuildChannelPositionParameters `json:"parameters"` }
Modify Guild Channel Positions PATCH /guilds/{guild.id}/channels https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
func (*ModifyGuildChannelPositions) MarshalJSON ¶
func (r *ModifyGuildChannelPositions) MarshalJSON() ([]byte, error)
func (*ModifyGuildChannelPositions) Send ¶
func (r *ModifyGuildChannelPositions) Send(bot *Client) error
Send sends a ModifyGuildChannelPositions request to Discord and returns a error.
type ModifyGuildEmoji ¶
type ModifyGuildEmoji struct { Name *string `json:"name,omitempty"` Roles *[]string `json:"roles"` GuildID string `json:"-"` EmojiID string `json:"-"` }
Modify Guild Emoji PATCH /guilds/{guild.id}/emojis/{emoji.id} https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
type ModifyGuildMFALevel ¶
Modify Guild MFA Level POST /guilds/{guild.id}/mfa https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level
func (*ModifyGuildMFALevel) Send ¶
func (r *ModifyGuildMFALevel) Send(bot *Client) (*ModifyGuildMFALevelResponse, error)
Send sends a ModifyGuildMFALevel request to Discord and returns a ModifyGuildMFALevelResponse.
type ModifyGuildMFALevelResponse ¶
type ModifyGuildMFALevelResponse struct {
Level Flag `json:"level"`
}
Modify Guild MFA Level Response https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level
type ModifyGuildMember ¶
type ModifyGuildMember struct { Nick **string `json:"nick,omitempty"` Roles *[]string `json:"roles,omitempty"` Mute **bool `json:"mute,omitempty"` Deaf **bool `json:"deaf,omitempty"` ChannelID **string `json:"channel_id,omitempty"` CommunicationDisabledUntil **time.Time `json:"communication_disabled_until,omitempty"` Flags **BitFlag `json:"flags,omitempty"` GuildID string `json:"-"` UserID string `json:"-"` }
Modify Guild Member PATCH /guilds/{guild.id}/members/{user.id} https://discord.com/developers/docs/resources/guild#modify-guild-member
func (*ModifyGuildMember) Send ¶
func (r *ModifyGuildMember) Send(bot *Client) (*GuildMember, error)
Send sends a ModifyGuildMember request to Discord and returns a GuildMember.
type ModifyGuildOnboarding ¶ added in v1.10.2
type ModifyGuildOnboarding struct { GuildID string `json:"-"` Prompts []*OnboardingPrompt `json:"prompts"` DefaultChannelIDs []string `json:"default_channel_ids"` Enabled bool `json:"enabled"` Mode Flag `json:"mode"` }
Modify Guild Onboarding PUT /guilds/{guild.id}/onboarding https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
func (*ModifyGuildOnboarding) Send ¶ added in v1.10.2
func (r *ModifyGuildOnboarding) Send(bot *Client) (*GuildOnboarding, error)
Send sends a ModifyGuildOnboarding request to Discord and returns a GuildOnboarding.
type ModifyGuildRole ¶
type ModifyGuildRole struct { Name **string `json:"name,omitempty"` Permissions **string `json:"permissions,omitempty"` Color **int `json:"color,omitempty"` Hoist **bool `json:"hoist,omitempty"` Icon **string `json:"icon,omitempty"` UnicodeEmoji **string `json:"unicode_emoji,omitempty"` Mentionable **bool `json:"mentionable,omitempty"` GuildID string `json:"-"` RoleID string `json:"-"` }
Modify Guild Role PATCH /guilds/{guild.id}/roles/{role.id} https://discord.com/developers/docs/resources/guild#modify-guild-role
type ModifyGuildRolePositionParameters ¶
type ModifyGuildRolePositionParameters struct { Position **int `json:"position,omitempty"` ID string `json:"id"` }
Modify Guild Role Position Parameters https://discord.com/developers/docs/resources/guild#create-guild-role-json-params
type ModifyGuildRolePositions ¶
type ModifyGuildRolePositions struct { GuildID string `json:"-"` Parameters []*ModifyGuildRolePositionParameters `json:"parameters"` }
Modify Guild Role Positions PATCH /guilds/{guild.id}/roles https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
func (*ModifyGuildRolePositions) MarshalJSON ¶
func (r *ModifyGuildRolePositions) MarshalJSON() ([]byte, error)
type ModifyGuildScheduledEvent ¶
type ModifyGuildScheduledEvent struct { ChannelID *string `json:"channel_id,omitempty"` EntityMetadata **GuildScheduledEventEntityMetadata `json:"entity_metadata,omitempty"` Name *string `json:"name,omitempty"` PrivacyLevel *Flag `json:"privacy_level,omitempty"` ScheduledStartTime *time.Time `json:"scheduled_start_time,omitempty"` ScheduledEndTime *time.Time `json:"scheduled_end_time,omitempty"` Description **string `json:"description,omitempty"` EntityType *Flag `json:"entity_type,omitempty"` Status *Flag `json:"status,omitempty"` Image *string `json:"image,omitempty"` GuildID string `json:"-"` GuildScheduledEventID string `json:"-"` }
Modify Guild Scheduled Event PATCH /guilds/{guild.id}/scheduled-events/{guild_scheduled_event.id} https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
func (*ModifyGuildScheduledEvent) Send ¶
func (r *ModifyGuildScheduledEvent) Send(bot *Client) (*GuildScheduledEvent, error)
Send sends a ModifyGuildScheduledEvent request to Discord and returns a GuildScheduledEvent.
type ModifyGuildSoundboardSound ¶ added in v1.10.2
type ModifyGuildSoundboardSound struct { Volume *float64 `json:"volume"` EmojiID *string `json:"emoji_id"` EmojiName *string `json:"emoji_name"` GuildID string `json:"-"` SoundID string `json:"-"` Name string `json:"name"` }
Modify Guild Soundboard Sound PATCH/guilds/{guild.id}/soundboard-sounds/{sound.id} https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound
func (*ModifyGuildSoundboardSound) Send ¶ added in v1.10.2
func (r *ModifyGuildSoundboardSound) Send(bot *Client) (*SoundboardSound, error)
Send sends a ModifyGuildSoundboardSound request to Discord and returns a SoundboardSound.
type ModifyGuildSticker ¶
type ModifyGuildSticker struct { Name *string `json:"name,omitempty"` Description **string `json:"description,omitempty"` Tags *string `json:"tags,omitempty"` GuildID string `json:"-"` StickerID string `json:"-"` }
Modify Guild Sticker PATCH /guilds/{guild.id}/stickers/{sticker.id} https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
type ModifyGuildTemplate ¶
type ModifyGuildTemplate struct { Name *string `json:"name,omitempty"` Description **string `json:"description,omitempty"` GuildID string TemplateCode string `json:"-"` }
Modify Guild Template PATCH /guilds/{guild.id}/templates/{template.code} https://discord.com/developers/docs/resources/guild-template#modify-guild-template
func (*ModifyGuildTemplate) Send ¶
func (r *ModifyGuildTemplate) Send(bot *Client) (*GuildTemplate, error)
Send sends a ModifyGuildTemplate request to Discord and returns a GuildTemplate.
type ModifyGuildWelcomeScreen ¶
type ModifyGuildWelcomeScreen struct { Enabled **bool `json:"enabled,omitempty"` WelcomeChannels *[]*WelcomeScreenChannel `json:"welcome_channels,omitempty"` Description **string `json:"description,omitempty"` GuildID string `json:"-"` }
Modify Guild Welcome Screen PATCH /guilds/{guild.id}/welcome-screen https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
func (*ModifyGuildWelcomeScreen) Send ¶
func (r *ModifyGuildWelcomeScreen) Send(bot *Client) (*WelcomeScreen, error)
Send sends a ModifyGuildWelcomeScreen request to Discord and returns a WelcomeScreen.
type ModifyGuildWidget ¶
type ModifyGuildWidget struct {
GuildID string
}
Modify Guild Widget PATCH /guilds/{guild.id}/widget https://discord.com/developers/docs/resources/guild#modify-guild-widget
func (*ModifyGuildWidget) Send ¶
func (r *ModifyGuildWidget) Send(bot *Client) (*GuildWidget, error)
Send sends a ModifyGuildWidget request to Discord and returns a GuildWidget.
type ModifyStageInstance ¶
type ModifyStageInstance struct { Topic *string `json:"topic,omitempty"` PrivacyLevel *Flag `json:"privacy_level,omitempty"` ChannelID string `json:"-"` }
Modify Stage Instance PATCH /stage-instances/{channel.id} https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance
func (*ModifyStageInstance) Send ¶
func (r *ModifyStageInstance) Send(bot *Client) (*StageInstance, error)
Send sends a ModifyStageInstance request to Discord and returns a StageInstance.
type ModifyUserVoiceState ¶
type ModifyUserVoiceState struct { Suppress *bool `json:"suppress,omitempty"` GuildID string `json:"-"` UserID string `json:"-"` ChannelID string `json:"channel_id"` }
Modify User Voice State PATCH /guilds/{guild.id}/voice-states/{user.id} https://discord.com/developers/docs/resources/guild#modify-user-voice-state
func (*ModifyUserVoiceState) Send ¶
func (r *ModifyUserVoiceState) Send(bot *Client) error
Send sends a ModifyUserVoiceState request to Discord and returns a error.
type ModifyWebhook ¶
type ModifyWebhook struct { Name *string `json:"name,omitempty"` Avatar **string `json:"avatar,omitempty"` ChannelID *string `json:"channel_id,omitempty"` WebhookID string `json:"-"` }
Modify Webhook PATCH /webhooks/{webhook.id} https://discord.com/developers/docs/resources/webhook#modify-webhook
type ModifyWebhookwithToken ¶
type ModifyWebhookwithToken struct { Name *string `json:"name,omitempty"` Avatar **string `json:"avatar,omitempty"` WebhookID string WebhookToken string }
Modify Webhook with Token PATCH /webhooks/{webhook.id}/{webhook.token} https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token
type Nonce ¶
type Nonce string
Nonce represents a Discord nonce (integer or string).
func (*Nonce) UnmarshalJSON ¶
type OnboardingPrompt ¶ added in v1.10.1
type OnboardingPrompt struct { ID string `json:"id"` Title string `json:"title"` Options []*PromptOption `json:"options"` Type Flag `json:"type"` SingleSelect bool `json:"single_select"` Required bool `json:"required"` InOnboarding bool `json:"in_onboarding"` }
Onboarding Prompt Structure https://discord.com/developers/docs/resources/guild#guild-onboarding-object-onboarding-prompt-structure
type PermissionOverwrite ¶
type PermissionOverwrite struct { ID string `json:"id"` Deny string `json:"deny"` Allow string `json:"allow"` Type Flag `json:"type"` }
Overwrite Object https://discord.com/developers/docs/resources/channel#overwrite-object
type PinMessage ¶
Pin Message PUT /channels/{channel.id}/pins/{message.id} https://discord.com/developers/docs/resources/channel#pin-message
func (*PinMessage) Send ¶
func (r *PinMessage) Send(bot *Client) error
Send sends a PinMessage request to Discord and returns a error.
type PointerIndicator ¶
type PointerIndicator uint8
PointerIndicator represents a Dasgo double pointer value indicator.
const ( // IsValueNothing indicates that the field was not provided. // // The double pointer is nil. IsValueNothing PointerIndicator = 0 // IsValueNull indicates the field was provided with a null value. // // The double pointer points to a nil pointer. IsValueNull PointerIndicator = 1 // IsValueValid indicates that the field is a valid value. // // The double pointer points to a pointer that points to a value. IsValueValid PointerIndicator = 2 )
func PointerCheck ¶
func PointerCheck[T any](dp **T) PointerIndicator
PointerCheck returns whether the given double pointer contains a value.
returns IsValueNothing, IsValueNull, or IsValueValid.
IsValueNothing indicates that the field was not provided. IsValueNull indicates the field was provided with a null value. IsValueValid indicates that the field is a valid value.
type Poll ¶ added in v1.10.2
type Poll struct { Question *PollMedia `json:"question"` Expiry *time.Time `json:"expiry"` Results *PollResults `json:"results,omitempty"` Answers []*PollAnswer `json:"answers"` LayoutType int `json:"layout_type"` AllowMultiselect bool `json:"allow_multiselect"` }
type PollAnswer ¶ added in v1.10.2
Poll Answer Object Structure https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure
type PollAnswerCount ¶ added in v1.10.2
type PollAnswerCount struct { ID int `json:"id"` Count int `json:"count"` MeVoted bool `json:"me_voted"` }
Poll Answer Count Object Structure https://discord.com/developers/docs/resources/poll#poll-results-object-poll-answer-count-object-structure
type PollCreateRequest ¶ added in v1.10.2
type PollCreateRequest struct { Question *PollMedia `json:"question"` Duration *int `json:"expiry,omitempty"` AllowMultiselect *bool `json:"allow_multiselect,omitempty"` LayoutType *int `json:"layout_type,omitempty"` Answers []*PollAnswer `json:"answers"` }
Poll Create Request Object Structure https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure
type PollMedia ¶ added in v1.10.2
type PollMedia struct { Text *string `json:"text,omitempty"` Emoji *Emoji `json:"emoji,omitempty"` }
Poll Media Object Structure https://discord.com/developers/docs/resources/poll#layout-type
type PollResults ¶ added in v1.10.2
type PollResults struct { AnswerCounts []*PollAnswerCount `json:"answer_counts"` IsFinalized bool `json:"is_finalized"` }
Poll Results Object Structure https://discord.com/developers/docs/resources/poll#poll-results-object-poll-results-object-structure
type PresenceUpdate ¶
type PresenceUpdate struct { User *User `json:"user"` ClientStatus *ClientStatus `json:"client_status"` GuildID string `json:"guild_id"` Status string `json:"status"` Activities []*Activity `json:"activities"` }
Presence Update Event Fields https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields
type PromptOption ¶ added in v1.10.1
type PromptOption struct { EmojiID *string `json:"emoji_id,omitempty"` EmojiName *string `json:"emoji_name,omitempty"` EmojiAnimated *bool `json:"emoji_animated,omitempty"` Description *string `json:"description"` ID string `json:"id"` Title string `json:"title"` ChannelIDs []string `json:"channel_ids"` RoleIDs []string `json:"role_ids"` Emoji []*Emoji `json:"emoji"` }
Prompt Option Structure https://discord.com/developers/docs/resources/guild#guild-onboarding-object-prompt-option-structure
type RateLimit ¶
type RateLimit struct { // DefaultBucket represents a Default Rate Limit Bucket, which is used to control // the rate of the "first request(s) for any given route". // // This is necessary since Discord uses dynamic per-route token rate limits. // As a result, a route's actual Rate Limit Bucket can NOT be discovered until a request (for that route) is sent. // // A Default Rate Limit Bucket can be set at multiple levels. // // Route (RateLimit.DefaultBucket): Used when a per-route request's bucket is NOT initialized (i.e route 16*). // Resource (Route Bucket Hash): Used when a per-resource request's bucket is NOT initialized (i.e route 16, resource 32*). // Resource(s) (Resource Bucket Hash): Used when an nth degree per-resource request's bucket is NOT initialized (i.e route 16; resource 32; resource 7*). // So on and so forth... // *A request is NOT initialized when it has never been set (to a bucket or nil). // // Set the DefaultBucket to `nil` to disable the Default Rate Limit Bucket mechanism. // // Use a Default Bucket's Limit field-value to control how many requests of // a given route can be sent (per second) BEFORE the actual Rate Limit Bucket of that route is known. DefaultBucket *Bucket // contains filtered or unexported fields }
RateLimit provides concurrency-safe rate limit functionality by implementing the RateLimiter interface.
func (*RateLimit) GetBucketFromID ¶
func (*RateLimit) GetBucketID ¶
func (*RateLimit) SetBucketFromID ¶
func (*RateLimit) SetBucketID ¶
func (*RateLimit) SetDefaultBucket ¶
type RateLimitHeader ¶
type RateLimitHeader struct { Bucket string `http:"X-RateLimit-Bucket,omitempty"` Scope string `http:"X-RateLimit-Scope,omitempty"` Limit int `http:"X-RateLimit-Limit,omitempty"` Remaining int `http:"X-RateLimit-Remaining,omitempty"` Reset float64 `http:"X-RateLimit-Reset,omitempty"` ResetAfter float64 `http:"X-RateLimit-Reset-After,omitempty"` Global bool `http:"X-RateLimit-Global,omitempty"` }
Rate Limit Header https://discord.com/developers/docs/topics/rate-limits#header-format
type RateLimitResponse ¶
type RateLimitResponse struct { Code *int `json:"code,omitempty"` Message string `json:"message"` RetryAfter float64 `json:"retry_after"` Global bool `json:"global"` }
Rate Limit Response Structure https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit-rate-limit-response-structure
type RateLimiter ¶
type RateLimiter interface { // SetBucketID maps a Route ID to a Rate Limit Bucket ID (Discord Hash). // // ID 0 is reserved for a Global Rate Limit Bucket or nil. SetBucketID(routeid string, bucketid string) // GetBucketID gets a Rate Limit Bucket ID (Discord Hash) using a Route ID. GetBucketID(routeid string) string // SetBucketFromID maps a Bucket ID to a Rate Limit Bucket. SetBucketFromID(bucketid string, bucket *Bucket) // GetBucketFromID gets a Rate Limit Bucket using the given Bucket ID. GetBucketFromID(bucketid string) *Bucket // SetBucket maps a Route ID to a Rate Limit Bucket. // // ID 0 is reserved for a Global Rate Limit Bucket or nil. SetBucket(routeid string, bucket *Bucket) // GetBucket gets a Rate Limit Bucket using the given Route ID + Resource ID. // // Implements the Default Bucket mechanism by assigning the GetBucketID(routeid) when applicable. GetBucket(routeid string, resourceid string) *Bucket // SetDefaultBucket sets the Default Bucket for per-route rate limits. SetDefaultBucket(bucket *Bucket) // Lock locks the rate limiter. // // If the lock is already in use, the calling goroutine blocks until the rate limiter is available. // // This prevents multiple requests from being PROCESSED at once, which prevents race conditions. // In other words, a single request is PROCESSED from a rate limiter when Lock is implemented and called. // // This does NOT prevent multiple requests from being SENT at a time. Lock() // Unlock unlocks the rate limiter. // // If the rate limiter holds multiple locks, unlocking will unblock another goroutine, // which allows another request to be processed. Unlock() // StartTx starts a transaction with the rate limiter. // // If a transaction is already started, the calling goroutine blocks until the rate limiter is available. // // This prevents the transaction (of Rate Limit Bucket reads and writes) from concurrent manipulation. StartTx() // EndTx ends a transaction with the rate limiter. // // If the rate limiter holds multiple transactions, ending one will unblock another goroutine, // which allows another transaction to start. EndTx() }
RateLimiter represents an interface for rate limits.
RateLimiter is an interface which allows developers to use multi-application architectures, which run multiple applications on separate processes or servers.
type Reaction ¶
type Reaction struct { CountDetails *ReactionCountDetails `json:"count_details"` Emoji *Emoji `json:"emoji"` BurstColors []string `json:"burst_colors"` Count int `json:"count"` Me bool `json:"me"` MeBurst bool `json:"me_burst"` }
Reaction Object https://discord.com/developers/docs/resources/channel#reaction-object
type ReactionCountDetails ¶ added in v1.10.2
Reaction Count Details Structure https://discord.com/developers/docs/resources/message#reaction-count-details-object-reaction-count-details-structure
type Ready ¶
type Ready struct { User *User `json:"user"` Shard *[2]int `json:"shard,omitempty"` Application *Application `json:"application"` SessionID string `json:"session_id"` ResumeGatewayURL string `json:"resume_gateway_url"` Guilds []*Guild `json:"guilds"` Version int `json:"v"` }
Ready Event Fields https://discord.com/developers/docs/topics/gateway-events#ready-ready-event-fields
type Reconnect ¶
type Reconnect struct{}
Reconnect https://discord.com/developers/docs/topics/gateway-events#reconnect
type RedirectURI ¶
type RedirectURI struct { AccessToken string `url:"access_token,omitempty"` TokenType string `url:"token_type,omitempty"` Scope string `url:"scope,omitempty"` State string `url:"state,omitempty"` ExpiresIn time.Duration `url:"expires_in,omitempty"` }
Redirect URI https://discord.com/developers/docs/topics/oauth2#implicit-grant-redirect-url-example
type RedirectURL ¶
type RedirectURL struct { Code string `url:"code,omitempty"` State string `url:"state,omitempty"` // https://discord.com/developers/docs/topics/oauth2#advanced-bot-authorization GuildID string `url:"guild_id,omitempty"` Permissions BitFlag `url:"permissions,omitempty"` }
Redirect URL https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
type RefreshTokenExchange ¶
type RefreshTokenExchange struct { ClientID string `url:"client_id,omitempty"` ClientSecret string `url:"client_secret,omitempty"` GrantType string `url:"grant_type,omitempty"` RefreshToken string `url:"refresh_token,omitempty"` }
Refresh Token Exchange POST /oauth2/token https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-refresh-token-exchange-example
func (*RefreshTokenExchange) Send ¶
func (r *RefreshTokenExchange) Send(bot *Client) (*AccessTokenResponse, error)
Send sends a RefreshTokenExchange request to Discord and returns an AccessTokenResponse.
Uses the RefreshTokenExchange ClientID and ClientSecret.
type RemoveGuildBan ¶
Remove Guild Ban DELETE /guilds/{guild.id}/bans/{user.id} https://discord.com/developers/docs/resources/guild#remove-guild-ban
func (*RemoveGuildBan) Send ¶
func (r *RemoveGuildBan) Send(bot *Client) error
Send sends a RemoveGuildBan request to Discord and returns a error.
type RemoveGuildMember ¶
Remove Guild Member DELETE /guilds/{guild.id}/members/{user.id} https://discord.com/developers/docs/resources/guild#remove-guild-member
func (*RemoveGuildMember) Send ¶
func (r *RemoveGuildMember) Send(bot *Client) error
Send sends a RemoveGuildMember request to Discord and returns a error.
type RemoveGuildMemberRole ¶
Remove Guild Member Role DELETE /guilds/{guild.id}/members/{user.id}/roles/{role.id} https://discord.com/developers/docs/resources/guild#remove-guild-member-role
func (*RemoveGuildMemberRole) Send ¶
func (r *RemoveGuildMemberRole) Send(bot *Client) error
Send sends a RemoveGuildMemberRole request to Discord and returns a error.
type RemoveThreadMember ¶
Remove Thread Member DELETE /channels/{channel.id}/thread-members/{user.id} https://discord.com/developers/docs/resources/channel#remove-thread-member
func (*RemoveThreadMember) Send ¶
func (r *RemoveThreadMember) Send(bot *Client) error
Send sends a RemoveThreadMember request to Discord and returns a error.
type Request ¶
type Request struct { // RateLimiter represents an object that provides rate limit functionality. RateLimiter RateLimiter // Client is used to send requests. // // Use Client to set a custom User-Agent in the HTTP Request Header. // https://discord.com/developers/docs/reference#user-agent // // https://pkg.go.dev/github.com/valyala/fasthttp#Client Client *fasthttp.Client // Timeout represents the amount of time a request will wait for a response. Timeout time.Duration // Retries represents the number of times a request may be retried upon failure. // // A request is ONLY retried when a Bad Gateway or Rate Limit is encountered. Retries int // a (shared) per-resource rate limit is hit. // // set RetryShared to true (default) to retry a request (within the per-route rate limit) // until it's successful or until it experiences a non-shared 429 status code. RetryShared bool }
Request represents Discord Request parameters used to perform various actions by the client.
func DefaultRequest ¶
func DefaultRequest() Request
DefaultRequest returns a Default Request configuration.
type RequestGuildMembers ¶
type RequestGuildMembers struct { Query *string `json:"query,omitempty"` Limit *int `json:"limit,omitempty"` Presences *bool `json:"presences,omitempty"` Nonce *string `json:"nonce,omitempty"` GuildID string `json:"guild_id"` UserIDs []string `json:"user_ids,omitempty"` }
Request Guild Members Structure https://discord.com/developers/docs/topics/gateway-events#request-guild-members-guild-request-members-structure
func (*RequestGuildMembers) SendEvent ¶
func (c *RequestGuildMembers) SendEvent(bot *Client, session *Session) error
SendEvent sends an Opcode 8 RequestGuildMembers event to the Discord Gateway.
func (*RequestGuildMembers) SendEvents ¶ added in v1.10.1
func (c *RequestGuildMembers) SendEvents(bot *Client, sm ShardManager) error
SendEvents sends an Opcode 8 RequestGuildMembers event to the Discord Gateway.
type RequestSoundboardSounds ¶ added in v1.10.2
type RequestSoundboardSounds struct {
GuildIDs []string `json:"guild_ids"`
}
Request Soundboard Sounds Structure https://discord.com/developers/docs/events/gateway-events#request-soundboard-sounds-request-soundboard-sounds-structure
func (*RequestSoundboardSounds) SendEvent ¶ added in v1.10.2
func (c *RequestSoundboardSounds) SendEvent(bot *Client, session *Session) error
SendEvent sends an Opcode 31 RequestSoundboardSounds event to the Discord Gateway.
func (*RequestSoundboardSounds) SendEvents ¶ added in v1.10.2
func (c *RequestSoundboardSounds) SendEvents(bot *Client, sm ShardManager) error
SendEvents sends an Opcode 31 RequestSoundboardSounds event to the Discord Gateway.
type ResolvedData ¶
type ResolvedData struct { Users map[string]*User `json:"users,omitempty"` Members map[string]*GuildMember `json:"members,omitempty"` Roles map[string]*Role `json:"roles,omitempty"` Channels map[string]*Channel `json:"channels,omitempty"` Messages map[string]*Message `json:"messages,omitempty"` Attachments map[string]*Attachment `json:"attachments,omitempty"` }
Resolved Data Structure https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
type Resume ¶
type Resume struct { Token string `json:"token"` SessionID string `json:"session_id"` Seq int64 `json:"seq"` }
Resume Structure https://discord.com/developers/docs/topics/gateway-events#resume-resume-structure
func (*Resume) SendEvents ¶ added in v1.10.1
func (c *Resume) SendEvents(bot *Client, sm ShardManager) error
SendEvents sends an Opcode 6 Resume event to the Discord Gateway.
type Resumed ¶
type Resumed struct{}
Resumed https://discord.com/developers/docs/topics/gateway-events#resumed
type Role ¶
type Role struct { Icon **string `json:"icon,omitempty"` UnicodeEmoji **string `json:"unicode_emoji,omitempty"` Tags *RoleTags `json:"tags,omitempty"` ID string `json:"id"` Name string `json:"name"` Permissions string `json:"permissions"` Color int `json:"color"` Position int `json:"position"` Flags BitFlag `json:"flags"` Hoist bool `json:"hoist"` Managed bool `json:"managed"` Mentionable bool `json:"mentionable"` }
Role Object https://discord.com/developers/docs/topics/permissions#role-object
type RoleSubscriptionData ¶ added in v1.10.1
type RoleSubscriptionData struct { RoleSubscriptionListingID string `json:"role_subscription_listing_id"` TierName string `json:"tier_name"` TotalMonthsSubscribed int `json:"total_months_subscribed"` IsRenewal bool `json:"is_renewal"` }
Role Subscription Data Object Structure https://discord.com/developers/docs/resources/channel#role-subscription-data-object-role-subscription-data-object-structure
type RoleTags ¶
type RoleTags struct { BotID *string `json:"bot_id,omitempty"` IntegrationID *string `json:"integration_id,omitempty"` PremiumSubscriber *string `json:"premium_subscriber,omitempty"` SubscriptionListedID *string `json:"subscription_listing_id,omitempty"` AvailableForPurchase *string `json:"available_for_purchase,omitempty"` GuildConnections *string `json:"guild_connections,omitempty"` }
Role Tags Structure https://discord.com/developers/docs/topics/permissions#role-object-role-tags-structure
type SKU ¶ added in v1.10.2
type SKU struct { ID string `json:"id"` ApplicationID string `json:"application_id"` Name string `json:"name"` Slug string `json:"slug"` Flags BitFlag `json:"flags"` Type Flag `json:"type"` }
SKU Structure https://discord.com/developers/docs/resources/sku#sku-object-sku-structure
type SearchGuildMembers ¶
type SearchGuildMembers struct { Limit *int `url:"limit,omitempty"` GuildID string `url:"-"` Query string `url:"query"` }
Search Guild Members GET /guilds/{guild.id}/members/search https://discord.com/developers/docs/resources/guild#search-guild-members
func (*SearchGuildMembers) Send ¶
func (r *SearchGuildMembers) Send(bot *Client) ([]*GuildMember, error)
Send sends a SearchGuildMembers request to Discord and returns a []*GuildMember.
type SelectDefaultValue ¶ added in v1.10.2
Select Default Value Structure https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
type SelectMenu ¶
type SelectMenu struct { Placeholder *string `json:"placeholder,omitempty"` MinValues *Flag `json:"min_values,omitempty"` MaxValues *Flag `json:"max_values,omitempty"` Disabled *bool `json:"disabled,omitempty"` CustomID string `json:"custom_id"` Options []*SelectMenuOption `json:"options"` ChannelTypes Flags `json:"channel_types,omitempty"` DefaultValues []*SelectDefaultValue `json:"default_values,omitempty"` Type Flag `json:"type"` }
Select Menu Structure https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-menu-structure
func (SelectMenu) ComponentType ¶
func (c SelectMenu) ComponentType() Flag
func (SelectMenu) ComponentTypeChannelSelect ¶ added in v1.10.2
func (c SelectMenu) ComponentTypeChannelSelect() Flag
func (SelectMenu) ComponentTypeMentionableSelect ¶ added in v1.10.2
func (c SelectMenu) ComponentTypeMentionableSelect() Flag
func (SelectMenu) ComponentTypeRoleSelect ¶ added in v1.10.2
func (c SelectMenu) ComponentTypeRoleSelect() Flag
func (SelectMenu) ComponentTypeUserSelect ¶ added in v1.10.2
func (c SelectMenu) ComponentTypeUserSelect() Flag
func (SelectMenu) FlagComponentTypeStringSelect ¶ added in v1.10.2
func (c SelectMenu) FlagComponentTypeStringSelect() Flag
type SelectMenuOption ¶
type SelectMenuOption struct { Description *string `json:"description,omitempty"` Emoji *Emoji `json:"emoji,omitempty"` Default *bool `json:"default,omitempty"` Label string `json:"label"` Value string `json:"value"` }
Select Menu Option Structure https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure
type SelectProtocol ¶ added in v1.10.2
type SelectProtocol struct { Protocol string `json:"protocol"` Data SelectProtocolData `json:"data"` }
Select Protocol Structure https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-udp-connection-example-select-protocol-payload
func (*SelectProtocol) SendEvent ¶ added in v1.10.2
func (c *SelectProtocol) SendEvent(session *VoiceSession) error
SendEvent sends an Opcode 1 SelectProtocol event to the Discord Voice Server.
type SelectProtocolData ¶ added in v1.10.2
type SelectProtocolData struct { Address string `json:"address"` Mode string `json:"mode"` Port int `json:"port"` }
Select Protocol Data Structure https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-udp-connection-example-select-protocol-payload
type SendSoundboardSound ¶ added in v1.10.2
type SendSoundboardSound struct { SourceGuildID *string `json:"source_guild_id,omitempty"` ChannelID string `json:"-"` SoundID string `json:"sound_id"` }
Send Soundboard Sound POST channels/{channel.id}/send-soundboard-sound https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound
func (*SendSoundboardSound) Send ¶ added in v1.10.2
func (r *SendSoundboardSound) Send(bot *Client) error
Send sends a SendSoundboardSound request to Discord and returns a error.
type Session ¶
type Session struct { Context context.Context RateLimiter RateLimiter Conn *websocket.Conn Shard *[2]int Endpoint string ID string Seq int64 sync.RWMutex // contains filtered or unexported fields }
Session represents a Discord Gateway WebSocket Session.
func (*Session) Disconnect ¶
Disconnect disconnects a session from the Discord Gateway.
func (*Session) Monitor ¶
Monitor returns the current amount of HeartbeatACKs for a Session's heartbeat.
func (*Session) Reconnect ¶
Reconnect reconnects an already connected session to the Discord Gateway by disconnecting the session, then connecting again.
func (*Session) State ¶ added in v1.10.21
State returns the state of the Session's connection to Discord.
func (*Session) Wait ¶
Wait blocks until the calling Session is inactive (due to a final disconnect), then returns the Session's state and the disconnection error (when it exists).
If Wait() is called on a Session that isn't connected, it will return immediately with code SessionStateNew.
A disconnected session is reset and placed into a memory pool, so do NOT modify a Session after it disconnects.
type SessionDescription ¶ added in v1.10.2
Session Description Structure https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-udp-connection-example-session-description-payload
type SessionManager ¶
type SessionManager struct { // Gateway represents a map of Discord Gateway Session IDs to Sessions. // // map[SessionID]Session (map[string]*Session) Gateway *sync.Map // Voice represents a map of Discord Gateway Session IDs // to a set (map) of Discord GuildIDs to Discord Voice Channel Connections. // // Use the SessionID Key `SessionManagerVoiceKeyUnknownSession` to find a Discord Voice Channel Connection // using a GuildID when the SessionID is unknown. // // map[SessionID]map[GuildID]*VoiceChannelConnection (map[string]map[string]*VoiceChannelConnection) Voice *sync.Map }
SessionManager manages sessions.
func NewSessionManager ¶
func NewSessionManager() *SessionManager
NewSessionManager creates a new SessionManager.
func (*SessionManager) GetVoiceChannelConnection ¶ added in v1.10.2
func (sm *SessionManager) GetVoiceChannelConnection(sessionid string, guildid string) *VoiceChannelConnection
GetVoiceChannelConnection gets a Voice Channel Connection using a given Guild ID.
func (*SessionManager) RemoveGatewaySession ¶ added in v1.10.2
func (sm *SessionManager) RemoveGatewaySession(id string)
RemoveGatewaySession removes a Gateway Session and its Voice Channel Connections from the Session Manager.
func (*SessionManager) StoreVoiceChannelConnection ¶ added in v1.10.2
func (sm *SessionManager) StoreVoiceChannelConnection(sessionid string, guildid string, vc *VoiceChannelConnection)
StoreVoiceChannelConnection stores a Voice Channel Connection.
type SessionStartLimit ¶
type SessionStartLimit struct { Total int `json:"total"` Remaining int `json:"remaining"` ResetAfter int `json:"reset_after"` MaxConcurrency int `json:"max_concurrency"` }
Session Start Limit Structure https://discord.com/developers/docs/topics/gateway#session-start-limit-object-session-start-limit-structure
type ShardLimit ¶
type ShardLimit struct { // Reset represents the time at which the Session Start Rate Limit resets (daily). // // Discord represents this value from the "reset_after" field of the SessionStartLimit object. // https://discord.com/developers/docs/topics/gateway#session-start-limit-object Reset time.Time // MaxStarts represents the maximum amount of WebSocket Sessions a bot can start per day. // // This is equivalent to the maximum amount of Shards a bot can create per day. // // Discord represents this value from the "total" field of the SessionStartLimit object. // https://discord.com/developers/docs/topics/gateway#session-start-limit-object MaxStarts int // RemainingStarts represents the remaining number of "starts" that the bot is allowed // until the reset time. // // This is equivalent to the remaining number of Shards that the bot can create // for the rest of the day. // // Discord represents this value from the "remaining" field of the SessionStartLimit object. // https://discord.com/developers/docs/topics/gateway#session-start-limit-object RemainingStarts int // MaxConcurrency represents the number of Identify SendEvents the bot can send every 5 seconds. MaxConcurrency int // RecommendedShards represents the number of shards to use when connecting. // // https://discord.com/developers/docs/topics/gateway#get-gateway-bot RecommendedShards int }
ShardLimit contains information about sharding limits.
type ShardManager ¶
type ShardManager interface { // SetNumShards sets the number of shards the shard manager will use. // // When the Shards = 0, the automatic shard manager is used. SetNumShards(shards int) // SetLimit sets the ShardLimit of the ShardManager. // // This limit is determined using the GetGatewayBot request (which provides the Gateway Endpoint). // https://discord.com/developers/docs/topics/gateway#get-gateway-bot // // Called from the session.go connect() function (at L#118 in /wrapper/session.go). SetLimit(bot *Client) (response *GetGatewayBotResponse, err error) // GetSessions gets the connected sessions of the bot (in order of connection). GetSessions() []*Session // Ready is called when a Session receives a ready event. // // Called from the session.go initial() function (at L#304 in /wrapper/session.go). Ready(bot *Client, session *Session, event *Ready) // Connect connects to the Discord Gateway using the Shard Manager. Connect(bot *Client) error // Disconnect disconnects from the Discord Gateway using the Shard Manager. Disconnect() error // Reconnect reconnects to the Discord Gateway using the Shard Manager. Reconnect() error }
ShardManager represents an interface for Shard Management.
ShardManager is an interface which allows developers to use multi-application architectures, which run multiple applications on separate processes or servers.
type SoundboardSound ¶ added in v1.10.2
type SoundboardSound struct { EmojiID *string `json:"emoji_id"` EmojiName *string `json:"emoji_name"` GuildID *string `json:"guild_id,omitempty"` User *User `json:"user,omitempty"` Name string `json:"name"` SoundID string `json:"sound_id"` Volume float64 `json:"volume"` Available bool `json:"available"` }
Soundboard Sound Structure https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object-soundboard-sound-structure
type SoundboardSounds ¶ added in v1.10.2
type SoundboardSounds struct { GuildID string `json:"guild_id"` SoundboardSounds []*SoundboardSound `json:"soundboard_sounds"` }
Soundboard Sounds https://discord.com/developers/docs/events/gateway-events#soundboard-sounds
type Speaking ¶ added in v1.10.2
type Speaking struct { Speaking BitFlag `json:"speaking"` Delay int `json:"delay"` SSRC int `json:"ssrc"` }
Speaking Structure https://discord.com/developers/docs/topics/voice-connections#speaking-example-speaking-payload
func (*Speaking) SendEvent ¶ added in v1.10.2
func (c *Speaking) SendEvent(session *VoiceSession) error
SendEvent sends an Opcode 5 Speaking event to the Discord Voice Server.
type StageInstance ¶
type StageInstance struct { GuildScheduledEventID *string `json:"guild_scheduled_event_id"` ID string `json:"id"` GuildID string `json:"guild_id"` ChannelID string `json:"channel_id"` Topic string `json:"topic"` PrivacyLevel Flag `json:"privacy_level"` DiscoverableDisabled bool `json:"discoverable_disabled"` }
Stage Instance Object https://discord.com/developers/docs/resources/stage-instance#stage-instance-object
type StageInstanceCreate ¶
type StageInstanceCreate struct {
*StageInstance
}
Stage Instance Create https://discord.com/developers/docs/topics/gateway-events#stage-instance-create
type StageInstanceDelete ¶
type StageInstanceDelete struct {
*StageInstance
}
Stage Instance Delete https://discord.com/developers/docs/topics/gateway-events#stage-instance-delete
type StageInstanceUpdate ¶
type StageInstanceUpdate struct {
*StageInstance
}
Stage Instance Update https://discord.com/developers/docs/topics/gateway-events#stage-instance-update
type StartThreadfromMessage ¶
type StartThreadfromMessage struct { AutoArchiveDuration *int `json:"auto_archive_duration,omitempty"` RateLimitPerUser **int `json:"rate_limit_per_user,omitempty"` ChannelID string `json:"-"` MessageID string `json:"-"` Name string `json:"name"` }
Start Thread from Message POST /channels/{channel.id}/messages/{message.id}/threads https://discord.com/developers/docs/resources/channel#start-thread-from-message
type StartThreadinForumChannel ¶
type StartThreadinForumChannel struct { ChannelID string `json:"-"` Name string `json:"name"` AutoArchiveDuration *int `json:"auto_archive_duration,omitempty"` RateLimitPerUser **int `json:"rate_limit_per_user,omitempty"` Message *ForumAndMediaThreadMessageParams `json:"message"` AppliedTags []string `json:"applied_tags,omitempty"` Files []*File `json:"-" url:"-" dasgo:"files"` }
Start Thread in Forum Channel POST /channels/{channel.id}/threads https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
type StartThreadwithoutMessage ¶
type StartThreadwithoutMessage struct { AutoArchiveDuration *int `json:"auto_archive_duration,omitempty"` Type *Flag `json:"type,omitempty"` Invitable *bool `json:"invitable,omitempty"` RateLimitPerUser **int `json:"rate_limit_per_user,omitempty"` ChannelID string `json:"-"` Name string `json:"name"` }
Start Thread without Message POST /channels/{channel.id}/threads https://discord.com/developers/docs/resources/channel#start-thread-without-message
type Sticker ¶
type Sticker struct { PackID *string `json:"pack_id,omitempty"` Description *string `json:"description"` Available *bool `json:"available,omitempty"` GuildID *string `json:"guild_id,omitempty"` User *User `json:"user,omitempty"` SortValue *int `json:"sort_value,omitempty"` ID string `json:"id"` Name string `json:"name"` Tags string `json:"tags"` Type Flag `json:"type"` FormatType Flag `json:"format_type"` }
Sticker Structure https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-structure
type StickerItem ¶
type StickerItem struct { ID string `json:"id"` Name string `json:"name"` FormatType Flag `json:"format_type"` }
Sticker Item Object https://discord.com/developers/docs/resources/sticker#sticker-item-object
type StickerPack ¶
type StickerPack struct { CoverStickerID *string `json:"cover_sticker_id,omitempty"` BannerAssetID *string `json:"banner_asset_id,omitempty"` ID string `json:"id"` Name string `json:"name"` SKU_ID string `json:"sku_id"` Description string `json:"description"` Stickers []*Sticker `json:"stickers"` }
Sticker Pack Object https://discord.com/developers/docs/resources/sticker#sticker-pack-object-sticker-pack-structure
type Subscription ¶ added in v1.10.2
type Subscription struct { CurrentPeriodStart time.Time `json:"current_period_start"` CurrentPeriodEnd time.Time `json:"current_period_end"` CanceledAt *time.Time `json:"canceled_at"` Country *string `json:"country,omitempty"` 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"` Status Flag `json:"status"` }
Subscription Object https://discord.com/developers/docs/resources/subscription#subscription-object
type SubscriptionCreate ¶ added in v1.10.2
type SubscriptionCreate struct {
*Subscription
}
Subscription Create https://discord.com/developers/docs/events/gateway-events#subscription-create
type SubscriptionDelete ¶ added in v1.10.2
type SubscriptionDelete struct {
*Subscription
}
Subscription Delete https://discord.com/developers/docs/events/gateway-events#subscription-delete
type SubscriptionUpdate ¶ added in v1.10.2
type SubscriptionUpdate struct {
*Subscription
}
Subscription Update https://discord.com/developers/docs/events/gateway-events#subscription-update
type SyncGuildTemplate ¶
Sync Guild Template PUT /guilds/{guild.id}/templates/{template.code} https://discord.com/developers/docs/resources/guild-template#sync-guild-template
func (*SyncGuildTemplate) Send ¶
func (r *SyncGuildTemplate) Send(bot *Client) (*GuildTemplate, error)
Send sends a SyncGuildTemplate request to Discord and returns a GuildTemplate.
type Team ¶
type Team struct { Icon *string `json:"icon"` Description *string `json:"description"` ID string `json:"id"` Name string `json:"name"` OwnerUserID string `json:"owner_user_id"` Members []*TeamMember `json:"members"` }
Team Object https://discord.com/developers/docs/topics/teams#data-models-team-object
type TeamMember ¶
type TeamMember struct { User *User `json:"user"` TeamID string `json:"team_id"` Role string `json:"role"` MembershipState Flag `json:"membership_state"` }
Team Member Object https://discord.com/developers/docs/topics/teams#data-models-team-member-object
type TextInput ¶
type TextInput struct { Label *string `json:"label"` MinLength *int `json:"min_length,omitempty"` MaxLength *int `json:"max_length,omitempty"` Required *bool `json:"required,omitempty"` Value *string `json:"value,omitempty"` Placeholder *string `json:"placeholder,omitempty"` CustomID string `json:"custom_id"` Type Flag `json:"type"` Style Flag `json:"style"` }
Text Input Structure https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-structure
func (TextInput) ComponentType ¶
type ThreadCreate ¶
Thread Create https://discord.com/developers/docs/topics/gateway-events#thread-create
type ThreadDelete ¶
type ThreadDelete struct {
*Channel
}
Thread Delete https://discord.com/developers/docs/topics/gateway-events#thread-delete
type ThreadListSync ¶
type ThreadListSync struct { GuildID string `json:"guild_id"` ChannelIDs []string `json:"channel_ids,omitempty"` Threads []*Channel `json:"threads"` Members []*ThreadMember `json:"members"` }
Thread List Sync Event Fields https://discord.com/developers/docs/topics/gateway-events#thread-list-sync
type ThreadMember ¶
type ThreadMember struct { JoinTimestamp time.Time `json:"join_timestamp"` ID *string `json:"id,omitempty"` UserID *string `json:"user_id,omitempty"` Member *GuildMember `json:"member,omitempty"` Flags Flag `json:"flags"` }
Thread Member Object https://discord.com/developers/docs/resources/channel#thread-member-object
type ThreadMemberUpdate ¶
type ThreadMemberUpdate struct { *ThreadMember GuildID string `json:"guild_id"` }
Thread Member Update https://discord.com/developers/docs/topics/gateway-events#thread-member-update
type ThreadMembersUpdate ¶
type ThreadMembersUpdate struct { ID string `json:"id"` GuildID string `json:"guild_id"` AddedMembers []*ThreadMember `json:"added_members,omitempty"` RemovedMembers []string `json:"removed_member_ids,omitempty"` MemberCount int `json:"member_count"` }
Thread Members Update https://discord.com/developers/docs/topics/gateway-events#thread-members-update
type ThreadMetadata ¶
type ThreadMetadata struct { ArchiveTimestamp time.Time `json:"archive_timestamp"` Invitable *bool `json:"invitable,omitempty"` CreateTimestamp **time.Time `json:"create_timestamp"` AutoArchiveDuration int `json:"auto_archive_duration"` Archived bool `json:"archived"` Locked bool `json:"locked"` }
Thread Metadata Object https://discord.com/developers/docs/resources/channel#thread-metadata-object
type ThreadUpdate ¶
type ThreadUpdate struct {
*Channel
}
Thread Update https://discord.com/developers/docs/topics/gateway-events#thread-update
type TriggerMetadata ¶
type TriggerMetadata struct { // https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies KeywordFilter []string `json:"keyword_filter"` RegexPatterns []string `json:"regex_patterns"` Presets Flags `json:"presets"` AllowList []string `json:"allow_list"` MentionTotalLimit int `json:"mention_total_limit"` MentionRaidProtectionEnabled bool `json:"mention_raid_protection_enabled"` }
Trigger Metadata https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-metadata
type TriggerTypingIndicator ¶
type TriggerTypingIndicator struct {
ChannelID string
}
Trigger Typing Indicator POST /channels/{channel.id}/typing https://discord.com/developers/docs/resources/channel#trigger-typing-indicator
func (*TriggerTypingIndicator) Send ¶
func (r *TriggerTypingIndicator) Send(bot *Client) error
Send sends a TriggerTypingIndicator request to Discord and returns a error.
type TypingStart ¶
type TypingStart struct { Timestamp time.Time `json:"timestamp"` GuildID *string `json:"guild_id,omitempty"` Member *GuildMember `json:"member,omitempty"` ChannelID string `json:"channel_id"` UserID string `json:"user_id"` }
Typing Start https://discord.com/developers/docs/topics/gateway-events#typing-start
type UnpinMessage ¶
Unpin Message DELETE /channels/{channel.id}/pins/{message.id} https://discord.com/developers/docs/resources/channel#unpin-message
func (*UnpinMessage) Send ¶
func (r *UnpinMessage) Send(bot *Client) error
Send sends a UnpinMessage request to Discord and returns a error.
type UpdateApplicationRoleConnectionMetadataRecords ¶ added in v1.10.1
type UpdateApplicationRoleConnectionMetadataRecords struct { }
Update Application Role Connection Metadata Records PUT /applications/{application.id}/role-connections/metadata https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
func (*UpdateApplicationRoleConnectionMetadataRecords) Send ¶ added in v1.10.1
func (r *UpdateApplicationRoleConnectionMetadataRecords) Send(bot *Client) ([]*ApplicationRoleConnectionMetadata, error)
Send sends a UpdateApplicationRoleConnectionMetadataRecords request to Discord and returns a []*ApplicationRoleConnectionMetadata.
type UpdateCurrentUserApplicationRoleConnection ¶ added in v1.10.2
type UpdateCurrentUserApplicationRoleConnection struct { PlatformName *string `json:"platform_name,omitempty"` PlatformUsername *string `json:"platform_user,omitempty"` Metadata map[string]string `json:"metadata,omitempty"` }
Update User Application Role Connection PUT /users/@me/applications/{application.id}/role-connection https://discord.com/developers/docs/resources/user#update-user-application-role-connection
func (*UpdateCurrentUserApplicationRoleConnection) Send ¶ added in v1.10.2
func (r *UpdateCurrentUserApplicationRoleConnection) Send(bot *Client) (*ApplicationRoleConnection, error)
Send sends a UpdateCurrentUserApplicationRoleConnection request to Discord and returns a ApplicationRoleConnection.
type User ¶
type User struct { Banner **string `json:"banner,omitempty"` Avatar *string `json:"avatar"` AvatarDecoration **AvatarDecorationData `json:"avatar_decoration,omitempty"` GlobalName *string `json:"global_name"` AccentColor **int `json:"accent_color,omitempty"` Bot *bool `json:"bot,omitempty"` System *bool `json:"system,omitempty"` Locale *string `json:"locale,omitempty"` PublicFlags *BitFlag `json:"public_flag,omitempty"` PremiumType *Flag `json:"premium_type,omitempty"` MFAEnabled *bool `json:"mfa_enabled,omitempty"` Verified *bool `json:"verified,omitempty"` Email **string `json:"email,omitempty"` Flags *BitFlag `json:"flag,omitempty"` Username string `json:"username"` Discriminator string `json:"discriminator"` ID string `json:"id"` }
User Object https://discord.com/developers/docs/resources/user#user-object
type UserUpdate ¶
type UserUpdate struct {
*User
}
User Update https://discord.com/developers/docs/topics/gateway-events#user-update
type Value ¶
type Value string
Value represents a value (string, integer, double, or bool).
func (*Value) UnmarshalJSON ¶
type VoiceChannelConnection ¶ added in v1.10.2
type VoiceChannelConnection struct { GatewaySession *Session VoiceSession *VoiceSession Connection *net.UDPConn State GatewayVoiceStateUpdate }
VoiceChannelConnection represents a Discord Voice Channel Connection.
A Discord Voice Channel Connection is composed of three connections:
Gateway WebSocket Session (TCP): Used to connect to the Voice Websocket Session and receive information about who is in the voice channel.
Voice WebSocket Session (TCP): Used to connect to the Voice UDP Connection and receive information about who is speaking in the voice channel.
Voice Connection (UDP): Used to send and receive audio from Discord.
func (*VoiceChannelConnection) Connect ¶ added in v1.10.2
func (vc *VoiceChannelConnection) Connect(bot *Client) error
VoiceConnection connects the bot to a Discord Voice Channel using the Discord Gateway.
type VoiceChannelEffectSend ¶ added in v1.10.2
type VoiceChannelEffectSend struct { Emoji **Emoji `json:"emoji,omitempty"` AnimationType **Flag `json:"animation_type,omitempty"` AnimationID *string `json:"animation_id,omitempty"` SoundID *string `json:"sound_id,omitempty"` SoundVolume *float64 `json:"sound_volume,omitempty"` ChannelID string `json:"channel_id"` GuildID string `json:"guild_id"` UserID string `json:"user_id"` }
Voice Channel Effect Send https://discord.com/developers/docs/events/gateway-events#voice-channel-effect-send-voice-channel-effect-send-event-fields
type VoiceCloseEventCode ¶
Voice Close Event Codes https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes
type VoiceHandlers ¶ added in v1.10.2
type VoiceHandlers struct { VoiceReady []func(*VoiceReady) SessionDescription []func(*SessionDescription) Speaking []func(*Speaking) VoiceHello []func(*VoiceHello) VoiceResumed []func(*VoiceResumed) ClientDisconnect []func(*ClientDisconnect) // contains filtered or unexported fields }
VoiceHandlers represents a voice channel connection's event handlers.
type VoiceHeartbeat ¶ added in v1.10.2
type VoiceHeartbeat struct {
Data int64 `json:"d"`
}
Voice Heartbeat Structure https://discord.com/developers/docs/topics/voice-connections#heartbeating-example-heartbeat-payload
func (*VoiceHeartbeat) SendEvent ¶ added in v1.10.2
func (c *VoiceHeartbeat) SendEvent(session *VoiceSession) error
SendEvent sends an Opcode 3 Heartbeat event to the Discord Voice Server.
type VoiceHeartbeatACK ¶ added in v1.10.2
type VoiceHeartbeatACK struct {
Data int64 `json:"d"`
}
Voice HeartbeatACK Structure https://discord.com/developers/docs/topics/voice-connections#heartbeating-example-heartbeat-ack-payload
type VoiceHello ¶ added in v1.10.2
type VoiceHello struct {
HeartbeatInterval int64 `json:"heartbeat_interval"`
}
Voice Hello Structure https://discord.com/developers/docs/topics/voice-connections#heartbeating-example-hello-payload-since-v3
type VoiceIdentify ¶ added in v1.10.2
type VoiceIdentify struct { ServerID string `json:"server_id"` UserID string `json:"user_id"` SessionID string `json:"session_id"` Token string `json:"token"` }
Voice Identify Structure https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-websocket-connection-example-voice-identify-payload
func (*VoiceIdentify) SendEvent ¶ added in v1.10.2
func (c *VoiceIdentify) SendEvent(session *VoiceSession) error
SendEvent sends an Opcode 0 Identify event to the Discord Voice Server.
type VoicePacket ¶ added in v1.10.2
type VoicePacket struct { Timestamp time.Time VersionFlags []byte PayloadType []byte EncryptedAudio []byte SSRC uint32 Sequence uint16 }
Voice Packet Structure https://discord.com/developers/docs/topics/voice-connections#transport-encryption-modes-voice-packet-structure
type VoicePayload ¶ added in v1.10.2
type VoicePayload struct { Data json.RawMessage `json:"d"` Op int `json:"op"` }
Voice Payload Structure https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-websocket-connection
type VoiceReady ¶ added in v1.10.2
type VoiceReady struct { IP string `json:"ip"` Modes []string `json:"modes"` SSRC int `json:"ssrc"` Port int `json:"port"` }
Voice Ready Structure https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-websocket-connection-example-voice-ready-payload
type VoiceRegion ¶
type VoiceRegion struct { ID string `json:"id"` Name string `json:"name"` Optimal bool `json:"optimal"` Deprecated bool `json:"deprecated"` Custom bool `json:"custom"` }
Voice Region Object https://discord.com/developers/docs/resources/voice#voice-region-object-voice-region-structure
type VoiceResume ¶ added in v1.10.2
type VoiceResume struct { ServerID string `json:"server_id"` SessionID string `json:"session_id"` Token string `json:"token"` }
Voice Resume Structure https://discord.com/developers/docs/topics/voice-connections#resuming-voice-connection-example-resume-connection-payload
func (*VoiceResume) SendEvent ¶ added in v1.10.2
func (c *VoiceResume) SendEvent(session *VoiceSession) error
SendEvent sends an Opcode 7 Resume event to the Discord Voice Server.
type VoiceResumed ¶ added in v1.10.2
type VoiceResumed struct{}
Voice Resumed Structure https://discord.com/developers/docs/topics/voice-connections#resuming-voice-connection-example-resumed-payload
type VoiceServerUpdate ¶
type VoiceServerUpdate struct { Endpoint *string `json:"endpoint"` Token string `json:"token"` GuildID string `json:"guild_id"` }
Voice Server Update https://discord.com/developers/docs/topics/gateway-events#voice-server-update
type VoiceSession ¶ added in v1.10.2
type VoiceSession struct { Context context.Context VoiceServerInfo *VoiceServerUpdate Conn *websocket.Conn ID string Nonce int64 sync.RWMutex // contains filtered or unexported fields }
VoiceSession represents a Discord Voice WebSocket Session.
func (*VoiceSession) Monitor ¶ added in v1.10.2
func (s *VoiceSession) Monitor() uint32
Monitor returns the current amount of HeartbeatACKs for a Voice Session's heartbeat.
type VoiceState ¶
type VoiceState struct { SelfStream *bool `json:"self_stream,omitempty"` ChannelID *string `json:"channel_id"` Member *GuildMember `json:"member,omitempty"` GuildID *string `json:"guild_id,omitempty"` RequestToSpeakTimestamp *time.Time `json:"request_to_speak_timestamp"` UserID string `json:"user_id"` SessionID string `json:"session_id"` Deaf bool `json:"deaf"` Mute bool `json:"mute"` SelfDeaf bool `json:"self_deaf"` SelfMute bool `json:"self_mute"` SelfVideo bool `json:"self_video"` Suppress bool `json:"suppress"` }
Voice State Object https://discord.com/developers/docs/resources/voice#voice-state-object-voice-state-structure
type VoiceStateUpdate ¶
type VoiceStateUpdate struct {
*VoiceState
}
Voice State Update https://discord.com/developers/docs/topics/gateway-events#voice-state-update
type Webhook ¶
type Webhook struct { GuildID **string `json:"guild_id,omitempty"` ChannelID *string `json:"channel_id"` User *User `json:"user,omitempty"` Name *string `json:"name"` Avatar *string `json:"avatar"` Token *string `json:"token,omitempty"` ApplicationID *string `json:"application_id"` SourceGuild *Guild `json:"source_guild,omitempty"` SourceChannel *Channel `json:"source_channel,omitempty"` URL *string `json:"url,omitempty"` ID string `json:"id"` Type Flag `json:"type"` }
Webhook Object https://discord.com/developers/docs/resources/webhook#webhook-object
type WebhookTokenResponse ¶
type WebhookTokenResponse struct { Webhook *Webhook `json:"webhook,omitempty"` TokenType string `json:"token_type,omitempty"` AccessToken string `json:"access_token,omitempty"` Scope string `json:"scope,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` ExpiresIn time.Duration `json:"expires_in,omitempty"` }
Webhook Token Response https://discord.com/developers/docs/topics/oauth2#webhooks-webhook-token-response-example
type WebhooksUpdate ¶
type WebhooksUpdate struct { GuildID string `json:"guild_id"` ChannelID string `json:"channel_id"` }
Webhooks Update https://discord.com/developers/docs/topics/gateway-events#webhooks-update
type WelcomeScreen ¶
type WelcomeScreen struct { Description *string `json:"description"` WelcomeScreenChannels []*WelcomeScreenChannel `json:"welcome_channels"` }
Welcome Screen Object https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-structure
type WelcomeScreenChannel ¶
type WelcomeScreenChannel struct { Description *string `json:"description"` EmojiID *string `json:"emoji_id"` EmojiName *string `json:"emoji_name"` ChannelID string `json:"channel_id"` }
Welcome Screen Channel Structure https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-channel-structure