package
2.43.0
Repository: https://github.com/botlabs-gg/yagpdb.git
Documentation: pkg.go.dev

# README

DiscordGo

GoDoc Go report Build Status Discord Gophers Discord API

DiscordGo is a Go package that provides low level bindings to the Discord chat client API. DiscordGo has nearly complete support for all of the Discord API endpoints, websocket interface, and voice interface.

If you would like to help the DiscordGo package please use this link to add the official DiscordGo test bot dgo to your server. This provides indispensable help to this project.

  • See dgVoice package for an example of additional voice helper functions and features for DiscordGo.

  • See dca for an experimental stand alone tool that wraps ffmpeg to create opus encoded audio appropriate for use with Discord (and DiscordGo).

For help with this package or general Go discussion, please join the Discord Gophers chat server.

Getting Started

master vs develop Branch

  • The master branch represents the latest released version of DiscordGo. This branch will always have a stable and tested version of the library. Each release is tagged and you can easily download a specific release and view release notes on the github releases page.

  • The develop branch is where all development happens and almost always has new features over the master branch. However breaking changes are frequently added to develop and even sometimes bugs are introduced. Bugs get fixed and the breaking changes get documented before pushing to master.

So, what should you use?

If you can accept the constant changing nature of develop, it is the recommended branch to use. Otherwise, if you want to tail behind development slightly and have a more stable package with documented releases, use master.

Installing

This assumes you already have a working Go environment, if not please see this page first.

go get will always pull the latest released version from the master branch.

go get github.com/bwmarrin/discordgo

If you want to use the develop branch, follow these steps next.

cd $GOPATH/src/github.com/bwmarrin/discordgo
git checkout develop

Usage

Import the package into your project.

import "github.com/bwmarrin/discordgo"

Construct a new Discord client which can be used to access the variety of Discord API functions and to set callback functions for Discord events.

discord, err := discordgo.New("authentication token")

See Documentation and Examples below for more detailed information.

Documentation

NOTICE : This library and the Discord API are unfinished. Because of that there may be major changes to library in the future.

The DiscordGo code is fairly well documented at this point and is currently the only documentation available. Both GoDoc and GoWalker (below) present that information in a nice format.

  • GoDoc
  • Go Walker
  • Hand crafted documentation coming eventually.

Examples

Below is a list of examples and other projects using DiscordGo. Please submit an issue if you would like your project added or removed from this list.

Troubleshooting

For help with common problems please reference the Troubleshooting section of the project wiki.

Contributing

Contributions are very welcomed, however please follow the below guidelines.

  • First open an issue describing the bug or enhancement so it can be discussed.
  • Fork the develop branch and make your changes.
  • Try to match current naming conventions as closely as possible.
  • This package is intended to be a low level direct mapping of the Discord API, so please avoid adding enhancements outside of that scope without first discussing it.
  • Create a Pull Request with your changes against the develop branch.

List of Discord APIs

See this chart for a feature comparison and list of other Discord API libraries.

Special Thanks

Chris Rhodes - For the DiscordGo logo and tons of PRs.

# Packages

No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Calculates the permissions for a member.
MessageComponentFromJSON is a helper function for unmarshaling message components.
MultipartBodyWithJSON returns the contentType and body for a discord request data : The object to encode for payload_json in the multipart request files : Files to include in the request.
New creates a new Discord session and will automate some startup tasks if given enough information to do so.
No description provided by the author
NewMessageEdit returns a MessageEdit struct, initialized with the Channel and ID.
NewRatelimiter returns a new RateLimiter.
NewState creates an empty state.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
VerifyInteraction implements message verification of the discord interactions api signing algorithm, as documented here: https://discord.com/developers/docs/interactions/receiving-and-responding#security-and-authorization.

# Constants

