disgo

package module
v1.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2023 License: Apache-2.0 Imports: 25 Imported by: 7

README

Create a Discord Bot in Go

Go Doc License

Disgo is a Discord API Wrapper designed to be flexible, performant, secure, and thread-safe. Disgo aims to provide every feature in the Discord API along with optional rate limiting, structured logging, shard management, and caching. Use the only Go module to provide a 100% one-to-one implementation of the Discord API.

This repository is STABLE. For more information, read the roadmap.

A Next Generation Discord API Wrapper

High-quality code merits easy development.

Disgo uses developer operations to stay up-to-date with the ever-changing Discord API.

  • Code generation provides a clean implementation for every request and event.
  • Data race detection is run on an integration test that covers the entire Discord API to ensure that Disgo is safe for concurrent usage.

In addition, Disgo provides the following exclusive features.

Disgo uses NO reflection or type assertion.

Table of Contents

Topic Categories
Using the API Breakdown, Logging, Sharding, Caching
Examples Import, Configuration, Create a Command, Handle an Event, Output, Summary
Features Why Go?, Comparison, Contributing
Ecosystem License, Libraries, Credits

Using the API

This breakdown provides you with a full understanding on how to use the API.

Abstraction Usecase Example
Resource A Discord API Resource. Guild Object.
User Object.
Event A Discord API Event. A message is created.
A user joins a channel.
Client The Discord Bot Application that you develop.

Bot = Client = Application.
Configure the bot settings.

Set the token.
Request Uses the Discord HTTP REST API to make one-time requests for information. Create an application command.
Request guild information.
Session Uses a Discord WebSocket Connection (Gateway) to receive events that contain information. Send a message when an application command is used or a user joins a voice channel.

You create a Client that calls for Resources using Requests and handles Events from Sessions using event handlers.

For more information, please read What is a Request? and What is an Event?.

Flags

A flag is a flag, type, key, level or any other option that Discord provides. All flags are denoted by disgo.Flag (e.g., disgo.FlagUserSTAFF, disgo.FlagVerificationLevelHIGH, disgo.FlagPremiumTierNONE).

Logging

Disgo provides structured, leveled logging of the API Wrapper via the disgo.Logger global variable (disabled by default). Enable the logger using zerolog.SetGlobalLevel(zerolog.LEVEL).

Read What is a Log for a simple yet full understanding of logging.

Sharding

Using the automatic Shard Manager is optional and customizable.

Read What is a Discord Shard for a simple yet full understanding of sharding on Discord.

Caching

The Disgo Cache is optional and customizable.

The cache interface allows you to replace the built-in cache with another store (such as Redis or Memcached) or provide your own caching implementation.

Read What is a Cache for a simple yet full understanding of the Disgo Cache.

Examples

Example Description
main Learn how to use disgo.
command Create an application command and respond to interactions.
message Send a message with text, emojis, files, and components.
image Set the bot's avatar using an image.

Check out the examples directory for more examples.

Import

Get a specific version of disgo by specifying a tag or branch.

go get github.com/switchupcb/disgo@v1.10.1

Disgo branches are referenced by API version (i.e v10).

Configuration

You must create a Discord Application in the Discord Developer Portal to receive your Bot Token.

Use the client to configure the bot's settings.

bot := &disgo.Client{
    ApplicationID:  "APPID", // optional
    Authentication: disgo.BotToken("TOKEN"), // or BearerToken("TOKEN")
    Authorization:  &disgo.Authorization{ ... },
    Config:         disgo.DefaultConfig(),
    Handlers:       new(disgo.Handlers),
    Sessions:       disgo.NewSessionManager()
}

Need more information about configuration? Check out the bot example.

Create a Command

Create an application command request to add an application command.

// Create a Create Global Application Command request.
request := disgo.CreateGlobalApplicationCommand{
    Name:        "main",
    Description: disgo.Pointer("A basic command."),
}

// Register the new command by sending the request to Discord using the bot.
//
// returns a disgo.ApplicationCommand
newCommand, err := request.Send(bot)
if err != nil {
    log.Printf("failure sending command to Discord: %v", err)

    return
}
Handle an Event

Create an event handler and add it to the bot.

// Add an event handler to the bot.
bot.Handle(disgo.FlagGatewayEventNameInteractionCreate, func(i *disgo.InteractionCreate) {
	log.Printf("main called by %s", i.User.Username)
})

Disgo provides automatic Gateway Intent calculation.

Output

Open a WebSocket Session to receive and send events.

// Connect a new session to the Discord Gateway (WebSocket Connection).
s := disgo.NewSession()
if err := s.Connect(bot); err != nil {
    log.Printf("can't open websocket session to Discord Gateway: %v", err)

	return
}

The following message will be logged when a user creates an InteractionCreate event by using /main in a Direct Message with the Bot on Discord.

main called by switchupcb.
Summary
// Use flags to specify options from Discord.
disgo.Flag<Option><Name>

// Use resources to represent Discord objects in your application.
disgo.<API Resources>

// Use events to represent Discord events in your application.
disgo.<API Events>

// Use requests to exchange data with Discord's REST API.
disgo.<Endpoint>.Send()

// Use sessions to connect to the Discord Gateway.
disgo.Session.Connect()
disgo.Session.Disconnect()

// Use send events to send data to Discord's Gateway.
disgo.<Event>.SendEvent()

// Use event handlers to handle events from Discord's Gateway.
disgo.Client.Handle(<event>, <handler>)
disgo.Client.Remove(<event>, <index>)
disgo.Client.Handlers.<Handler>

// Use the client to manage the bot's settings.
disgo.Client.ApplicationID
disgo.Client.Authentication.<Settings>
disgo.Client.Authorization.<Settings>
disgo.Client.Config.Request.<Settings>
disgo.Client.Config.Gateway.<Settings>

Features

Why Go?

Go is a statically typed, compiled programming language (with a garbage collector). So it performs computationally better compared to most languages that provide Discord API Wrappers.

Go maintains superior asynchronous handling due to the use of Goroutines and Channels: This is helpful since a Discord Bot is server-side software.

Comparison

Disgo supports every feature in the Discord API and is the most customizable Discord API Wrapper due to its optional caching, shard management, rate limiting, and logging.

  • DiscordGo is not feature-complete.
  • Disgord is limiting.

Look no further than the name. The word disgo contains 5 letters — while the others have 7+ — saving you precious keyboard strokes.

Most important is Disgo's performance, which saves you money by reducing server costs.

Don't believe me? Check this out!

CPU

Disgo places a priority on performance. For more information, view library decisions.

Memory

Every struct uses fieldalignment to reduce the memory footprint of your application.

Storage

Disgo adds 5 MB to a compiled binary.

Contributing

Disgo is the easiest Discord Go API for developers to use and contribute to: You can contribute to this repository by viewing the Project Structure, Code Specifications, and Roadmap.

Ecosystem

License

The Apache License 2.0 is permissive for commercial use. For more information, read Apache Licensing FAQ.

Libraries
Library Description
Copygen Generate custom type-based code.
Dasgo Go Type Definitions for the Discord API.
Ecosystem View projects that use Disgo.
Credits
Name Contributions
SwitchUpCB Project Architecture, Generators, Dasgo, Requests, Events, Shard Manager
Thomas Rogers Dasgo
Josh Dawe Dasgo

Earn a credit! Contribute Now.

Documentation

Overview

Code generated by github.com/switchupcb/disgo/_gen/tools/bundle. DO NOT EDIT.

Index

Constants

View Source
const (
	FlagGatewayOpcodeDispatch            = 0
	FlagGatewayOpcodeHeartbeat           = 1
	FlagGatewayOpcodeIdentify            = 2
	FlagGatewayOpcodePresenceUpdate      = 3
	FlagGatewayOpcodeVoiceStateUpdate    = 4
	FlagGatewayOpcodeResume              = 6
	FlagGatewayOpcodeReconnect           = 7
	FlagGatewayOpcodeRequestGuildMembers = 8
	FlagGatewayOpcodeInvalidSession      = 9
	FlagGatewayOpcodeHello               = 10
	FlagGatewayOpcodeHeartbeatACK        = 11
)

Gateway Opcodes https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes

View Source
const (
	FlagVoiceOpcodeIdentify           = 0
	FlagVoiceOpcodeSelectProtocol     = 1
	FlagVoiceOpcodeReadyServer        = 2
	FlagVoiceOpcodeHeartbeat          = 3
	FlagVoiceOpcodeSessionDescription = 4
	FlagVoiceOpcodeSpeaking           = 5
	FlagVoiceOpcodeHeartbeatACK       = 6
	FlagVoiceOpcodeResume             = 7
	FlagVoiceOpcodeHello              = 8
	FlagVoiceOpcodeResumed            = 9
	FlagVoiceOpcodeClientDisconnect   = 13
)

Voice Opcodes https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes

View Source
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

View Source
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

View Source
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

View Source
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"
	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"
	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"
	FlagGatewayEventNameTypingStart                         = "TYPING_START"
	FlagGatewayEventNameUserUpdate                          = "USER_UPDATE"
	FlagGatewayEventNameVoiceStateUpdate                    = "VOICE_STATE_UPDATE"
	FlagGatewayEventNameVoiceServerUpdate                   = "VOICE_SERVER_UPDATE"
	FlagGatewayEventNameWebhooksUpdate                      = "WEBHOOKS_UPDATE"
)

Gateway Event Names https://discord.com/developers/docs/topics/gateway-events

View Source
const (
	FlagGatewaySendEventNameHeartbeat           = "Heartbeat"
	FlagGatewaySendEventNameIdentify            = "Identify"
	FlagGatewaySendEventNameUpdatePresence      = "UpdatePresence"
	FlagGatewaySendEventNameUpdateVoiceState    = "UpdateVoiceState "
	FlagGatewaySendEventNameResume              = "Resume"
	FlagGatewaySendEventNameRequestGuildMembers = "RequestGuildMembers"
)

Gateway SendEvent Names https://discord.com/developers/docs/topics/gateway-events#send-events

View Source
const (
	FlagStatusTypeOnline       = "online"
	FlagStatusTypeDoNotDisturb = "dnd"
	FlagStatusTypeAFK          = "idle"
	FlagStatusTypeInvisible    = "invisible"
	FlagStatusTypeOffline      = "offline"
)

Status Types https://discord.com/developers/docs/topics/gateway#update-presence-status-types

View Source
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

View Source
const (
	RateLimitScopeValueUser   = "user"
	RateLimitScopeValueGlobal = "global"
	RateLimitScopeValueShared = "shared"
)

Rate Limit Scope Values https://discord.com/developers/docs/topics/rate-limits#header-format-rate-limit-header-examples

View Source
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

View Source
const (
	VersionDiscordAPI          = "10"
	VersionDiscordVoiceGateway = "?v=4"
)

Version https://discord.com/developers/docs/reference#api-versioning

View Source
const (
	ImageFormatJPEG   = "JPEG"
	ImageFormatPNG    = "PNG"
	ImageFormatWebP   = "WebP"
	ImageFormatGIF    = "GIF"
	ImageFormatLottie = "Lottie"
)

Image Formats https://discord.com/developers/docs/reference#image-formatting-image-formats

View Source
const (
	CDNEndpointAnimatedHashPrefix       = "a_"
	CDNEndpointUserDiscriminatorDivisor = 5
)

CDN Endpoint Exceptions https://discord.com/developers/docs/reference#image-formatting-cdn-endpoints

View Source
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

View Source
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

View Source
const (
	FlagEmbedLimitTitle       = 256
	FlagEmbedLimitDescription = 4096
	FlagEmbedLimitFields      = 25
	FlagEmbedLimitFieldName   = 256
	FlagEmbedLimitFieldValue  = 1024
	FlagEmbedLimitFooterText  = 2048
	FlagEmbedLimitAuthorName  = 256
)

Embed Limits https://discord.com/developers/docs/resources/channel#embed-object-embed-limits

View Source
const (
	FlagAllowedMentionTypeRoles    = "roles"
	FlagAllowedMentionTypeUsers    = "users"
	FlagAllowedMentionTypeEveryone = "everyone"
)

Allowed Mention Types https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mentions-structure

View Source
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

View Source
const (
	FlagPromptTypeMULTIPLE_CHOICE = 0
	FlagPromptTypeDROPDOWN        = 1
)

Prompt Types https://discord.com/developers/docs/resources/guild#guild-onboarding-object-prompt-types

View Source
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