MessageComponent types.
Valid ActivityType values.
Valid ActivityType values.
Valid ActivityType values.
Valid ActivityType values.
Valid ActivityType values.
Valid ActivityType values.
No description provided by the author
No description provided by the author
No description provided by the author
Application command option types.
Application command option types.
Application command option types.
Application command option types.
Application command option types.
Application command option types.
Application command option types.
Application command option types.
Application command option types.
Application command option types.
Application command option types.
Application command permission types.
Application command permission types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
AuditLogChangeKeyAfkChannelID is sent when afk channel changed (snowflake) - guild.
AuditLogChangeKeyAfkTimeout is sent when afk timeout duration changed (int) - guild.
AuditLogChangeKeyAllow is sent when a permission on a text or voice channel was allowed for a role (string) - role.
AudirChangeKeyApplicationID is sent when application id of the added or removed webhook or bot (snowflake) - channel.
AuditLogChangeKeyArchived is sent when thread was archived/unarchived (bool) - thread.
AuditLogChangeKeyAsset is sent when asset is changed (string) - sticker.
AuditLogChangeKeyAutoArchiveDuration is sent when auto archive duration changed (int) - thread.
AuditLogChangeKeyAvailable is sent when availability of sticker changed (bool) - sticker.
AuditLogChangeKeyAvatarHash is sent when user avatar changed (string) - user.
AuditLogChangeKeyBannerHash is sent when guild banner changed (string) - guild.
AuditLogChangeKeyBitrate is sent when voice channel bitrate changed (int) - channel.
AuditLogChangeKeyChannelID is sent when channel for invite code or guild scheduled event changed (snowflake) - invite or guild scheduled event.
AuditLogChangeKeyCode is sent when invite code changed (string) - invite.
AuditLogChangeKeyColor is sent when role color changed (int) - role.
AuditLogChangeKeyCommunicationDisabledUntil is sent when member timeout state changed (ISO8601 timestamp) - member.
AuditLogChangeKeyDeaf is sent when user server deafened/undeafened (bool) - member.
AuditLogChangeKeyDefaultAutoArchiveDuration is sent when default auto archive duration for newly created threads changed (int) - channel.
AuditLogChangeKeyDefaultMessageNotification is sent when default message notification level changed (int) - guild.
AuditLogChangeKeyDeny is sent when a permission on a text or voice channel was denied for a role (string) - role.
AuditLogChangeKeyDescription is sent when description changed (string) - guild, sticker, or guild scheduled event.
AuditLogChangeKeyDiscoverySplashHash is sent when discovery splash changed (string) - guild.
AuditLogChangeKeyEnableEmoticons is sent when integration emoticons enabled/disabled (bool) - integration.
AuditLogChangeKeyEntityType is sent when entity type of guild scheduled event was changed (int) - guild scheduled event.
AuditLogChangeKeyExpireBehavior is sent when integration expiring subscriber behavior changed (int) - integration.
AuditLogChangeKeyExpireGracePeriod is sent when integration expire grace period changed (int) - integration.
AuditLogChangeKeyExplicitContentFilter is sent when change in whose messages are scanned and deleted for explicit content in the server is made (int) - guild.
AuditLogChangeKeyFormatType is sent when format type of sticker changed (int - sticker format type) - sticker.
AuditLogChangeKeyGuildID is sent when guild sticker is in changed (snowflake) - sticker.
AuditLogChangeKeyHoist is sent when role is now displayed/no longer displayed separate from online users (bool) - role.
AuditLogChangeKeyIconHash is sent when icon changed (string) - guild or role.
AuditLogChangeKeyID is sent when the id of the changed entity - sometimes used in conjunction with other keys (snowflake) - any.
AuditLogChangeKeyInvitable is sent when private thread is now invitable/uninvitable (bool) - thread.
AuditLogChangeKeyInviterID is sent when person who created invite code changed (snowflake) - invite.
AuditLogChangeKeyLocation is sent when channel id for guild scheduled event changed (string) - guild scheduled event.
AuditLogChangeKeyLocked is sent when thread was locked/unlocked (bool) - thread.
AuditLogChangeKeyMaxAge is sent when invite code expiration time changed (int) - invite.
AuditLogChangeKeyMaxUses is sent when max number of times invite code can be used changed (int) - invite.
AuditLogChangeKeyMentionable is sent when role is now mentionable/unmentionable (bool) - role.
AuditLogChangeKeyMfaLevel is sent when two-factor auth requirement changed (int - mfa level) - guild.
AuditLogChangeKeyMute is sent when user server muted/unmuted (bool) - member.
AuditLogChangeKeyName is sent when name changed (string) - any.
AuditLogChangeKeyNick is sent when user nickname changed (string) - member.
AuditLogChangeKeyNSFW is sent when channel nsfw restriction changed (bool) - channel.
AuditLogChangeKeyOwnerID is sent when owner changed (snowflake) - guild.
AuditLogChangeKeyPermissionOverwrite is sent when permissions on a channel changed (array of channel overwrite objects) - channel.
AuditLogChangeKeyPermissions is sent when permissions for a role changed (string) - role.
AuditLogChangeKeyPosition is sent when text or voice channel position changed (int) - channel.
AuditLogChangeKeyPreferredLocale is sent when preferred locale changed (string) - guild.
AuditLogChangeKeyPrivacylevel is sent when privacy level of the stage instance changed (integer - privacy level) - stage instance or guild scheduled event.
AuditLogChangeKeyPruneDeleteDays is sent when number of days after which inactive and role-unassigned members are kicked changed (int) - guild.
AuditLogChangeKeyPulibUpdatesChannelID is sent when id of the public updates channel changed (snowflake) - guild.
AuditLogChangeKeyRateLimitPerUser is sent when amount of seconds a user has to wait before sending another message changed (int) - channel.
AuditLogChangeKeyRegion is sent when region changed (string) - guild.
AuditLogChangeKeyRoleAdd is sent when new role added (array of partial role objects) - guild.
AuditLogChangeKeyRoleRemove is sent when role removed (array of partial role objects) - guild.
AuditLogChangeKeyRulesChannelID is sent when id of the rules channel changed (snowflake) - guild.
AuditLogChangeKeySplashHash is sent when invite splash page artwork changed (string) - guild.
AuditLogChangeKeyStatus is sent when status of guild scheduled event was changed (int - guild scheduled event status) - guild scheduled event.
AuditLogChangeKeySystemChannelID is sent when id of the system channel changed (snowflake) - guild.
AuditLogChangeKeyTags is sent when related emoji of sticker changed (string) - sticker.
TODO: remove when compatibility is not required.
AuditLogChangeKeyTemporary is sent when invite code is now temporary or never expires (bool) - invite.
AuditLogChangeKeyTopic is sent when text channel topic or stage instance topic changed (string) - channel or stage instance.
AuditLogChangeKeyType is sent when type of entity created (int or string) - any.
AuditLogChangeKeyUnicodeEmoji is sent when role unicode emoji changed (string) - role.
AuditLogChangeKeyUserLimit is sent when new user limit in a voice channel set (int) - voice channel.
AuditLogChangeKeyUses is sent when number of times invite code used changed (int) - invite.
AuditLogChangeKeyVanityURLCode is sent when guild invite vanity url changed (string) - guild.
AuditLogChangeKeyVerificationLevel is sent when required verification level changed (int - verification level) - guild.
AuditLogChangeKeyWidgetChannelID is sent when channel id of the server widget changed (snowflake) - guild.
AuditLogChangeKeyWidgetEnabled is sent when server widget enabled/disabled (bool) - guild.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Block contains Discord Audit Log Action Types.
Valid Types for AuditLogOptionsType.
Valid Types for AuditLogOptionsType.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
AutoModerationEventMessageSend is checked when a member sends or edits a message in the guild.
Auto moderation rule trigger types.
Auto moderation rule trigger types.
Auto moderation rule trigger types.
Auto moderation rule trigger types.
Auto moderation keyword presets.
Auto moderation keyword presets.
Auto moderation keyword presets.
Auto moderation actions types.
Auto moderation actions types.
Auto moderation actions types.
All defined locales in Discord.
MessageComponent types.
ChannelFlagsHideMediaDownloadOptions when set hides the embedded media download options.
ChannelFlagsPinned this thread is pinned to the top of its parent GUILD_FORUM or GUILD_MEDIA channel.
ChannelFlagsRequireTag whether a tag is required to be specified when creating a thread in a GUILD_FORUM or a GUILD_MEDIA channel.
SelectMenu types.
MessageComponent types.
a direct message between users.
a direct message between multiple users.
an organizational category that contains up to 50 channels.
a channel that can only contain threads.
a channel that users can follow and crosspost into their own server.
a temporary sub-channel within a GUILD_NEWS channel.
a temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those with the MANAGE_THREADS permission.
a temporary sub-channel within a GUILD_TEXT channel.
a voice channel for hosting events with an audience.
a channel in which game developers can sell their game on Discord.
a text channel within a server.
a voice channel within a server.
ChatApplicationCommand is default command type.
All defined locales in Discord.
All defined locales in Discord.
All defined locales in Discord.
No description provided by the author
All defined locales in Discord.
DangerButton is a button with red color.
All defined locales in Discord.
All defined locales in Discord.
All defined locales in Discord.
All defined locales in Discord.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Block contains Discord JSON Error Response codes.
Constants for ExplicitContentFilterLevel levels from 0 to 2 inclusive.
Constants for ExplicitContentFilterLevel levels from 0 to 2 inclusive.
Constants for ExplicitContentFilterLevel levels from 0 to 2 inclusive.
All defined locales in Discord.
ForumLayoutGalleryView displays forum posts as a collection of tiles.
ForumLayoutListView displays forum posts as a list.
ForumLayoutNotSet represents no default layout.
ForumSortOrderCreationDate sorts posts by creation time (from most recent to oldest).
ForumSortOrderLatestActivity sorts posts by activity.
All defined locales in Discord.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
- TYPING_START.
(Receive).
(Send/Receive).
(Receive).
(Receive).
(Send).
(Receive).
(Receive).
(Send).
(Send).
(Send).
(Send).
(Send).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
All defined locales in Discord.
All defined locales in Discord.
All defined locales in Discord.
All defined locales in Discord.
Interaction types.
Interaction types.
InteractionApplicationCommandAutocompleteResult shows autocompletion results.
InteractionDeadline is the time allowed to respond to an interaction.
Interaction types.
Interaction types.
Interaction types.
InteractionResponseChannelMessageWithSource is for responding with a message, showing the user's input.
InteractionResponseDeferredChannelMessageWithSource acknowledges that the event was received, and that a follow-up will come later.
InteractionResponseDeferredMessageUpdate acknowledges that the message component interaction event was received, and message will be updated later.
InteractionResponseModal is for responding to an interaction with a modal window.
InteractionResponsePong is for ACK ping event.
InteractionResponseUpdateMessage is for updating the message to which message component was attached.
All defined locales in Discord.
All defined locales in Discord.
All defined locales in Discord.
LinkButton is a special type of button which navigates to a URL.
All defined locales in Discord.
LogDebug level is for very detailed non-error activity.
LogError level is used for critical errors that could lead to data loss or panic that would not be returned to a calling function.
LogInformational level is used for normal non-error activity.
LogWarning level is used for very abnormal events and errors that are also returned to a calling function.
max size of buffers before they're discarded (e.g after a big incmoing event).
MemberFlagBypassesVerification indicates whether the Member is exempt from guild verification requirements.
MemberFlagCompletedOnboarding indicates whether the Member has completed onboarding.
MemberFlagDidRejoin indicates whether the Member has left and rejoined the guild.
MemberFlagStartedOnboarding indicates whether the Member has started onboarding.
SelectMenu types.
MessageComponent types.
MessageApplicationCommand adds command to message context menu.
MessageFlagsCrossPosted This message has been published to subscribed channels (via Channel Following).
MessageFlagsEphemeral this message is only visible to the user who invoked the Interaction.
MessageFlagsFailedToMentionSomeRolesInThread this message failed to mention some roles and add their members to the thread.
MessageFlagsHasThread this message has an associated thread, with the same id as the message.
MessageFlagsIsCrossPosted this message originated from a message in another channel (via Channel Following).
MessageFlagsIsVoiceMessage this message is a voice message.
MessageFlagsLoading this message is an Interaction Response and the bot is "thinking".
MessageFlagsSourceMessageDeleted the source message for this crosspost has been deleted (via Channel Following).
MessageFlagsSuppressEmbeds do not include any embeds when serializing this message.
MessageFlagsSuppressNotifications this message will not trigger push and desktop notifications.
TODO: deprecated, remove when compatibility is not needed.
MessageFlagsUrgent this message came from the urgent message system.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Block contains the valid known MessageType values.
Constants for MfaLevel levels from 0 to 1 inclusive.
Constants for MfaLevel levels from 0 to 1 inclusive.
All defined locales in Discord.
Allows for the addition of reactions to messages T.
Allows all permissions and bypasses channel permission overwrites.
all bits set except the leftmost to avoid using negative numbers in case discord doesn't handle it.
Allows for uploading images and files T.
Allows banning members.
Allows for modification of own nickname.
Allows for creating scheduled events, and editing and deleting those created by the current user.
Allows for creating emojis, stickers, and soundboard sounds, and editing and deleting those created by the current user.
Allows creation of instant invites T, V, S.
Links sent by users with this permission will be auto-embedded T.
Allows kicking members.
Allows management and editing of channels T, V, S.
Allows management and editing of emojis and stickers.
Allows for creating, editing, and deleting scheduled events V, S.
Allows management and editing of the guild.
Allows for deletion of other users messages T.
Allows for modification of other users nicknames.
Allows management and editing of roles T, V, S.
Allows for deleting and archiving threads, and viewing all private threads T.
Allows management and editing of webhooks T.
Allows for using the @everyone tag to notify all users in a channel, and the @here tag to notify all online users in a channel T.
Allows for timing out users to prevent them from sending or reacting to messages in chat and threads, and from speaking in voice and stage channels.
No description provided by the author
No description provided by the author
Allows for using priority speaker in a voice channel V.
Allows for reading of message history T.
Allows for requesting to speak in stage channels.
Allows for sending messages in a channel T.
Allows for sending messages in threads T.
Allows sending polls T, V, S.
Allows for sending of /tts messages T.
Allows sending voice messages T, V, S.
Allows the user to go live V.
Allows members to use slash commands in text channels T.
Allows for using Activities (applications with the EMBEDDED flag) in a voice channel V.
Allows the usage of custom emojis from other servers T.
Allows the usage of custom soundboard sounds from other servers V.
Allows the usage of custom stickers from other servers T.
Allows for creating and participating in private threads T.
Allows for creating and participating in threads T.
Allows for using soundboard in a voice channel V.
Allows for viewing of audit logs.
Allows guild members to view a channel, which includes reading messages in text channels T, V, S.
Allows for viewing role subscription insights.
Allows for viewing guild insights.
Allows for joining of a voice channel V, S.
Allows for deafening of members in a voice channel V, S.
Allows for moving of members between voice channels V, S.
Allows for muting members in a voice channel V, S.
Allows for speaking in a voice channel V.
Allows for using voice-activity-detection in a voice channel V.
All defined locales in Discord.
All defined locales in Discord.
PrimaryButton is a button with blurple color.
SelectMenu types.
MessageComponent types.
All defined locales in Discord.
All defined locales in Discord.
SecondaryButton is a button with grey color.
MessageComponent types.
SelectMenuDefaultValue types.
SelectMenuDefaultValue types.
SelectMenuDefaultValue types.
All defined locales in Discord.
Constants for Status with the different current available status.
Constants for Status with the different current available status.
Constants for Status with the different current available status.
Constants for Status with the different current available status.
Constants for Status with the different current available status.
SelectMenu types.
SuccessButton is a button with green color.
All defined locales in Discord.
MessageComponent types.
Text styles.
Text styles.
All defined locales in Discord.
All defined locales in Discord.
All defined locales in Discord.
All defined locales in Discord.
UserApplicationCommand adds command to user context menu.
SelectMenu types.
MessageComponent types.
Constants for VerificationLevel levels from 0 to 3 inclusive.
Constants for VerificationLevel levels from 0 to 3 inclusive.
Constants for VerificationLevel levels from 0 to 3 inclusive.
Constants for VerificationLevel levels from 0 to 3 inclusive.
VERSION of DiscordGo, follows Semantic Versioning.
All defined locales in Discord.

# Variables

go:generate go run tools/cmd/permnames/main.go.
APIVersion is the Discord API version used for the REST and Websocket API.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
Known Discord API Endpoints.
No description provided by the author
No description provided by the author
No description provided by the author
All error constants.
All error constants.
No description provided by the author
No description provided by the author
All error constants.
ErrMFA will be risen by New when the user has 2FA.
ErrNilState is returned when the state is nil.
All error constants.
ErrStateNotFound is returned when the state cache requested is not found.
All error constants.
No description provided by the author
All error constants.
All error constants.
All error constants.
No description provided by the author
This is used at the package level because it can be used by multiple sessions !! Changing this after starting 1 or more gateway sessions will lead to undefined behaviour.
Locales is a map of all the languages codes to their names.
Logger can be used to replace the standard logging for discordgo.

# Structs

An Ack is used to ack messages.
ActionsRow is a container for components within one row.
An Activity struct holds data about a user's activity.
AddedThreadMember holds information about the user who was added to the thread.
No description provided by the author
An APIErrorMessage is an api error message returned from discord.
An Application struct stores values for a Discord OAuth2 Application.
ApplicationCommand represents an application's slash command.
new Slash Command was created.
Slash Command was deleted.
ApplicationCommandInteractionData contains the data of application command interaction.
ApplicationCommandInteractionDataOption represents an option of a slash command.
ApplicationCommandInteractionDataResolved contains resolved data of command execution.
ApplicationCommandOption represents an option/subcommand/subcommands group.
ApplicationCommandOptionChoice represents a slash command option choice.
ApplicationCommandPermissions represents a single user or role permission for a command.
ApplicationCommandPermissionsList represents a list of ApplicationCommandPermissions, needed for serializing to JSON.
ApplicationCommandPermissionsUpdate is the data for an ApplicationCommandPermissionsUpdate event.
Slash Command was updated.
An Assets struct contains assets and labels used in the rich presence "playing .." Game.
AuditLogChange for an AuditLogEntry.
AuditLogEntry for a GuildAuditLog https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure.
AuditLogOptions optional data for the AuditLog https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info.
AutoModerationAction stores data for an auto moderation action.
AutoModerationActionExecution is the data for an AutoModerationActionExecution event.
AutoModerationActionMetadata represents additional metadata needed during execution for a specific action type.
AutoModerationRule stores data for an auto moderation rule.
AutoModerationRuleCreate is the data for an AutoModerationRuleCreate event.
AutoModerationRuleDelete is the data for an AutoModerationRuleDelete event.
AutoModerationRuleUpdate is the data for an AutoModerationRuleUpdate event.
AutoModerationTriggerMetadata represents additional metadata used to determine whether rule should be triggered.
Bucket represents a ratelimit bucket, each bucket gets ratelimited individually (-global ratelimits).
Button represents button component.
A Channel holds all data related to an individual Discord channel.
ChannelCreate is the data for a ChannelCreate event.
ChannelDelete is the data for a ChannelDelete event.
A ChannelEdit holds Channel Field data for a channel edit.
ChannelPinsUpdate stores data for a ChannelPinsUpdate event.
No description provided by the author
ChannelUpdate is the data for a ChannelUpdate event.
ComponentEmoji represents button emoji, if it does have one.
Connect is the data for a Connect event.
No description provided by the author
Disconnect is the data for a Disconnect event.
No description provided by the author
Emoji struct holds data related to Emoji's.
No description provided by the author
Event provides a basic initial struct for all websocket events.
File stores info about files you e.g.
ForumDefaultReaction specifies emoji to use as the default reaction to a forum post.
ForumTag represents a tag that is able to be applied to a thread in a forum channel.
FriendSourceFlags stores ..
GatewayBotResponse stores the data for the gateway/bot response.
No description provided by the author
GatewayConnectionManager is responsible for managing the gateway connections for a single shard We create a new GatewayConnection every time we reconnect to avoid a lot of synchronization needs and also to avoid having to manually reset the connection state, all the workers related to the old connection should eventually stop, and if they're late they will be working on a closed connection anyways so it dosen't matter.
A Guild holds all data related to a specific Discord Guild.
GuildApplicationCommandPermissions represents all permissions for a single guild command.
A GuildAuditLog stores data for a guild audit log.
No description provided by the author
A GuildBan stores data for a guild ban.
GuildBanAdd is the data for a GuildBanAdd event.
GuildBanRemove is the data for a GuildBanRemove event.
GuildCreate is the data for a GuildCreate event.
GuildDelete is the data for a GuildDelete event.
A GuildEmbed stores data for a guild embed.
A GuildEmojisUpdate is the data for a guild emoji update event.
GuildIntegrationsUpdate is the data for a GuildIntegrationsUpdate event.
No description provided by the author
No description provided by the author
GuildMemberAdd is the data for a GuildMemberAdd event.
GuildMemberRemove is the data for a GuildMemberRemove event.
A GuildMembersChunk is the data for a GuildMembersChunk event.
GuildMemberUpdate is the data for a GuildMemberUpdate event.
A GuildParams stores all the data needed to update discord guild settings.
A GuildRole stores data for guild roles.
GuildRoleCreate is the data for a GuildRoleCreate event.
A GuildRoleDelete is the data for a GuildRoleDelete event.
GuildRoleUpdate is the data for a GuildRoleUpdate event.
guild stickers were updated.
GuildUpdate is the data for a GuildUpdate event.
A ICEServer stores data for a specific voice ICE server.
Integration stores integration information.
IntegrationAccount is integration account information sent by the UserConnections endpoint.
Interaction represents data of an interaction.
No description provided by the author
No description provided by the author
InteractionResponse represents a response for an interaction event.
InteractionResponseData is response data for an interaction.
A Invite stores all data related to a specific Discord Guild or Channel invite.
InviteCreate is the data for the InviteCreate event.
InviteDelete is the data for the InviteDelete event.
InviteUser is a partial user obejct from the invite event(s).
A Member stores user information for Guild members.
A Message stores all data related to a specific Discord message.
MessageAck is the data for a MessageAck event.
A MessageActivity represents the activity sent with a message, such as a game invite.
A MessageAttachment stores data for message attachments.
MessageComponentInteractionData contains the data of message component interaction.
MessageCreate is the data for a MessageCreate event.
MessageDelete is the data for a MessageDelete event.
MessageDeleteBulk is the data for a MessageDeleteBulk event.
MessageEdit is used to chain parameters via ChannelMessageEditComplex, which is also where you should get the instance from.
An MessageEmbed stores data for message embeds.
MessageEmbedAuthor is a part of a MessageEmbed struct.
MessageEmbedField is a part of a MessageEmbed struct.
MessageEmbedFooter is a part of a MessageEmbed struct.
MessageEmbedImage is a part of a MessageEmbed struct.
MessageEmbedProvider is a part of a MessageEmbed struct.
MessageEmbedThumbnail is a part of a MessageEmbed struct.
MessageEmbedVideo is a part of a MessageEmbed struct.
MessageInteraction contains information about the application command interaction which generated the message.
MessageReaction stores the data for a message reaction.
MessageReactionAdd is the data for a MessageReactionAdd event.
MessageReactionRemove is the data for a MessageReactionRemove event.
MessageReactionRemoveAll is the data for a MessageReactionRemoveAll event.
all reactions for a given emoji were explicitly removed from a message.
MessageReactions holds a reactions object for a message.
MessageReactionsCountDetails holds normal and super reaction counts for the associated emoji.
MessageReference contains reference data sent with crossposted messages.
MessageSend stores all parameters you can send with ChannelMessageSendComplex.
MessageUpdate is the data for a MessageUpdate event.
ModalSubmitInteractionData contains the data of modal submit interaction.
A Packet contains the headers and content of a received voice packet.
A PermissionOverwrite holds permission overwrite data for a Channel.
A Presence stores the online, offline, or idle and game status of Guild members.
PresenceUpdate is the data for a PresenceUpdate event.
RateLimit is the data for a RateLimit event.
RateLimiter holds all ratelimit buckets.
No description provided by the author
A ReadState stores data on the read state of channels.
A Ready stores all data for the websocket READY event.
A Relationship between the logged in user and Relationship.User.
RelationshipAdd is the data for a RelationshipAdd event.
RelationshipRemove is the data for a RelationshipRemove event.
No description provided by the author
RESTError stores error information about a request with a bad response code.
Resumed is the data for a Resumed event.
A Role stores information about Discord guild member roles.
No description provided by the author
SelectMenu represents select menu component.
SelectMenuDefaultValue represents an entity selected by default in auto-populated select menus.
SelectMenuOption represents an option for a select menu.
A SelfUser stores user data about the token owner.
A Session represents a connection to the Discord API.
No description provided by the author
A Settings stores data for a specific users Discord client settings.
stage instance was created.
stage instance was deleted or closed.
stage instance was updated.
A State contains the current known state.
Standard implementation of the GatewayIdentifyRatelimiter.
TextInput represents text input component.
thread created, also sent when being added to a private thread.
thread was deleted.
sent when gaining access to a channel, contains all active threads in that channel.
A thread member is used to indicate whether a user has joined a thread or not.
some user(s) were added to or removed from a thread.
thread member for the current user was updated.
No description provided by the author
ThreadsList represents a list of threads alongisde with thread member objects for the current user.
ThreadStart stores all parameters you can use with MessageThreadStartComplex or ThreadStartComplex.
thread was updated.
A TimeStamps struct contains start and end times used in the rich presence "playing .." Game.
A TooManyRequests struct holds information received from Discord when receiving a HTTP 429 response.
TypingStart is the data for a TypingStart event.
No description provided by the author
A User stores all data for an individual Discord user.
UserConnection is a Connection returned from the UserConnections endpoint.
A UserGuild holds a brief version of a Guild.
A UserGuildSettings stores data for a users guild settings.
A UserGuildSettingsChannelOverride stores data for a channel override for a users guild settings.
A UserGuildSettingsEdit stores data for editing UserGuildSettings.
UserGuildSettingsUpdate is the data for a UserGuildSettingsUpdate event.
UserNoteUpdate is the data for a UserNoteUpdate event.
UserUpdate is the data for a UserUpdate event.
No description provided by the author
A VoiceConnection struct holds all the data and functions related to a Discord Voice Connection.
A VoiceICE stores data for voice ICE servers.
A VoiceRegion stores data for a specific voice region server.
VoiceServerUpdate is the data for a VoiceServerUpdate event.
VoiceSpeakingUpdate is a struct for a VoiceSpeakingUpdate event.
A VoiceState stores the voice states of Guilds.
VoiceStateUpdate is the data for a VoiceStateUpdate event.
Webhook stores the data for a webhook.
WebhookParams is a struct for webhook params, used in the WebhookExecute command.
WebhooksUpdate is the data for a WebhooksUpdate event.