View Source
const (
	EndpointBaseURL    = "https://discord.com/api/v" + VersionDiscordAPI + "/"
	CDNEndpointBaseURL = "https://cdn.discordapp.com/"
)

Discord API Endpoints

View Source
const (
	ErrorEventActionUnmarshal = "unmarshalling"
	ErrorEventActionMarshal   = "marshalling"
	ErrorEventActionRead      = "reading"
	ErrorEventActionWrite     = "writing"
)
View Source
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

View Source
const (
	// SignalNone indicates that Wait() was called on an already disconnected session.
	SignalNone = 0

	// SignalDisconnect indicates that a disconnection was called purposefully.
	SignalDisconnect = signalDisconnect

	// SignalReconnect indicates that a disconnection was called purposefully in order to reconnect.
	SignalReconnect = signalReconnect

	// SignalError indicates that a disconnection occurred as an error.
	SignalError = 3

	// SignalDisconnectError indicates that a disconnection was called purposefully (for any reason),
	// but the Session experienced an error while disconnecting.
	SignalDisconnectError = 4

	// SignalUndefined indicates that a disconnection occurred in an undefined manner.
	//
	// This signal should NEVER be returned: If it is, report it.
	SignalUndefined = 5
)
View Source
const (
	ErrConnectionSession = "Discord Gateway"
)
View Source
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

View Source
const (
	GlobalRateLimitRouteID = "0"
)
View Source
const (
	TimestampFormatISO8601 = time.RFC3339
)

time.Time Format https://discord.com/developers/docs/reference#iso8601-datetime

Variables

View Source
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,
	}
)
View Source
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

View Source
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.",
	}

	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.",
	}

	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,
	}
)
View Source
var (
	EndpointModifyChannelGroupDM = EndpointModifyChannel
	EndpointModifyChannelGuild   = EndpointModifyChannel
	EndpointModifyChannelThread  = EndpointModifyChannel
)
View Source
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

View Source
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).",
	}
)
View Source
var (
	// HashPerRoute hashes a request that uses a per-route rate limit algorithm.
	HashPerRoute = Hash(0)
)
View Source
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,
	}
)
View Source
var (
	JSONErrorCodes = map[int]string{}/* 196 elements not displayed */

)

JSON Error Codes https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes

View Source
var (
	// Logger represents the Disgo Logger used to log information.
	Logger = zerolog.New(os.Stdout)
)

Mutable Guild Features https://discord.com/developers/docs/resources/guild#guild-object-mutable-guild-features

Privileged Intents https://discord.com/developers/docs/topics/gateway#privileged-intents