# Interfaces

No description provided by the author
EventHandler is an interface for Discord events.
EventInterfaceProvider is an interface for providing empty interfaces for Discord events.
GatewayIdentifyRatelimiter is if you need some custom identify ratelimit logic (if you're running shards across processes for example).
No description provided by the author
InteractionData is a common interface for all types of interaction data.
MessageComponent is a base interface for all message components.

# Type aliases

No description provided by the author
ActivityType is the type of presence (see ActivityType* consts) in the Activity struct.
No description provided by the author
ApplicationCommandOptionType indicates the type of a slash command's option.
ApplicationCommandPermissionType indicates whether a permission is user or role based.
ApplicationCommandType represents the type of application command.
AuditLogAction is the Action of the AuditLog (see AuditLogAction* consts) https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events.
AuditLogChangeKey value for AuditLogChange https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-key.
AuditLogOptionsType of the AuditLogOption https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info.
the thread will stop showing in the channel list after auto_archive_duration minutes of inactivity, can be set to: 60, 1440, 4320, 10080.
AutoModerationActionType represents an action which will execute whenever a rule is triggered.
AutoModerationKeywordPreset represents an internally pre-defined wordset.
AutoModerationRuleEventType indicates in what event context a rule should be checked.
AutoModerationRuleTriggerType represents the type of content which can trigger the rule.
ButtonStyle is style of button.
ChannelFlags is the flags of "channel" (see ChannelFlags* consts) https://discord.com/developers/docs/resources/channel#message-object-message-flags.
ChannelType is the type of a Channel.
ComponentType is type of component.
No description provided by the author
Discord is super inconsistent with with types in some places (especially presence updates, might aswell change them to map[string]interface{} soon because there is 0 validation).
No description provided by the author
ExplicitContentFilterLevel type definition.
ForumLayout represents layout of a forum channel.
ForumSortOrderType represents sort order of a forum channel.
No description provided by the author
GatewayOP represents a gateway operation see https://discordapp.com/developers/docs/topics/gateway#gateway-opcodespayloads-gateway-opcodes.
No description provided by the author
IDSlice Is a slice of snowflake id's that properly marshals and unmarshals the way discord expects them to They unmarshal from string arrays and marshals back to string arrays.
InteractionResponseType is type of interaction response.
InteractionType indicates the type of an interaction event.
Locale represents the accepted languages for Discord.
MemberFlags represent flags of a guild member.
MessageFlags is the flags of "message" (see MessageFlags* consts) https://discord.com/developers/docs/resources/channel#message-object-message-flags.
MessageType is the type of Message.
MfaLevel type definition.
A NullableID is a nullable snowflake ID that represents null as the value 0.
No description provided by the author
PresencesReplace is the data for a PresencesReplace event.
Roles are a collection of Role.
SelectMenuDefaultValueType represents the type of an entity selected by default in auto-populated select menus.
SelectMenuType represents select menu type.
Status type definition.
TextInputStyle is style of text in TextInput component.
Timestamp stores a timestamp, as sent by the Discord API.
UserSettingsUpdate is the data for a UserSettingsUpdate event.
VerificationLevel type definition.
VoiceSpeakingUpdateHandler type provides a function definition for the VoiceSpeakingUpdate event.