View Source
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{}/* 180 elements not displayed */

)
View Source
var (
	// RouteIDs represents a map of Routes to Route IDs (map[string]uint8).
	RouteIDs = map[string]uint8{}/* 182 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

func CDNEndpointAchievementIcon(applicationid, achievementid, iconhash string) string

CDNEndpointAchievementIcon builds a query for an HTTP request.

func CDNEndpointApplicationAsset

func CDNEndpointApplicationAsset(applicationid, assetid string) string

CDNEndpointApplicationAsset builds a query for an HTTP request.

func CDNEndpointApplicationCover

func CDNEndpointApplicationCover(applicationid, coverimage string) string

CDNEndpointApplicationCover builds a query for an HTTP request.

func CDNEndpointApplicationIcon

func CDNEndpointApplicationIcon(applicationid, icon string) string

CDNEndpointApplicationIcon builds a query for an HTTP request.

func CDNEndpointCustomEmoji

func CDNEndpointCustomEmoji(emojiid string) string

CDNEndpointCustomEmoji builds a query for an HTTP request.

func CDNEndpointDefaultUserAvatar

func CDNEndpointDefaultUserAvatar(index string) string

CDNEndpointDefaultUserAvatar builds a query for an HTTP request.

func CDNEndpointGuildBanner

func CDNEndpointGuildBanner(guildid, guildbanner string) string

CDNEndpointGuildBanner builds a query for an HTTP request.

func CDNEndpointGuildDiscoverySplash

func CDNEndpointGuildDiscoverySplash(guildid, guilddiscoverysplash string) string

CDNEndpointGuildDiscoverySplash builds a query for an HTTP request.

func CDNEndpointGuildIcon

func CDNEndpointGuildIcon(guildid, guildicon string) string

CDNEndpointGuildIcon builds a query for an HTTP request.

func CDNEndpointGuildMemberAvatar

func CDNEndpointGuildMemberAvatar(guildid, userid, memberavatar string) string

CDNEndpointGuildMemberAvatar builds a query for an HTTP request.

func CDNEndpointGuildMemberBanner

func CDNEndpointGuildMemberBanner(guildid, userid, memberbanner string) string

CDNEndpointGuildMemberBanner builds a query for an HTTP request.

func CDNEndpointGuildScheduledEventCover

func CDNEndpointGuildScheduledEventCover(scheduledeventid, scheduledeventcoverimage string) string

CDNEndpointGuildScheduledEventCover builds a query for an HTTP request.

func CDNEndpointGuildSplash

func CDNEndpointGuildSplash(guildid, guildsplash string) string

CDNEndpointGuildSplash builds a query for an HTTP request.

func CDNEndpointRoleIcon

func CDNEndpointRoleIcon(roleid, roleicon string) string

CDNEndpointRoleIcon builds a query for an HTTP request.

func CDNEndpointSticker

func CDNEndpointSticker(stickerid string) string

CDNEndpointSticker builds a query for an HTTP request.

func CDNEndpointStickerPackBanner

func CDNEndpointStickerPackBanner(stickerpackbannerassetid string) string

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

func CDNEndpointTeamIcon(teamid, teamicon string) string

CDNEndpointTeamIcon builds a query for an HTTP request.

func CDNEndpointUserAvatar

func CDNEndpointUserAvatar(userid, useravatar string) string

CDNEndpointUserAvatar builds a query for an HTTP request.

func CDNEndpointUserBanner

func CDNEndpointUserBanner(userid, userbanner string) string

CDNEndpointUserBanner builds a query for an HTTP request.

func EndpointAddGuildMember

func EndpointAddGuildMember(guildid, userid string) string

EndpointAddGuildMember builds a query for an HTTP request.

func EndpointAddGuildMemberRole

func EndpointAddGuildMemberRole(guildid, userid, roleid string) string

EndpointAddGuildMemberRole builds a query for an HTTP request.

func EndpointAddThreadMember

func EndpointAddThreadMember(channelid, userid string) string

EndpointAddThreadMember builds a query for an HTTP request.

func EndpointAuthorizationURL

func EndpointAuthorizationURL() string

EndpointAuthorizationURL builds a query for an HTTP request.

func EndpointBatchEditApplicationCommandPermissions

func EndpointBatchEditApplicationCommandPermissions(applicationid, guildid string) string

EndpointBatchEditApplicationCommandPermissions builds a query for an HTTP request.

func EndpointBeginGuildPrune

func EndpointBeginGuildPrune(guildid string) string

EndpointBeginGuildPrune builds a query for an HTTP request.

func EndpointBulkDeleteMessages

func EndpointBulkDeleteMessages(channelid string) string

EndpointBulkDeleteMessages builds a query for an HTTP request.

func EndpointBulkOverwriteGlobalApplicationCommands

func EndpointBulkOverwriteGlobalApplicationCommands(applicationid string) string

EndpointBulkOverwriteGlobalApplicationCommands builds a query for an HTTP request.

func EndpointBulkOverwriteGuildApplicationCommands

func EndpointBulkOverwriteGuildApplicationCommands(applicationid, guildid string) string

EndpointBulkOverwriteGuildApplicationCommands builds a query for an HTTP request.

func EndpointCreateAutoModerationRule

func EndpointCreateAutoModerationRule(guildid string) string

EndpointCreateAutoModerationRule builds a query for an HTTP request.

func EndpointCreateChannelInvite

func EndpointCreateChannelInvite(channelid string) string

EndpointCreateChannelInvite builds a query for an HTTP request.

func EndpointCreateDM

func EndpointCreateDM() string

EndpointCreateDM builds a query for an HTTP request.

func EndpointCreateFollowupMessage

func EndpointCreateFollowupMessage(applicationid, interactiontoken string) string

EndpointCreateFollowupMessage builds a query for an HTTP request.

func EndpointCreateGlobalApplicationCommand

func EndpointCreateGlobalApplicationCommand(applicationid string) string

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

func EndpointCreateGuildApplicationCommand(applicationid, guildid string) string

EndpointCreateGuildApplicationCommand builds a query for an HTTP request.

func EndpointCreateGuildBan

func EndpointCreateGuildBan(guildid, userid string) string

EndpointCreateGuildBan builds a query for an HTTP request.

func EndpointCreateGuildChannel

func EndpointCreateGuildChannel(guildid string) string

EndpointCreateGuildChannel builds a query for an HTTP request.

func EndpointCreateGuildEmoji

func EndpointCreateGuildEmoji(guildid string) string

EndpointCreateGuildEmoji builds a query for an HTTP request.

func EndpointCreateGuildRole

func EndpointCreateGuildRole(guildid string) string

EndpointCreateGuildRole builds a query for an HTTP request.

func EndpointCreateGuildScheduledEvent

func EndpointCreateGuildScheduledEvent(guildid string) string

EndpointCreateGuildScheduledEvent builds a query for an HTTP request.

func EndpointCreateGuildSticker

func EndpointCreateGuildSticker(guildid string) string

EndpointCreateGuildSticker builds a query for an HTTP request.

func EndpointCreateGuildTemplate

func EndpointCreateGuildTemplate(guildid string) string

EndpointCreateGuildTemplate builds a query for an HTTP request.

func EndpointCreateGuildfromGuildTemplate

func EndpointCreateGuildfromGuildTemplate(templatecode string) string

EndpointCreateGuildfromGuildTemplate builds a query for an HTTP request.

func EndpointCreateInteractionResponse

func EndpointCreateInteractionResponse(interactionid, interactiontoken string) string

EndpointCreateInteractionResponse builds a query for an HTTP request.

func EndpointCreateMessage

func EndpointCreateMessage(channelid string) string

EndpointCreateMessage builds a query for an HTTP request.

func EndpointCreateReaction

func EndpointCreateReaction(channelid, messageid, emoji string) string

EndpointCreateReaction builds a query for an HTTP request.

func EndpointCreateStageInstance

func EndpointCreateStageInstance() string

EndpointCreateStageInstance builds a query for an HTTP request.

func EndpointCreateWebhook

func EndpointCreateWebhook(channelid string) string

EndpointCreateWebhook builds a query for an HTTP request.

func EndpointCrosspostMessage

func EndpointCrosspostMessage(channelid, messageid string) string

EndpointCrosspostMessage builds a query for an HTTP request.

func EndpointDeleteAllReactions

func EndpointDeleteAllReactions(channelid, messageid string) string

EndpointDeleteAllReactions builds a query for an HTTP request.

func EndpointDeleteAllReactionsforEmoji

func EndpointDeleteAllReactionsforEmoji(channelid, messageid, emoji string) string

EndpointDeleteAllReactionsforEmoji builds a query for an HTTP request.

func EndpointDeleteAutoModerationRule

func EndpointDeleteAutoModerationRule(guildid, automoderationruleid string) string

EndpointDeleteAutoModerationRule builds a query for an HTTP request.

func EndpointDeleteChannelPermission

func EndpointDeleteChannelPermission(channelid, overwriteid string) string

EndpointDeleteChannelPermission builds a query for an HTTP request.

func EndpointDeleteCloseChannel

func EndpointDeleteCloseChannel(channelid string) string

EndpointDeleteCloseChannel builds a query for an HTTP request.

func EndpointDeleteFollowupMessage

func EndpointDeleteFollowupMessage(applicationid, interactiontoken, messageid string) string

EndpointDeleteFollowupMessage builds a query for an HTTP request.

func EndpointDeleteGlobalApplicationCommand

func EndpointDeleteGlobalApplicationCommand(applicationid, commandid string) string

EndpointDeleteGlobalApplicationCommand builds a query for an HTTP request.

func EndpointDeleteGuild

func EndpointDeleteGuild(guildid string) string

EndpointDeleteGuild builds a query for an HTTP request.

func EndpointDeleteGuildApplicationCommand

func EndpointDeleteGuildApplicationCommand(applicationid, guildid, commandid string) string

EndpointDeleteGuildApplicationCommand builds a query for an HTTP request.

func EndpointDeleteGuildEmoji

func EndpointDeleteGuildEmoji(guildid, emojiid string) string

EndpointDeleteGuildEmoji builds a query for an HTTP request.

func EndpointDeleteGuildIntegration

func EndpointDeleteGuildIntegration(guildid, integrationid string) string

EndpointDeleteGuildIntegration builds a query for an HTTP request.

func EndpointDeleteGuildRole

func EndpointDeleteGuildRole(guildid, roleid string) string

EndpointDeleteGuildRole builds a query for an HTTP request.

func EndpointDeleteGuildScheduledEvent

func EndpointDeleteGuildScheduledEvent(guildid, guildscheduledeventid string) string

EndpointDeleteGuildScheduledEvent builds a query for an HTTP request.

func EndpointDeleteGuildSticker

func EndpointDeleteGuildSticker(guildid, stickerid string) string

EndpointDeleteGuildSticker builds a query for an HTTP request.

func EndpointDeleteGuildTemplate

func EndpointDeleteGuildTemplate(guildid, templatecode string) string

EndpointDeleteGuildTemplate builds a query for an HTTP request.

func EndpointDeleteInvite

func EndpointDeleteInvite(invitecode string) string

EndpointDeleteInvite builds a query for an HTTP request.

func EndpointDeleteMessage

func EndpointDeleteMessage(channelid, messageid string) string

EndpointDeleteMessage builds a query for an HTTP request.

func EndpointDeleteOriginalInteractionResponse

func EndpointDeleteOriginalInteractionResponse(applicationid, interactiontoken string) string

EndpointDeleteOriginalInteractionResponse builds a query for an HTTP request.

func EndpointDeleteOwnReaction

func EndpointDeleteOwnReaction(channelid, messageid, emoji string) string

EndpointDeleteOwnReaction builds a query for an HTTP request.

func EndpointDeleteStageInstance

func EndpointDeleteStageInstance(channelid string) string

EndpointDeleteStageInstance builds a query for an HTTP request.

func EndpointDeleteUserReaction

func EndpointDeleteUserReaction(channelid, messageid, emoji, userid string) string

EndpointDeleteUserReaction builds a query for an HTTP request.

func EndpointDeleteWebhook

func EndpointDeleteWebhook(webhookid string) string

EndpointDeleteWebhook builds a query for an HTTP request.

func EndpointDeleteWebhookMessage

func EndpointDeleteWebhookMessage(webhookid, webhooktoken, messageid string) string

EndpointDeleteWebhookMessage builds a query for an HTTP request.

func EndpointDeleteWebhookwithToken

func EndpointDeleteWebhookwithToken(webhookid, webhooktoken string) string

EndpointDeleteWebhookwithToken builds a query for an HTTP request.

func EndpointEditApplicationCommandPermissions

func EndpointEditApplicationCommandPermissions(applicationid, guildid, commandid string) string

EndpointEditApplicationCommandPermissions builds a query for an HTTP request.

func EndpointEditChannelPermissions

func EndpointEditChannelPermissions(channelid, overwriteid string) string

EndpointEditChannelPermissions builds a query for an HTTP request.

func EndpointEditFollowupMessage

func EndpointEditFollowupMessage(applicationid, interactiontoken, messageid string) string

EndpointEditFollowupMessage builds a query for an HTTP request.

func EndpointEditGlobalApplicationCommand

func EndpointEditGlobalApplicationCommand(applicationid, commandid string) string

EndpointEditGlobalApplicationCommand builds a query for an HTTP request.

func EndpointEditGuildApplicationCommand

func EndpointEditGuildApplicationCommand(applicationid, guildid, commandid string) string

EndpointEditGuildApplicationCommand builds a query for an HTTP request.

func EndpointEditMessage

func EndpointEditMessage(channelid, messageid string) string

EndpointEditMessage builds a query for an HTTP request.

func EndpointEditOriginalInteractionResponse

func EndpointEditOriginalInteractionResponse(applicationid, interactiontoken string) string

EndpointEditOriginalInteractionResponse builds a query for an HTTP request.

func EndpointEditWebhookMessage

func EndpointEditWebhookMessage(webhookid, webhooktoken, messageid string) string

EndpointEditWebhookMessage builds a query for an HTTP request.

func EndpointExecuteGitHubCompatibleWebhook

func EndpointExecuteGitHubCompatibleWebhook(webhookid, webhooktoken string) string

EndpointExecuteGitHubCompatibleWebhook builds a query for an HTTP request.

func EndpointExecuteSlackCompatibleWebhook

func EndpointExecuteSlackCompatibleWebhook(webhookid, webhooktoken string) string

EndpointExecuteSlackCompatibleWebhook builds a query for an HTTP request.

func EndpointExecuteWebhook

func EndpointExecuteWebhook(webhookid, webhooktoken string) string

EndpointExecuteWebhook builds a query for an HTTP request.

func EndpointFollowAnnouncementChannel

func EndpointFollowAnnouncementChannel(channelid string) string

EndpointFollowAnnouncementChannel builds a query for an HTTP request.

func EndpointGetApplicationCommandPermissions

func EndpointGetApplicationCommandPermissions(applicationid, guildid, commandid string) string

EndpointGetApplicationCommandPermissions builds a query for an HTTP request.

func EndpointGetApplicationRoleConnectionMetadataRecords added in v1.10.1

func EndpointGetApplicationRoleConnectionMetadataRecords(applicationid string) string

EndpointGetApplicationRoleConnectionMetadataRecords builds a query for an HTTP request.

func EndpointGetAutoModerationRule

func EndpointGetAutoModerationRule(guildid, automoderationruleid string) string

EndpointGetAutoModerationRule builds a query for an HTTP request.

func EndpointGetChannel

func EndpointGetChannel(channelid string) string

EndpointGetChannel builds a query for an HTTP request.

func EndpointGetChannelInvites

func EndpointGetChannelInvites(channelid string) string

EndpointGetChannelInvites builds a query for an HTTP request.

func EndpointGetChannelMessage

func EndpointGetChannelMessage(channelid, messageid string) string

EndpointGetChannelMessage builds a query for an HTTP request.

func EndpointGetChannelMessages

func EndpointGetChannelMessages(channelid string) string

EndpointGetChannelMessages builds a query for an HTTP request.

func EndpointGetChannelWebhooks

func EndpointGetChannelWebhooks(channelid string) string

EndpointGetChannelWebhooks 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 EndpointGetCurrentUserGuildMember

func EndpointGetCurrentUserGuildMember(guildid string) string

EndpointGetCurrentUserGuildMember builds a query for an HTTP request.

func EndpointGetCurrentUserGuilds

func EndpointGetCurrentUserGuilds() string

EndpointGetCurrentUserGuilds builds a query for an HTTP request.

func EndpointGetFollowupMessage

func EndpointGetFollowupMessage(applicationid, interactiontoken, messageid string) string

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

func EndpointGetGlobalApplicationCommand(applicationid, commandid string) string

EndpointGetGlobalApplicationCommand builds a query for an HTTP request.

func EndpointGetGlobalApplicationCommands

func EndpointGetGlobalApplicationCommands(applicationid string) string

EndpointGetGlobalApplicationCommands builds a query for an HTTP request.

func EndpointGetGuild

func EndpointGetGuild(guildid string) string

EndpointGetGuild builds a query for an HTTP request.

func EndpointGetGuildApplicationCommand

func EndpointGetGuildApplicationCommand(applicationid, guildid, commandid string) string

EndpointGetGuildApplicationCommand builds a query for an HTTP request.

func EndpointGetGuildApplicationCommandPermissions

func EndpointGetGuildApplicationCommandPermissions(applicationid, guildid string) string

EndpointGetGuildApplicationCommandPermissions builds a query for an HTTP request.

func EndpointGetGuildApplicationCommands

func EndpointGetGuildApplicationCommands(applicationid, guildid string) string

EndpointGetGuildApplicationCommands builds a query for an HTTP request.

func EndpointGetGuildAuditLog

func EndpointGetGuildAuditLog(guildid string) string

EndpointGetGuildAuditLog builds a query for an HTTP request.

func EndpointGetGuildBan

func EndpointGetGuildBan(guildid, userid string) string

EndpointGetGuildBan builds a query for an HTTP request.

func EndpointGetGuildBans

func EndpointGetGuildBans(guildid string) string

EndpointGetGuildBans builds a query for an HTTP request.

func EndpointGetGuildChannels

func EndpointGetGuildChannels(guildid string) string

EndpointGetGuildChannels builds a query for an HTTP request.

func EndpointGetGuildEmoji

func EndpointGetGuildEmoji(guildid, emojiid string) string

EndpointGetGuildEmoji builds a query for an HTTP request.

func EndpointGetGuildIntegrations

func EndpointGetGuildIntegrations(guildid string) string

EndpointGetGuildIntegrations builds a query for an HTTP request.

func EndpointGetGuildInvites

func EndpointGetGuildInvites(guildid string) string

EndpointGetGuildInvites builds a query for an HTTP request.

func EndpointGetGuildMember

func EndpointGetGuildMember(guildid, userid string) string

EndpointGetGuildMember builds a query for an HTTP request.

func EndpointGetGuildOnboarding added in v1.10.1

func EndpointGetGuildOnboarding(guildid string) string

EndpointGetGuildOnboarding builds a query for an HTTP request.

func EndpointGetGuildPreview

func EndpointGetGuildPreview(guildid string) string

EndpointGetGuildPreview builds a query for an HTTP request.

func EndpointGetGuildPruneCount

func EndpointGetGuildPruneCount(guildid string) string

EndpointGetGuildPruneCount builds a query for an HTTP request.

func EndpointGetGuildRoles

func EndpointGetGuildRoles(guildid string) string

EndpointGetGuildRoles builds a query for an HTTP request.

func EndpointGetGuildScheduledEvent

func EndpointGetGuildScheduledEvent(guildid, guildscheduledeventid string) string

EndpointGetGuildScheduledEvent builds a query for an HTTP request.

func EndpointGetGuildScheduledEventUsers

func EndpointGetGuildScheduledEventUsers(guildid, guildscheduledeventid string) string

EndpointGetGuildScheduledEventUsers builds a query for an HTTP request.

func EndpointGetGuildSticker

func EndpointGetGuildSticker(guildid, stickerid string) string

EndpointGetGuildSticker builds a query for an HTTP request.

func EndpointGetGuildTemplate

func EndpointGetGuildTemplate(templatecode string) string

EndpointGetGuildTemplate builds a query for an HTTP request.

func EndpointGetGuildTemplates

func EndpointGetGuildTemplates(guildid string) string

EndpointGetGuildTemplates builds a query for an HTTP request.

func EndpointGetGuildVanityURL

func EndpointGetGuildVanityURL(guildid string) string

EndpointGetGuildVanityURL builds a query for an HTTP request.

func EndpointGetGuildVoiceRegions

func EndpointGetGuildVoiceRegions(guildid string) string

EndpointGetGuildVoiceRegions builds a query for an HTTP request.

func EndpointGetGuildWebhooks

func EndpointGetGuildWebhooks(guildid string) string

EndpointGetGuildWebhooks builds a query for an HTTP request.

func EndpointGetGuildWelcomeScreen

func EndpointGetGuildWelcomeScreen(guildid string) string

EndpointGetGuildWelcomeScreen builds a query for an HTTP request.

func EndpointGetGuildWidget

func EndpointGetGuildWidget(guildid string) string

EndpointGetGuildWidget builds a query for an HTTP request.

func EndpointGetGuildWidgetImage

func EndpointGetGuildWidgetImage(guildid string) string

EndpointGetGuildWidgetImage builds a query for an HTTP request.

func EndpointGetGuildWidgetSettings

func EndpointGetGuildWidgetSettings(guildid string) string

EndpointGetGuildWidgetSettings builds a query for an HTTP request.

func EndpointGetInvite

func EndpointGetInvite(invitecode string) string

EndpointGetInvite builds a query for an HTTP request.

func EndpointGetOriginalInteractionResponse

func EndpointGetOriginalInteractionResponse(applicationid, interactiontoken string) string

EndpointGetOriginalInteractionResponse builds a query for an HTTP request.

func EndpointGetPinnedMessages

func EndpointGetPinnedMessages(channelid string) string

EndpointGetPinnedMessages builds a query for an HTTP request.

func EndpointGetReactions

func EndpointGetReactions(channelid, messageid, emoji string) string

EndpointGetReactions builds a query for an HTTP request.

func EndpointGetStageInstance

func EndpointGetStageInstance(channelid string) string

EndpointGetStageInstance builds a query for an HTTP request.

func EndpointGetSticker

func EndpointGetSticker(stickerid string) string

EndpointGetSticker builds a query for an HTTP request.

func EndpointGetThreadMember

func EndpointGetThreadMember(channelid, userid string) string

EndpointGetThreadMember builds a query for an HTTP request.

func EndpointGetUser

func EndpointGetUser(userid string) string

EndpointGetUser builds a query for an HTTP request.

func EndpointGetUserApplicationRoleConnection added in v1.10.1

func EndpointGetUserApplicationRoleConnection(applicationid string) string

EndpointGetUserApplicationRoleConnection builds a query for an HTTP request.

func EndpointGetUserConnections

func EndpointGetUserConnections() string

EndpointGetUserConnections builds a query for an HTTP request.

func EndpointGetWebhook

func EndpointGetWebhook(webhookid string) string

EndpointGetWebhook builds a query for an HTTP request.

func EndpointGetWebhookMessage

func EndpointGetWebhookMessage(webhookid, webhooktoken, messageid string) string

EndpointGetWebhookMessage builds a query for an HTTP request.

func EndpointGetWebhookwithToken

func EndpointGetWebhookwithToken(webhookid, webhooktoken string) string

EndpointGetWebhookwithToken builds a query for an HTTP request.

func EndpointGroupDMAddRecipient

func EndpointGroupDMAddRecipient(channelid, userid string) string

EndpointGroupDMAddRecipient builds a query for an HTTP request.

func EndpointGroupDMRemoveRecipient

func EndpointGroupDMRemoveRecipient(channelid, userid string) string

EndpointGroupDMRemoveRecipient builds a query for an HTTP request.

func EndpointJoinThread

func EndpointJoinThread(channelid string) string

EndpointJoinThread builds a query for an HTTP request.

func EndpointLeaveGuild

func EndpointLeaveGuild(guildid string) string

EndpointLeaveGuild builds a query for an HTTP request.

func EndpointLeaveThread

func EndpointLeaveThread(channelid string) string

EndpointLeaveThread builds a query for an HTTP request.

func EndpointListActiveGuildThreads

func EndpointListActiveGuildThreads(guildid string) string

EndpointListActiveGuildThreads builds a query for an HTTP request.

func EndpointListAutoModerationRulesForGuild

func EndpointListAutoModerationRulesForGuild(guildid string) string

EndpointListAutoModerationRulesForGuild builds a query for an HTTP request.

func EndpointListGuildEmojis

func EndpointListGuildEmojis(guildid string) string

EndpointListGuildEmojis builds a query for an HTTP request.

func EndpointListGuildMembers

func EndpointListGuildMembers(guildid string) string

EndpointListGuildMembers builds a query for an HTTP request.

func EndpointListGuildStickers

func EndpointListGuildStickers(guildid string) string

EndpointListGuildStickers builds a query for an HTTP request.

func EndpointListJoinedPrivateArchivedThreads

func EndpointListJoinedPrivateArchivedThreads(channelid string) string

EndpointListJoinedPrivateArchivedThreads builds a query for an HTTP request.

func EndpointListNitroStickerPacks

func EndpointListNitroStickerPacks() string

EndpointListNitroStickerPacks builds a query for an HTTP request.

func EndpointListPrivateArchivedThreads

func EndpointListPrivateArchivedThreads(channelid string) string

EndpointListPrivateArchivedThreads builds a query for an HTTP request.

func EndpointListPublicArchivedThreads

func EndpointListPublicArchivedThreads(channelid string) string

EndpointListPublicArchivedThreads builds a query for an HTTP request.

func EndpointListScheduledEventsforGuild

func EndpointListScheduledEventsforGuild(guildid string) string

EndpointListScheduledEventsforGuild builds a query for an HTTP request.

func EndpointListThreadMembers

func EndpointListThreadMembers(channelid string) string

EndpointListThreadMembers builds a query for an HTTP request.

func EndpointListVoiceRegions

func EndpointListVoiceRegions() string

EndpointListVoiceRegions builds a query for an HTTP request.

func EndpointModifyAutoModerationRule

func EndpointModifyAutoModerationRule(guildid, automoderationruleid string) string

EndpointModifyAutoModerationRule builds a query for an HTTP request.

func EndpointModifyChannel

func EndpointModifyChannel(channelid string) string

EndpointModifyChannel builds a query for an HTTP request.

func EndpointModifyCurrentMember

func EndpointModifyCurrentMember(guildid string) string

EndpointModifyCurrentMember builds a query for an HTTP request.

func EndpointModifyCurrentUser

func EndpointModifyCurrentUser() string

EndpointModifyCurrentUser builds a query for an HTTP request.

func EndpointModifyCurrentUserNick

func EndpointModifyCurrentUserNick(guildid string) string

EndpointModifyCurrentUserNick builds a query for an HTTP request.

func EndpointModifyCurrentUserVoiceState

func EndpointModifyCurrentUserVoiceState(guildid string) string

EndpointModifyCurrentUserVoiceState builds a query for an HTTP request.

func EndpointModifyGuild

func EndpointModifyGuild(guildid string) string

EndpointModifyGuild builds a query for an HTTP request.

func EndpointModifyGuildChannelPositions

func EndpointModifyGuildChannelPositions(guildid string) string

EndpointModifyGuildChannelPositions builds a query for an HTTP request.

func EndpointModifyGuildEmoji

func EndpointModifyGuildEmoji(guildid, emojiid string) string

EndpointModifyGuildEmoji builds a query for an HTTP request.

func EndpointModifyGuildMFALevel

func EndpointModifyGuildMFALevel(guildid string) string

EndpointModifyGuildMFALevel builds a query for an HTTP request.

func EndpointModifyGuildMember

func EndpointModifyGuildMember(guildid, userid string) string

EndpointModifyGuildMember builds a query for an HTTP request.

func EndpointModifyGuildRole

func EndpointModifyGuildRole(guildid, roleid string) string

EndpointModifyGuildRole builds a query for an HTTP request.

func EndpointModifyGuildRolePositions

func EndpointModifyGuildRolePositions(guildid string) string

EndpointModifyGuildRolePositions builds a query for an HTTP request.

func EndpointModifyGuildScheduledEvent

func EndpointModifyGuildScheduledEvent(guildid, guildscheduledeventid string) string

EndpointModifyGuildScheduledEvent builds a query for an HTTP request.

func EndpointModifyGuildSticker

func EndpointModifyGuildSticker(guildid, stickerid string) string

EndpointModifyGuildSticker builds a query for an HTTP request.

func EndpointModifyGuildTemplate

func EndpointModifyGuildTemplate(guildid, templatecode string) string

EndpointModifyGuildTemplate builds a query for an HTTP request.

func EndpointModifyGuildWelcomeScreen

func EndpointModifyGuildWelcomeScreen(guildid string) string

EndpointModifyGuildWelcomeScreen builds a query for an HTTP request.

func EndpointModifyGuildWidget

func EndpointModifyGuildWidget(guildid string) string

EndpointModifyGuildWidget builds a query for an HTTP request.

func EndpointModifyStageInstance

func EndpointModifyStageInstance(channelid string) string

EndpointModifyStageInstance builds a query for an HTTP request.

func EndpointModifyUserVoiceState

func EndpointModifyUserVoiceState(guildid, userid string) string

EndpointModifyUserVoiceState builds a query for an HTTP request.

func EndpointModifyWebhook

func EndpointModifyWebhook(webhookid string) string

EndpointModifyWebhook builds a query for an HTTP request.

func EndpointModifyWebhookwithToken

func EndpointModifyWebhookwithToken(webhookid, webhooktoken string) string

EndpointModifyWebhookwithToken builds a query for an HTTP request.

func EndpointPinMessage

func EndpointPinMessage(channelid, messageid string) string

EndpointPinMessage builds a query for an HTTP request.

func EndpointQueryString

func EndpointQueryString(dst any) (string, error)

EndpointQueryString returns a URL Query String from a given object.

func EndpointRemoveGuildBan

func EndpointRemoveGuildBan(guildid, userid string) string

EndpointRemoveGuildBan builds a query for an HTTP request.

func EndpointRemoveGuildMember

func EndpointRemoveGuildMember(guildid, userid string) string

EndpointRemoveGuildMember builds a query for an HTTP request.

func EndpointRemoveGuildMemberRole

func EndpointRemoveGuildMemberRole(guildid, userid, roleid string) string

EndpointRemoveGuildMemberRole builds a query for an HTTP request.

func EndpointRemoveThreadMember

func EndpointRemoveThreadMember(channelid, userid string) string

EndpointRemoveThreadMember builds a query for an HTTP request.

func EndpointSearchGuildMembers

func EndpointSearchGuildMembers(guildid string) string

EndpointSearchGuildMembers builds a query for an HTTP request.

func EndpointStartThreadfromMessage

func EndpointStartThreadfromMessage(channelid, messageid string) string

EndpointStartThreadfromMessage builds a query for an HTTP request.

func EndpointStartThreadinForumChannel

func EndpointStartThreadinForumChannel(channelid string) string

EndpointStartThreadinForumChannel builds a query for an HTTP request.

func EndpointStartThreadwithoutMessage

func EndpointStartThreadwithoutMessage(channelid string) string

EndpointStartThreadwithoutMessage builds a query for an HTTP request.

func EndpointSyncGuildTemplate

func EndpointSyncGuildTemplate(guildid, templatecode string) string

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

func EndpointTriggerTypingIndicator(channelid string) string

EndpointTriggerTypingIndicator builds a query for an HTTP request.

func EndpointUnpinMessage

func EndpointUnpinMessage(channelid, messageid string) string

EndpointUnpinMessage builds a query for an HTTP request.

func EndpointUpdateApplicationRoleConnectionMetadataRecords added in v1.10.1

func EndpointUpdateApplicationRoleConnectionMetadataRecords(applicationid string) string

EndpointUpdateApplicationRoleConnectionMetadataRecords builds a query for an HTTP request.

func EndpointUpdateUserApplicationRoleConnection added in v1.10.1

func EndpointUpdateUserApplicationRoleConnection(applicationid string) string

EndpointUpdateUserApplicationRoleConnection builds a query for an HTTP request.

func GenerateAuthorizationURL

func GenerateAuthorizationURL(bot *Client, response string) string

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 IsValue

func IsValue[T any](p *T) bool

IsValue returns whether the given pointer contains a value.

func IsValue2

func IsValue2[T any](dp **T) bool

IsValue2 returns whether the given double pointer contains a pointer.

func JSONCodeError

func JSONCodeError(status int) error

JSONCodeError handles a Discord API JSON Error Code and returns the relevant error message.

func LogCommand

func LogCommand(log *zerolog.Event, clientid string, op int, command string) *zerolog.Event

LogCommand logs a Gateway Command (typically using a LogSession).

func LogEventHandler

func LogEventHandler(log *zerolog.Event, clientid, event string) *zerolog.Event

LogEventHandler logs an event handler action.

func LogPayload

func LogPayload(log *zerolog.Event, op int, data json.RawMessage) *zerolog.Event

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

func LogResponse(log *zerolog.Event, header, body string) *zerolog.Event

LogResponse logs a response (typically using LogRequest).

func LogSession

func LogSession(log *zerolog.Event, sessionid string) *zerolog.Event

LogSession logs a session.

func Pointer

func Pointer[T any](v T) *T

Pointer returns a pointer to the given value.

func Pointer2

func Pointer2[T any](v T, null ...bool) **T

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

func StatusCodeError(status int) error

StatusCodeError handles a Discord API HTTP Status Code and returns the relevant error message.

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

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 ActionsRow

type ActionsRow struct {
	Components []Component `json:"components"`
}

https://discord.com/developers/docs/interactions/message-components#component-object

func (ActionsRow) ComponentType

func (c ActionsRow) ComponentType() Flag

func (*ActionsRow) UnmarshalJSON

func (r *ActionsRow) UnmarshalJSON(b []byte) error

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 ActivityParty

type ActivityParty struct {
	ID   *string `json:"id,omitempty"`
	Size *[2]int `json:"size,omitempty"`
}

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

type AddGuildMemberRole struct {
	GuildID string
	UserID  string
	RoleID  string
}

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

type AddThreadMember struct {
	ChannelID string
	UserID    string
}

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 {
	CoverImage                     *string        `json:"cover_image,omitempty"`
	RoleConnectionsVerificationURL *string        `json:"role_connections_verification_url,omitempty"`
	Icon                           *string        `json:"icon"`
	CustomInstallURL               *string        `json:"custom_install_url,omitempty"`
	InstallParams                  *InstallParams `json:"install_params,omitempty"`
	Flags                          *BitFlag       `json:"flags,omitempty"`
	PrimarySKUID                   *string        `json:"primary_sku_id,omitempty"`
	TermsOfServiceURL              *string        `json:"terms_of_service_url,omitempty"`
	PrivacyProxyURL                *string        `json:"privacy_policy_url,omitempty"`
	Owner                          *User          `json:"owner,omitempty"`
	Slug                           *string        `json:"slug,omitempty"`
	Team                           *Team          `json:"team"`
	GuildID                        *string        `json:"guild_id,omitempty"`
	VerifyKey                      string         `json:"verify_key"`
	ID                             string         `json:"id"`
	Description                    string         `json:"description"`
	Name                           string         `json:"name"`
	Tags                           []string       `json:"tags,omitempty"`
	RPCOrigins                     []string       `json:"rpc_origins,omitempty"`
	BotRequireCodeGrant            bool           `json:"bot_require_code_grant"`
	BotPublic                      bool           `json:"bot_public"`
}

Application Object https://discord.com/developers/docs/resources/application

type ApplicationCommand

type ApplicationCommand struct {
	DefaultMemberPermissions *string                     `json:"default_member_permissions"`
	Type                     *Flag                       `json:"type,omitempty"`
	GuildID                  *string                     `json:"guild_id,omitempty"`
	NameLocalizations        *map[string]string          `json:"name_localizations,omitempty"`
	DescriptionLocalizations *map[string]string          `json:"description_localizations,omitempty"`
	DMPermission             *bool                       `json:"dm_permission,omitempty"`
	NSFW                     *bool                       `json:"nsfw,omitempty"`
	ApplicationID            string                      `json:"application_id"`
	Name                     string                      `json:"name"`
	Description              string                      `json:"description"`
	ID                       string                      `json:"id"`
	Version                  string                      `json:"version,omitempty"`
	Options                  []*ApplicationCommandOption `json:"options,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 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 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 {
	Description     *string  `json:"description,omitempty"`
	ContentType     *string  `json:"content_type,omitempty"`
	Height          **int    `json:"height,omitempty"`
	Width           **int    `json:"width,omitempty"`
	Emphemeral      *bool    `json:"ephemeral,omitempty"`
	DurationSeconds *float64 `json:"duration_secs,omitempty"`
	Waveform        *string  `json:"waveform,omitempty"`
	ID              string   `json:"id"`
	Filename        string   `json:"filename"`
	URL             string   `json:"url"`
	ProxyURL        string   `json:"proxy_url"`
	Size            int      `json:"size"`
}

Message Attachment Object https://discord.com/developers/docs/resources/channel#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 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 Ban

type Ban struct {
	Reason *string `json:"reason"`
	User   *User   `json:"user"`
}

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

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
	FlagIntentGUILD_EMOJIS_AND_STICKERS 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_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
)

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 (
	FlagChannelPINNED      BitFlag = 1 << 1
	FlagChannelREQUIRE_TAG BitFlag = 1 << 4
)

Channel Flags https://discord.com/developers/docs/resources/channel#channel-object-channel-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
)

Message Flags https://discord.com/developers/docs/resources/channel#message-object-message-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
)

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
	FlagBitwisePermissionUSE_EXTERNAL_SOUNDS                 BitFlag = 1 << 45
	FlagBitwisePermissionSEND_VOICE_MESSAGES                 BitFlag = 1 << 46
)

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

func (BitFlag) String added in v1.10.1

func (b BitFlag) String() string

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

func (b *Bucket) ConfirmDate(amount int16, date time.Time)

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.

func (*Bucket) Reset

func (b *Bucket) Reset(expiry time.Time)

Reset resets a Discord API Rate Limit Bucket and sets its expiry.

func (*Bucket) Use

func (b *Bucket) Use(amount int16)

Use uses the given amount of tokens for a Discord API Rate Limit Bucket.

type BulkDeleteMessages

type BulkDeleteMessages struct {
	ChannelID string    `json:"-"`
	Messages  []*string `json:"messages"`
}

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

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

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"`
	URL      *string `json:"url,omitempty"`
	Disabled *bool   `json:"disabled,omitempty"`
	Style    Flag    `json:"style"`
}

Button Object https://discord.com/developers/docs/interactions/message-components#button-object

func (Button) ComponentType

func (c Button) ComponentType() Flag

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              **int                  `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 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 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

	// Sessions contains sessions a bot uses to interact with the Discord Gateway.
	Sessions *SessionManager

	ApplicationID string
}

Client represents a Discord Application.

func (*Client) Handle

func (bot *Client) Handle(eventname string, function interface{}) error

Handle adds an event handler for the given event to the bot.

func (*Client) Remove

func (bot *Client) Remove(eventname string, index int) error

Remove removes the event handler at the given index from the bot. This function does NOT remove intents automatically.

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

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 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

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

func (*CreateChannelInvite) Send

func (r *CreateChannelInvite) Send(bot *Client) (*Invite, error)

Send sends a CreateChannelInvite request to Discord and returns a 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

func (*CreateDM) Send

func (r *CreateDM) Send(bot *Client) (*Channel, error)

Send sends a CreateDM request to Discord and returns a Channel.

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"`
	DMPermission             **bool                      `json:"dm_permission,omitempty"`
	Type                     *Flag                       `json:"type,omitempty"`
	NSFW                     *bool                       `json:"nsfw,omitempty"`
	Name                     string                      `json:"name,omitempty"`
	Options                  []*ApplicationCommandOption `json:"options,omitempty"`
}

Create Global Application Command POST /applications/{application.id}/commands https://discord.com/developers/docs/interactions/application-commands#create-global-application-command

func (*CreateGlobalApplicationCommand) Send

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

func (*CreateGroupDM) Send

func (r *CreateGroupDM) Send(bot *Client) (*Channel, error)

Send sends a CreateGroupDM request to Discord and returns a Channel.

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

func (*CreateGuild) Send

func (r *CreateGuild) Send(bot *Client) (*Guild, error)

Send sends a CreateGuild request to Discord and returns a 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

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"`
	Bitrate                    **int                   `json:"bitrate,omitempty"`
	DefaultSortOrder           **int                   `json:"default_sort_order,omitempty"`
	Topic                      **string                `json:"topic,omitempty"`
	ParentID                   **string                `json:"parent_id,omitempty"`
	UserLimit                  **int                   `json:"user_limit,omitempty"`
	RateLimitPerUser           **int                   `json:"rate_limit_per_user,omitempty"`
	NSFW                       **bool                  `json:"nsfw,omitempty"`
	Type                       **Flag                  `json:"type,omitempty"`
	AvailableTags              *[]*ForumTag            `json:"available_tags,omitempty"`
	Position                   **int                   `json:"position,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"`
	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

func (*CreateGuildChannel) Send

func (r *CreateGuildChannel) Send(bot *Client) (*Channel, error)

Send sends a CreateGuildChannel request to Discord and returns a 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

func (*CreateGuildEmoji) Send

func (r *CreateGuildEmoji) Send(bot *Client) (*Emoji, error)

Send sends a CreateGuildEmoji request to Discord and returns a 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

func (*CreateGuildRole) Send

func (r *CreateGuildRole) Send(bot *Client) (*Role, error)

Send sends a CreateGuildRole request to Discord and returns a 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

Send sends a CreateGuildScheduledEvent request to Discord and returns a GuildScheduledEvent.

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

func (*CreateGuildSticker) Send

func (r *CreateGuildSticker) Send(bot *Client) (*Sticker, error)

Send sends a CreateGuildSticker request to Discord and returns a 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

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 {
	Content          *string           `json:"content,omitempty"`
	Nonce            *Nonce            `json:"nonce,omitempty"`
	TTS              *bool             `json:"tts,omitempty"`
	AllowedMentions  *AllowedMentions  `json:"allowed_mentions,omitempty"`
	MessageReference *MessageReference `json:"message_reference,omitempty"`
	Flags            *BitFlag          `json:"flags,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

func (*CreateMessage) Send

func (r *CreateMessage) Send(bot *Client) (*Message, error)

Send sends a CreateMessage request to Discord and returns a Message.

type CreateReaction

type CreateReaction struct {
	ChannelID string
	MessageID string
	Emoji     string
}

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"`
	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 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

func (*CreateWebhook) Send

func (r *CreateWebhook) Send(bot *Client) (*Webhook, error)

Send sends a CreateWebhook request to Discord and returns a Webhook.

type CrosspostMessage

type CrosspostMessage struct {
	ChannelID string
	MessageID string
}

Crosspost Message POST /channels/{channel.id}/messages/{message.id}/crosspost https://discord.com/developers/docs/resources/channel#crosspost-message

func (*CrosspostMessage) Send

func (r *CrosspostMessage) Send(bot *Client) (*Message, error)

Send sends a CrosspostMessage request to Discord and returns a 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

type DeleteAllReactions struct {
	ChannelID string
	MessageID string
}

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

type DeleteAllReactionsforEmoji struct {
	ChannelID string
	MessageID string
	Emoji     string
}

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 DeleteAutoModerationRule

type DeleteAutoModerationRule struct {
	GuildID              string
	AutoModerationRuleID string
}

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

type DeleteChannelPermission struct {
	ChannelID   string
	OverwriteID string
}

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

func (*DeleteCloseChannel) Send

func (r *DeleteCloseChannel) Send(bot *Client) (*Channel, error)

Send sends a DeleteCloseChannel request to Discord and returns a Channel.

type DeleteFollowupMessage

type DeleteFollowupMessage struct {
	InteractionToken string
	MessageID        string
}

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

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

type DeleteGuildApplicationCommand struct {
	GuildID   string
	CommandID string
}

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

Send sends a DeleteGuildApplicationCommand request to Discord and returns a error.

type DeleteGuildEmoji

type DeleteGuildEmoji struct {
	GuildID string
	EmojiID string
}

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

type DeleteGuildIntegration struct {
	GuildID       string
	IntegrationID string
}

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

type DeleteGuildRole struct {
	GuildID string
	RoleID  string
}

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

type DeleteGuildScheduledEvent struct {
	GuildID               string
	GuildScheduledEventID string
}

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 DeleteGuildSticker

type DeleteGuildSticker struct {
	GuildID   string
	StickerID string
}

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

type DeleteGuildTemplate struct {
	GuildID      string
	TemplateCode string
}

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

func (*DeleteInvite) Send

func (r *DeleteInvite) Send(bot *Client) (*Invite, error)

Send sends a DeleteInvite request to Discord and returns a Invite.

type DeleteMessage

type DeleteMessage struct {
	ChannelID string
	MessageID string
}

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

Send sends a DeleteOriginalInteractionResponse request to Discord and returns a error.

type DeleteOwnReaction

type DeleteOwnReaction struct {
	ChannelID string
	MessageID string
	Emoji     string
}

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 DeleteUserReaction

type DeleteUserReaction struct {
	ChannelID string
	MessageID string
	Emoji     string
	UserID    string
}

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

type DeleteWebhookwithToken struct {
	WebhookID    string
	WebhookToken string
}

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

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 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"`
	DMPermission             **bool                      `json:"dm_permission,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

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

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

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:"-"`
	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"`
	Footer      *EmbedFooter    `json:"footer,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 {
	IconURL      *string `json:"icon_url,omitempty"`
	ProxyIconURL *string `json:"proxy_icon_url,omitempty"`
	Text         string  `json:"text"`
}

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 ErrorDisconnect

type ErrorDisconnect struct {
	// Action represents the error that prompted the disconnection (if applicable).
	Action error

	// Err represents the error that occurred while disconnecting.
	Err error

	// Connection represents the name of the connection.
	Connection string
}

ErrorDisconnect represents a disconnection error that occurs when an attempt to gracefully disconnect from a connection fails.

func (ErrorDisconnect) Error

func (e ErrorDisconnect) Error() string

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
}

ErrorSession represents a WebSocket Session error that occurs during an active session.

func (ErrorSession) Error

func (e ErrorSession) Error() string

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

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

Send sends a ExecuteSlackCompatibleWebhook request to Discord and returns a error.

type ExecuteWebhook

type ExecuteWebhook struct {
	AvatarURL       *string          `json:"avatar_url,omitempty" url:"-"`
	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:"-"`
	TTS             *bool            `json:"tts,omitempty" url:"-"`
	AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty" 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"`
	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 File

type File struct {
	Name        string
	ContentType string
	Data        []byte
}

File represents a file attachment.

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
)

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 (
	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 (
	FlagComponentTypeActionRow         Flag = 1
	FlagComponentTypeButton            Flag = 2
	FlagComponentTypeSelectMenu        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
)

Button Styles https://discord.com/developers/docs/interactions/message-components#button-object-button-styles

const (
	FlagTextInputStyleShort     Flag = 1
	FlagTextInputStyleParagraph Flag = 2
)

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 (
	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
)

Interaction Callback Type https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type

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
)

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
)

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

const (
	FlagActionTypeBLOCK_MESSAGE      Flag = 1
	FlagActionTypeSEND_ALERT_MESSAGE Flag = 2
	FlagActionTypeTIMEOUT            Flag = 3
)

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
)

Channel Types https://discord.com/developers/docs/resources/channel#channel-object-channel-types

const (
	FlagVideoQualityModeAUTO Flag = 1
	FlagVideoQualityModeFULL Flag = 2
)

Video Quality Modes https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes

const (
	FlagSortOrderTypeLATEST_ACTIVITY Flag = 0
	FlagSortOrderTypeCREATION_DATE   Flag = 1
)

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
)

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

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 (
	FlagMFALevelNONE     Flag = 0
	FlagMFALevelELEVATED Flag = 1
)

MFA Level https://discord.com/developers/docs/resources/guild#guild-object-mfa-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

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 (
	FlagInviteTargetTypeSTREAM               Flag = 1
	FlagInviteTargetTypeEMBEDDED_APPLICATION Flag = 2
)

Invite Target Types https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types

const (
	FlagStickerTypeSTANDARD Flag = 1
	FlagStickerTypeGUILD    Flag = 2
)

Sticker Types https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-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 (
	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

const (
	FlagVisibilityTypeNONE     Flag = 0
	FlagVisibilityTypeEVERYONE Flag = 1
)

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

const (
	FlagPermissionOverwriteTypeRole   Flag = 0
	FlagPermissionOverwriteTypeMember Flag = 1
)

Permission Overwrite Types

const (
	FlagMembershipStateEnumINVITED  Flag = 1
	FlagMembershipStateEnumACCEPTED Flag = 2
)

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

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 (
	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

func (t Flags) MarshalJSON() ([]byte, error)

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

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 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 ForumThreadMessageParams

type ForumThreadMessageParams 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"`
	Files           []*File          `json:"-" dasgo:"files"`
}

Forum Thread Message Params Object https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel-forum-thread-message-params-object

func (*ForumThreadMessageParams) UnmarshalJSON

func (r *ForumThreadMessageParams) UnmarshalJSON(b []byte) error

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

func (g Gateway) DisableIntent(intent BitFlag)

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

func (g *Gateway) EnableIntent(intent BitFlag)

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.

func (*Gateway) EnableIntentPrivileged added in v1.10.1

func (g *Gateway) EnableIntentPrivileged(intent BitFlag)

EnableIntentPrivileged 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.

type GatewayCloseEventCode

type GatewayCloseEventCode struct {
	Description string
	Explanation string
	Code        int
	Reconnect   bool
}

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 GetApplicationCommandPermissions

type GetApplicationCommandPermissions struct {
	GuildID   string
	CommandID string
}

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

Send sends a GetApplicationCommandPermissions request to Discord and returns a GuildApplicationCommandPermissions.

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

Send sends a GetApplicationRoleConnectionMetadataRecords request to Discord and returns a []*ApplicationRoleConnectionMetadata.

type GetAutoModerationRule

type GetAutoModerationRule struct {
	GuildID              string
	AutoModerationRuleID string
}

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

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

func (*GetChannel) Send

func (r *GetChannel) Send(bot *Client) (*Channel, error)

Send sends a GetChannel request to Discord and returns a 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

func (*GetChannelInvites) Send

func (r *GetChannelInvites) Send(bot *Client) ([]*Invite, error)

Send sends a GetChannelInvites request to Discord and returns a []*Invite.

type GetChannelMessage

type GetChannelMessage struct {
	ChannelID string
	MessageID string
}

Get Channel Message GET /channels/{channel.id}/messages/{message.id} https://discord.com/developers/docs/resources/channel#get-channel-message

func (*GetChannelMessage) Send

func (r *GetChannelMessage) Send(bot *Client) (*Message, error)

Send sends a GetChannelMessage request to Discord and returns a Message.

type GetChannelMessages

type GetChannelMessages struct {
	Around    *string `url:"around,omitempty"`
	Before    *string `url:"before,omitempty"`
	After     *string `url:"after,omitempty"`
	Limit     *Flag   `url:"limit,omitempty"`
	ChannelID string  `url:"-"`
}

Get Channel Messages GET /channels/{channel.id}/messages https://discord.com/developers/docs/resources/channel#get-channel-messages

func (*GetChannelMessages) Send

func (r *GetChannelMessages) Send(bot *Client) ([]*Message, error)

Send sends a GetChannelMessages request to Discord and returns a []*Message.

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

func (*GetChannelWebhooks) Send

func (r *GetChannelWebhooks) Send(bot *Client) ([]*Webhook, error)

Send sends a GetChannelWebhooks request to Discord and returns a []*Webhook.

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

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

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

func (*GetCurrentUser) Send

func (r *GetCurrentUser) Send(bot *Client) (*User, error)

Send sends a GetCurrentUser request to Discord and returns a User.

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

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"`
}

Get Current User Guilds GET /users/@me/guilds https://discord.com/developers/docs/resources/user#get-current-user-guilds

func (*GetCurrentUserGuilds) Send

func (r *GetCurrentUserGuilds) Send(bot *Client) ([]*Guild, error)

Send sends a GetCurrentUserGuilds request to Discord and returns a []*Guild.

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

func (*GetFollowupMessage) Send

func (r *GetFollowupMessage) Send(bot *Client) (*Message, error)

Send sends a GetFollowupMessage request to Discord and returns a 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

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

Send sends a GetGlobalApplicationCommands request to Discord and returns a []*ApplicationCommand.

type GetGuild

type GetGuild struct {
	WithCounts *bool  `url:"with_counts,omitempty"`
	GuildID    string `url:"-"`
}

Get Guild GET /guilds/{guild.id} https://discord.com/developers/docs/resources/guild#get-guild

func (*GetGuild) Send

func (r *GetGuild) Send(bot *Client) (*Guild, error)

Send sends a GetGuild request to Discord and returns a Guild.

type GetGuildApplicationCommand

type GetGuildApplicationCommand struct {
	GuildID   string
	CommandID string
}

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

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

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

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

func (*GetGuildAuditLog) Send

func (r *GetGuildAuditLog) Send(bot *Client) (*AuditLog, error)

Send sends a GetGuildAuditLog request to Discord and returns a AuditLog.

type GetGuildBan

type GetGuildBan struct {
	GuildID string
	UserID  string
}

Get Guild Ban GET /guilds/{guild.id}/bans/{user.id} https://discord.com/developers/docs/resources/guild#get-guild-ban

func (*GetGuildBan) Send

func (r *GetGuildBan) Send(bot *Client) (*Ban, error)

Send sends a GetGuildBan request to Discord and returns a 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

func (*GetGuildBans) Send

func (r *GetGuildBans) Send(bot *Client) ([]*Ban, error)

Send sends a GetGuildBans request to Discord and returns a []*Ban.

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

func (*GetGuildChannels) Send

func (r *GetGuildChannels) Send(bot *Client) ([]*Channel, error)

Send sends a GetGuildChannels request to Discord and returns a []*Channel.

type GetGuildEmoji

type GetGuildEmoji struct {
	GuildID string
	EmojiID string
}

Get Guild Emoji GET /guilds/{guild.id}/emojis/{emoji.id} https://discord.com/developers/docs/resources/emoji#get-guild-emoji

func (*GetGuildEmoji) Send

func (r *GetGuildEmoji) Send(bot *Client) (*Emoji, error)

Send sends a GetGuildEmoji request to Discord and returns a 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

func (*GetGuildInvites) Send

func (r *GetGuildInvites) Send(bot *Client) ([]*Invite, error)

Send sends a GetGuildInvites request to Discord and returns a []*Invite.

type GetGuildMember

type GetGuildMember struct {
	GuildID string
	UserID  string
}

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 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

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 GetGuildRoles

type GetGuildRoles struct {
	GuildID string
}

Get Guild Roles GET /guilds/{guild.id}/roles https://discord.com/developers/docs/resources/guild#get-guild-roles

func (*GetGuildRoles) Send

func (r *GetGuildRoles) Send(bot *Client) ([]*Role, error)

Send sends a GetGuildRoles request to Discord and returns a []*Role.

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

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

Send sends a GetGuildScheduledEventUsers request to Discord and returns a []*GuildScheduledEventUser.

type GetGuildSticker

type GetGuildSticker struct {
	GuildID   string
	StickerID string
}

Get Guild Sticker GET /guilds/{guild.id}/stickers/{sticker.id} https://discord.com/developers/docs/resources/sticker#get-guild-sticker

func (*GetGuildSticker) Send

func (r *GetGuildSticker) Send(bot *Client) (*Sticker, error)

Send sends a GetGuildSticker request to Discord and returns a 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

func (*GetGuildVanityURL) Send

func (r *GetGuildVanityURL) Send(bot *Client) (*Invite, error)

Send sends a GetGuildVanityURL request to Discord and returns a Invite.

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

func (*GetGuildWebhooks) Send

func (r *GetGuildWebhooks) Send(bot *Client) ([]*Webhook, error)

Send sends a GetGuildWebhooks request to Discord and returns a []*Webhook.

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

func (*GetInvite) Send

func (r *GetInvite) Send(bot *Client) (*Invite, error)

Send sends a GetInvite request to Discord and returns a 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

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

func (*GetPinnedMessages) Send

func (r *GetPinnedMessages) Send(bot *Client) ([]*Message, error)

Send sends a GetPinnedMessages request to Discord and returns a []*Message.

type GetReactions

type GetReactions struct {
	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

func (*GetReactions) Send

func (r *GetReactions) Send(bot *Client) ([]*User, error)

Send sends a GetReactions request to Discord and returns a []*User.

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

func (*GetSticker) Send

func (r *GetSticker) Send(bot *Client) (*Sticker, error)

Send sends a GetSticker request to Discord and returns a Sticker.

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

func (*GetUser) Send

func (r *GetUser) Send(bot *Client) (*User, error)

Send sends a GetUser request to Discord and returns a User.

type GetUserApplicationRoleConnection added in v1.10.1

type GetUserApplicationRoleConnection 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 (*GetUserApplicationRoleConnection) Send added in v1.10.1

Send sends a GetUserApplicationRoleConnection request to Discord and returns a ApplicationRoleConnection.

type GetUserConnections

type GetUserConnections struct{}

Get User Connections GET /users/@me/connections https://discord.com/developers/docs/resources/user#get-user-connections

func (*GetUserConnections) Send

func (r *GetUserConnections) Send(bot *Client) ([]*Connection, error)

Send sends a GetUserConnections request to Discord and returns a []*Connection.

type GetWebhook

type GetWebhook struct {
	WebhookID string
}

Get Webhook GET /webhooks/{webhook.id} https://discord.com/developers/docs/resources/webhook#get-webhook

func (*GetWebhook) Send

func (r *GetWebhook) Send(bot *Client) (*Webhook, error)

Send sends a GetWebhook request to Discord and returns a 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

func (*GetWebhookMessage) Send

func (r *GetWebhookMessage) Send(bot *Client) (*Message, error)

Send sends a GetWebhookMessage request to Discord and returns a Message.

type GetWebhookwithToken

type GetWebhookwithToken struct {
	WebhookID    string
	WebhookToken string
}

Get Webhook with Token GET /webhooks/{webhook.id}/{webhook.token} https://discord.com/developers/docs/resources/webhook#get-webhook-with-token

func (*GetWebhookwithToken) Send

func (r *GetWebhookwithToken) Send(bot *Client) (*Webhook, error)

Send sends a GetWebhookwithToken request to Discord and returns a Webhook.

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

type GroupDMRemoveRecipient struct {
	ChannelID string
	UserID    string
}

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 {
	PublicUpdatesChannelID   *string `json:"public_updates_channel_id"`
	PremiumSubscriptionCount *int    `json:"premium_subscription_count,omitempty"`
	Icon                     *string `json:"icon"`
	ApplicationID            *string `json:"application_id"`
	Splash                   *string `json:"splash"`
	DiscoverySplash          *string `json:"discovery_splash"`
	Owner                    *bool   `json:"owner,omitempty"`

	// Unavailable Guild Object
	// https://discord.com/developers/docs/resources/guild#unavailable-guild-object
	Unavailable                 *bool          `json:"unavailable,omitempty"`
	Permissions                 *string        `json:"permissions,omitempty"`
	Region                      **string       `json:"region,omitempty"`
	SafetyAlertsChannelID       *string        `json:"safety_alerts_channel_id"`
	WelcomeScreen               *WelcomeScreen `json:"welcome_screen,omitempty"`
	SystemChannelID             *string        `json:"system_channel_id"`
	WidgetChannelID             **string       `json:"widget_channel_id,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"`
	Banner                      *string        `json:"banner"`
	Description                 *string        `json:"description"`
	AfkChannelID                *string        `json:"afk_channel_id"`
	IconHash                    **string       `json:"icon_hash,omitempty"`
	WidgetEnabled               *bool          `json:"widget_enabled,omitempty"`
	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"`
	OwnerID                     string         `json:"owner_id"`
	ID                          string         `json:"id"`
	PreferredLocale             string         `json:"preferred_locale"`
	Features                    []*string      `json:"features"`
	Emojis                      []*Emoji       `json:"emojis"`
	Stickers                    []*Sticker     `json:"stickers,omitempty"`
	Roles                       []*Role        `json:"roles"`
	SystemChannelFlags          BitFlag        `json:"system_channel_flags"`
	AfkTimeout                  int            `json:"afk_timeout"`
	PremiumTier                 Flag           `json:"premium_tier"`
	DefaultMessageNotifications Flag           `json:"default_message_notifications"`
	ExplicitContentFilter       Flag           `json:"explicit_content_filter"`
	VerificationLevel           Flag           `json:"verification_level"`
	NSFWLevel                   Flag           `json:"nsfw_level"`
	PremiumProgressBarEnabled   bool           `json:"premium_progress_bar_enabled"`
	MFALevel                    Flag           `json:"mfa_level"`
}

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

type GuildBanAdd struct {
	User    *User  `json:"user"`
	GuildID string `json:"guild_id"`
}

Guild Ban Add https://discord.com/developers/docs/topics/gateway-events#guild-ban-add

type GuildBanRemove

type GuildBanRemove struct {
	User    *User  `json:"user"`
	GuildID string `json:"guild_id"`
}

Guild Ban Remove https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove

type GuildEmojisUpdate

type GuildEmojisUpdate struct {
	GuildID string   `json:"guild_id"`
	Emojis  []*Emoji `json:"emojis"`
}

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"`
	User                       *User       `json:"user,omitempty"`
	Nick                       **string    `json:"nick,omitempty"`
	Avatar                     **string    `json:"avatar,omitempty"`
	PremiumSince               **time.Time `json:"premium_since,omitempty"`
	Pending                    *bool       `json:"pending,omitempty"`
	Permissions                *string     `json:"permissions,omitempty"`
	CommunicationDisabledUntil **time.Time `json:"communication_disabled_until,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

type GuildMemberRemove struct {
	User    *User  `json:"user"`
	GuildID string `json:"guild_id"`
}

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"`
}

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

type GuildRoleCreate struct {
	Role    *Role  `json:"role"`
	GuildID string `json:"guild_id"`
}

Guild Role Create https://discord.com/developers/docs/topics/gateway-events#guild-role-create

type GuildRoleDelete

type GuildRoleDelete struct {
	GuildID string `json:"guild_id"`
	RoleID  string `json:"role_id"`
}

Guild Role Delete https://discord.com/developers/docs/topics/gateway-events#guild-role-delete

type GuildRoleUpdate

type GuildRoleUpdate struct {
	Role    *Role  `json:"role"`
	GuildID string `json:"guild_id"`
}

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"`
	Image              **string                           `json:"image,omitempty"`
	ChannelID          *string                            `json:"channel_id"`
	CreatorID          **string                           `json:"creator_id,omitempty"`
	UserCount          *int                               `json:"user_count,omitempty"`
	Description        **string                           `json:"description,omitempty"`
	ScheduledEndTime   *time.Time                         `json:"scheduled_end_time"`
	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 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 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 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 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)
	InteractionCreate                   []func(*InteractionCreate)
	VoiceServerUpdate                   []func(*VoiceServerUpdate)
	GuildMembersChunk                   []func(*GuildMembersChunk)
	UserUpdate                          []func(*UserUpdate)
	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)
	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)
	GuildRoleCreate                     []func(*GuildRoleCreate)
	GuildRoleUpdate                     []func(*GuildRoleUpdate)
	GuildRoleDelete                     []func(*GuildRoleDelete)
	GuildScheduledEventCreate           []func(*GuildScheduledEventCreate)
	GuildScheduledEventUpdate           []func(*GuildScheduledEventUpdate)
	GuildScheduledEventDelete           []func(*GuildScheduledEventDelete)
	GuildScheduledEventUserAdd          []func(*GuildScheduledEventUserAdd)
	GuildScheduledEventUserRemove       []func(*GuildScheduledEventUserRemove)
	IntegrationCreate                   []func(*IntegrationCreate)
	IntegrationUpdate                   []func(*IntegrationUpdate)
	IntegrationDelete                   []func(*IntegrationDelete)
	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)
	TypingStart                         []func(*TypingStart)
	VoiceStateUpdate                    []func(*VoiceStateUpdate)
	WebhooksUpdate                      []func(*WebhooksUpdate)
	// contains filtered or unexported fields
}

Handlers represents a bot's event handlers.

type Heartbeat

type Heartbeat struct {
	Data int64 `json:"d"`
}

Heartbeat https://discord.com/developers/docs/topics/gateway-events#heartbeat

func (*Heartbeat) SendEvent

func (c *Heartbeat) SendEvent(bot *Client, session *Session) error

SendEvent sends an Opcode 1 Heartbeat event to the Discord Gateway.

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) SendEvent

func (c *Identify) SendEvent(bot *Client, session *Session) error

SendEvent sends an Opcode 2 Identify event to the Discord Gateway.

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

type IntegrationAccount struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

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"`
	ChannelID      *string         `json:"channel_id,omitempty"`
	User           *User           `json:"user,omitempty"`
	GuildLocale    *string         `json:"guild_locale,omitempty"`
	GuildID        *string         `json:"guild_id,omitempty"`
	Channel        *Channel        `json:"channel,omitempty"`
	Locale         *string         `json:"locale,omitempty"`
	Member         *GuildMember    `json:"member,omitempty"`
	AppPermissions *BitFlag        `json:"app_permissions,omitempty,string"`
	Message        *Message        `json:"message,omitempty"`
	Token          string          `json:"token"`
	ID             string          `json:"id"`
	ApplicationID  string          `json:"application_id"`
	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 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"`
}

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

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 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

Send sends a ListAutoModerationRulesForGuild request to Discord and returns a []*AutoModerationAction.

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

func (*ListGuildEmojis) Send

func (r *ListGuildEmojis) Send(bot *Client) ([]*Emoji, error)

Send sends a ListGuildEmojis request to Discord and returns a []*Emoji.

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 ListGuildStickers

type ListGuildStickers struct {
	GuildID string
}

List Guild Stickers GET /guilds/{guild.id}/stickers https://discord.com/developers/docs/resources/sticker#list-guild-stickers

func (*ListGuildStickers) Send

func (r *ListGuildStickers) Send(bot *Client) ([]*Sticker, error)

Send sends a ListGuildStickers request to Discord and returns a []*Sticker.

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

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 ListNitroStickerPacks

type ListNitroStickerPacks struct{}

List Nitro Sticker Packs GET /sticker-packs https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs

func (*ListNitroStickerPacks) Send

Send sends a ListNitroStickerPacks request to Discord and returns a ListNitroStickerPacksResponse.

type ListNitroStickerPacksResponse

type ListNitroStickerPacksResponse struct {
	StickerPacks []*StickerPack `json:"sticker_packs"`
}

List Nitro Sticker Packs Response https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs

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

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

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 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

Send sends a ListScheduledEventsforGuild request to Discord and returns a []*GuildScheduledEvent.

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"`
	Interaction       *Interaction `json:"interaction"`
	ReferencedMessage **Message    `json:"referenced_message,omitempty"`

	// MessageCreate Event Extra Field
	// https://discord.com/developers/docs/topics/gateway-events#message-create
	GuildID          *string           `json:"guild_id,omitempty"`
	WebhookID        *string           `json:"webhook_id,omitempty"`
	EditedTimestamp  *time.Time        `json:"edited_timestamp"`
	Position         *int              `json:"position,omitempty"`
	Thread           *Channel          `json:"thread"`
	Author           *User             `json:"author"`
	Flags            *BitFlag          `json:"flags,omitempty"`
	MessageReference *MessageReference `json:"message_reference,omitempty"`
	ApplicationID    *string           `json:"application_id,omitempty"`
	Application      *Application      `json:"application,omitempty"`
	Activity         *MessageActivity  `json:"activity,omitempty"`
	Nonce            *Nonce            `json:"nonce,omitempty"`

	// MessageCreate Event Extra Field
	// https://discord.com/developers/docs/topics/gateway-events#message-create
	Member               *GuildMember          `json:"member,omitempty"`
	RoleSubscriptionData *RoleSubscriptionData `json:"role_subscription_data,omitempty"`
	ChannelID            string                `json:"channel_id"`
	ID                   string                `json:"id"`
	Content              string                `json:"content"`
	Attachments          []*Attachment         `json:"attachments"`
	MentionChannels      []*ChannelMention     `json:"mention_channels,omitempty"`
	MentionRoles         []*string             `json:"mention_roles"`
	Components           []Component           `json:"components"`
	Reactions            []*Reaction           `json:"reactions,omitempty"`
	Mentions             []*User               `json:"mentions"`
	StickerItems         []*StickerItem        `json:"sticker_items"`
	Stickers             []*Sticker            `json:"stickers"`
	Embeds               []*Embed              `json:"embeds"`
	MentionEveryone      bool                  `json:"mention_everyone"`
	TTS                  bool                  `json:"tts"`
	Type                 Flag                  `json:"type"`
	Pinned               bool                  `json:"pinned"`
}

Message Object https://discord.com/developers/docs/resources/channel#message-object

func (*Message) UnmarshalJSON

func (r *Message) UnmarshalJSON(b []byte) error

type MessageActivity

type MessageActivity struct {
	PartyID *string `json:"party_id,omitempty"`
	Type    int     `json:"type"`
}

Message Activity Structure https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure

type MessageComponentData

type MessageComponentData struct {
	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 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 MessageReactionAdd

type MessageReactionAdd struct {
	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"`
}

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"`
}

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"`
}

Message Reference Object https://discord.com/developers/docs/resources/channel#message-reference-object

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"`
	Embeds          []*Embed         `json:"embeds,omitempty"`
	AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"`
	Flags           *BitFlag         `json:"flags,omitempty"`
	Components      []Component      `json:"components,omitempty"`
	Attachments     []*Attachment    `json:"attachments,omitempty"`
}

Messages https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-messages

func (Messages) InteractionCallbackDataType

func (d Messages) InteractionCallbackDataType() Flag

func (*Messages) UnmarshalJSON

func (r *Messages) UnmarshalJSON(b []byte) error
type Modal struct {
	CustomID   string      `json:"custom_id"`
	Title      string      `json:"title"`
	Components []Component `json:"components"`
}

Modal https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-modal

func (Modal) InteractionCallbackDataType

func (d Modal) InteractionCallbackDataType() Flag

func (*Modal) UnmarshalJSON

func (r *Modal) UnmarshalJSON(b []byte) error

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 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

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

func (*ModifyChannel) Send

func (r *ModifyChannel) Send(bot *Client) (*Channel, error)

Send sends a ModifyChannel request to Discord and returns a 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

func (*ModifyChannelGroupDM) Send

func (r *ModifyChannelGroupDM) Send(bot *Client) (*Channel, error)

Send sends a ModifyChannelGroupDM request to Discord and returns a Channel.

type ModifyChannelGuild

type ModifyChannelGuild struct {
	UserLimit                     **int                   `json:"user_limit,omitempty"`
	DefaultSortOrder              **int                   `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

func (*ModifyChannelGuild) Send

func (r *ModifyChannelGuild) Send(bot *Client) (*Channel, error)

Send sends a ModifyChannelGuild request to Discord and returns a 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

func (*ModifyChannelThread) Send

func (r *ModifyChannelThread) Send(bot *Client) (*Channel, error)

Send sends a ModifyChannelThread request to Discord and returns a Channel.

type ModifyCurrentMember

type ModifyCurrentMember struct {
	Nick    **string `json:"nick,omitempty"`
	GuildID string   `json:"-"`
}

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"`
}

Modify Current User PATCH /users/@me https://discord.com/developers/docs/resources/user#modify-current-user

func (*ModifyCurrentUser) Send

func (r *ModifyCurrentUser) Send(bot *Client) (*User, error)

Send sends a ModifyCurrentUser request to Discord and returns a 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

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

func (*ModifyGuild) Send

func (r *ModifyGuild) Send(bot *Client) (*Guild, error)

Send sends a ModifyGuild request to Discord and returns a Guild.

type ModifyGuildChannelPositionParameters

type ModifyGuildChannelPositionParameters struct {
	Position        *int    `json:"position"`
	LockPermissions *bool   `json:"lock_permissions"`
	ParentID        *string `json:"parent_id"`
	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

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,omitempty"`
	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

func (*ModifyGuildEmoji) Send

func (r *ModifyGuildEmoji) Send(bot *Client) (*Emoji, error)

Send sends a ModifyGuildEmoji request to Discord and returns a Emoji.

type ModifyGuildMFALevel

type ModifyGuildMFALevel struct {
	GuildID string `json:"-"`
	Level   Flag   `json:"level"`
}

Modify Guild MFA Level POST /guilds/{guild.id}/mfa https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level

func (*ModifyGuildMFALevel) Send

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 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

func (*ModifyGuildRole) Send

func (r *ModifyGuildRole) Send(bot *Client) (*Role, error)

Send sends a ModifyGuildRole request to Discord and returns a 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)

func (*ModifyGuildRolePositions) Send

func (r *ModifyGuildRolePositions) Send(bot *Client) ([]*Role, error)

Send sends a ModifyGuildRolePositions request to Discord and returns a []*Role.

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

Send sends a ModifyGuildScheduledEvent request to Discord and returns a GuildScheduledEvent.

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

func (*ModifyGuildSticker) Send

func (r *ModifyGuildSticker) Send(bot *Client) (*Sticker, error)

Send sends a ModifyGuildSticker request to Discord and returns a 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

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

func (*ModifyWebhook) Send

func (r *ModifyWebhook) Send(bot *Client) (*Webhook, error)

Send sends a ModifyWebhook request to Discord and returns a 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

func (*ModifyWebhookwithToken) Send

func (r *ModifyWebhookwithToken) Send(bot *Client) (*Webhook, error)

Send sends a ModifyWebhookwithToken request to Discord and returns a Webhook.

type Nonce

type Nonce string

Nonce represents a Discord nonce (integer or string).

func (Nonce) Int64

func (n Nonce) Int64() (int64, error)

func (Nonce) String

func (n Nonce) String() string

func (*Nonce) UnmarshalJSON

func (v *Nonce) UnmarshalJSON(b []byte) error

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

type PinMessage struct {
	ChannelID string
	MessageID string
}

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 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 {
	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) EndTx

func (r *RateLimit) EndTx()

func (*RateLimit) GetBucket

func (r *RateLimit) GetBucket(routeid string, resourceid string) *Bucket

func (*RateLimit) GetBucketFromID

func (r *RateLimit) GetBucketFromID(bucketid string) *Bucket

func (*RateLimit) GetBucketID

func (r *RateLimit) GetBucketID(routeid string) string

func (*RateLimit) Lock

func (r *RateLimit) Lock()

func (*RateLimit) SetBucket

func (r *RateLimit) SetBucket(routeid string, bucket *Bucket)

func (*RateLimit) SetBucketFromID

func (r *RateLimit) SetBucketFromID(bucketid string, bucket *Bucket)

func (*RateLimit) SetBucketID

func (r *RateLimit) SetBucketID(routeid string, bucketid string)

func (*RateLimit) SetDefaultBucket

func (r *RateLimit) SetDefaultBucket(bucket *Bucket)

func (*RateLimit) StartTx

func (r *RateLimit) StartTx()

func (*RateLimit) Unlock

func (r *RateLimit) Unlock()

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 {
	Emoji *Emoji `json:"emoji"`
	Count int    `json:"count"`
	Me    bool   `json:"me"`
}

Reaction Object https://discord.com/developers/docs/resources/channel#reaction-object

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 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

Send sends a RefreshTokenExchange request to Discord and returns an AccessTokenResponse.

Uses the RefreshTokenExchange ClientID and ClientSecret.

type RemoveGuildBan

type RemoveGuildBan struct {
	GuildID string
	UserID  string
}

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

type RemoveGuildMember struct {
	GuildID string
	UserID  string
}

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

type RemoveGuildMemberRole struct {
	GuildID string
	UserID  string
	RoleID  string
}

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

type RemoveThreadMember struct {
	ChannelID string
	UserID    string
}

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

	// RetryShared determines the behavior of a request when
	// 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 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) SendEvent

func (c *Resume) SendEvent(bot *Client, session *Session) error

SendEvent sends an Opcode 6 Resume event to the Discord Gateway.

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 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"`
	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 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 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"`
	Type         int                `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

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 SendEvent

type SendEvent interface{}

Gateway SendEvent https://discord.com/developers/docs/topics/gateway-events#send-events

type Session

type Session struct {
	// Context carries request-scoped data for the Discord Gateway Connection.
	//
	// Context is also used as a signal for the Session's goroutines.
	Context context.Context

	// RateLimiter represents an object that provides rate limit functionality.
	RateLimiter RateLimiter

	// Shard represents the [shard_id, num_shards] for this session.
	//
	// https://discord.com/developers/docs/topics/gateway#sharding
	Shard *[2]int

	// Conn represents a connection to the Discord Gateway.
	Conn *websocket.Conn

	// ID represents the session ID of the Session.
	ID string

	// Endpoint represents the endpoint that is used to reconnect to the Gateway.
	Endpoint string

	// Seq represents the last sequence number received by the client.
	//
	// https://discord.com/developers/docs/topics/gateway#heartbeat
	Seq int64

	// RWMutex is used to protect the Session's variables from data races
	// by providing transactional functionality.
	sync.RWMutex
	// contains filtered or unexported fields
}

Session represents a Discord Gateway WebSocket Session.

func NewSession

func NewSession() *Session

NewSession gets a Session from a pool.

func (*Session) Connect

func (s *Session) Connect(bot *Client) error

Connect connects a session to the Discord Gateway (WebSocket Connection).

func (*Session) Disconnect

func (s *Session) Disconnect() error

Disconnect disconnects a session from the Discord Gateway using the given status code.

func (*Session) Monitor

func (s *Session) Monitor() uint32

Monitor returns the current amount of HeartbeatACKs for a Session's heartbeat.

func (*Session) Reconnect

func (s *Session) Reconnect(bot *Client) error

Reconnect reconnects an already connected session to the Discord Gateway by disconnecting the session, then connecting again.

func (*Session) Wait

func (s *Session) Wait() (int, error)

Wait blocks until the calling Session has disconnected, then returns the reason (disgo.SignalReason) for disconnecting and the disconnection error (if it exists).

If Wait() is called on a Session that isn't connected, it will return immediately with code SignalNone.

It's NOT recommended to modify a Session after it has disconnected, since it will be cleared and placed into a memory pool shortly after.

type SessionManager

type SessionManager struct {
	// Gateway represents a map of Discord Gateway (TCP WebSocket Connections) session IDs to Sessions.
	// map[ID]Session (map[string]*Session)
	Gateway *sync.Map

	// Voice represents a map of Discord Voice (UDP WebSocket Connection) session IDs to Sessions.
	// map[ID]Session (map[string]*Session)
	Voice *sync.Map
}

SessionManager manages sessions.

func NewSessionManager

func NewSessionManager() *SessionManager

NewSessionManager creates a new SessionManager.

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#123 in /wrapper/session.go).
	SetLimit(bot *Client) (gatewayEndpoint string, 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(bot *Client) 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 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 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

func (*StartThreadfromMessage) Send

func (r *StartThreadfromMessage) Send(bot *Client) (*Channel, error)

Send sends a StartThreadfromMessage request to Discord and returns a Channel.

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             *ForumThreadMessageParams `json:"message"`
	AppliedTags         []string                  `json:"applied_tags,omitempty"`
}

Start Thread in Forum Channel POST /channels/{channel.id}/threads https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel

func (*StartThreadinForumChannel) Send

func (r *StartThreadinForumChannel) Send(bot *Client) (*Channel, error)

Send sends a StartThreadinForumChannel request to Discord and returns a 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

func (*StartThreadwithoutMessage) Send

func (r *StartThreadwithoutMessage) Send(bot *Client) (*Channel, error)

Send sends a StartThreadwithoutMessage request to Discord and returns a Channel.

type Sticker

type Sticker struct {
	PackID      *string `json:"pack_id,omitempty"`
	Description *string `json:"description"`
	Asset       *string `json:"asset,omitempty"`
	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 SyncGuildTemplate

type SyncGuildTemplate struct {
	GuildID      string
	TemplateCode string
}

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"`
	Permissions     []string `json:"permissions"`
	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"`
	Style       Flag    `json:"style"`
}

Text Input Structure https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-structure

func (TextInput) ComponentType

func (c TextInput) ComponentType() Flag

type ThreadCreate

type ThreadCreate struct {
	*Channel
	NewlyCreated *bool `json:"newly_created,omitempty"`
}

Thread Create https://discord.com/developers/docs/topics/gateway-events#thread-create

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 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

type UnpinMessage struct {
	ChannelID string
	MessageID string
}

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

Send sends a UpdateApplicationRoleConnectionMetadataRecords request to Discord and returns a []*ApplicationRoleConnectionMetadata.

type UpdateUserApplicationRoleConnection added in v1.10.1

type UpdateUserApplicationRoleConnection 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 (*UpdateUserApplicationRoleConnection) Send added in v1.10.1

Send sends a UpdateUserApplicationRoleConnection request to Discord and returns a ApplicationRoleConnection.

type User

type User struct {
	Banner        **string `json:"banner,omitempty"`
	Locale        *string  `json:"locale,omitempty"`
	PublicFlags   *BitFlag `json:"public_flag,omitempty"`
	GlobalName    *string  `json:"global_name"`
	PremiumType   *Flag    `json:"premium_type,omitempty"`
	Bot           *bool    `json:"bot,omitempty"`
	Flags         *BitFlag `json:"flag,omitempty"`
	System        *bool    `json:"system,omitempty"`
	Avatar        *string  `json:"avatar"`
	AccentColor   **int    `json:"accent_color,omitempty"`
	MFAEnabled    *bool    `json:"mfa_enabled,omitempty"`
	Verified      *bool    `json:"verified,omitempty"`
	Email         **string `json:"email,omitempty"`
	Username      string   `json:"username"`
	ID            string   `json:"id"`
	Discriminator string   `json:"discriminator"`
}

User Object https://discord.com/developers/docs/resources/user#user-object

type Value

type Value string

Value represents a value (string, integer, double, or bool).

func (Value) Bool added in v1.10.1

func (n Value) Bool() (bool, error)

func (Value) Float64

func (n Value) Float64() (float64, error)

func (Value) Int64

func (n Value) Int64() (int64, error)

func (Value) String

func (n Value) String() string

func (*Value) UnmarshalJSON

func (v *Value) UnmarshalJSON(b []byte) error

type VoiceCloseEventCode

type VoiceCloseEventCode struct {
	Description string
	Explanation string
	Code        int
}

Voice Close Event Codes https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes

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 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 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

func (*VoiceStateUpdate) SendEvent

func (c *VoiceStateUpdate) SendEvent(bot *Client, session *Session) error

SendEvent sends an Opcode 4 UpdateVoiceState event to the Discord Gateway.

func (*VoiceStateUpdate) SendEvents added in v1.10.1

func (c *VoiceStateUpdate) SendEvents(bot *Client, sm ShardManager) error

SendEvents sends an Opcode 4 UpdateVoiceState event to the Discord Gateway.

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

Directories

Path Synopsis
cache module
gen module
shard module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL