Categorygithub.com/tsdtsdtsd/discordgo
modulepackage
0.15.0
Repository: https://github.com/tsdtsdtsd/discordgo.git
Documentation: pkg.go.dev

# README

DiscordGo ==== [![GoDoc](https://godoc.org/github.com/bwmarrin/discordgo?status.svg)](https://godoc.org/github.com/bwmarrin/discordgo) [![Go report](http://goreportcard.com/badge/bwmarrin/discordgo)](http://goreportcard.com/report/bwmarrin/discordgo) [![Build Status](https://travis-ci.org/bwmarrin/discordgo.svg?branch=master)](https://travis-ci.org/bwmarrin/discordgo) [![Discord Gophers](https://img.shields.io/badge/Discord%20Gophers-%23discordgo-blue.svg)](https://discord.gg/0f1SbxBZjYoCtNPP) [![Discord API](https://img.shields.io/badge/Discord%20API-%23go_discordgo-blue.svg)](https://discord.gg/0SBTUU1wZTWT6sqd)

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 JSON-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 to extend DiscordGo with additional voice helper functions and features.

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

Join Discord Gophers Discord chat channel for support.

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 then 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 then use master

Installing

DiscordGo has been tested to compile on Debian 8 (Go 1.3.3), FreeBSD 10 (Go 1.5.1), and Windows 7 (Go 1.5.2).

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("username", "password")

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 functions, constants, and structures.

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.

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
No description provided by the author

# Functions

New creates a new Discord session and will automate some startup tasks if given enough information to do so.
NewRatelimiter returns a new RateLimiter.
NewState creates an empty state.

# Constants

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 returend to a calling function.
Constants for the different bit offsets of general permissions.
Constants for the different bit offsets of general permissions.
Constants for the different bit offsets of general permissions.
Constants for the different bit offsets of general permissions.
Constants for the different bit offsets of general permissions.
Constants for the different bit offsets of text channel permissions.
Constants for the different bit offsets of general permissions.
Constants for general management.
Constants for the different bit offsets of general permissions.
Constants for the different bit offsets of text channel permissions.
Constants for the different bit offsets of general permissions.
Constants for the different bit offsets of general permissions.
Constants for general management.
Constants for the different bit offsets of text channel permissions.
Constants for general management.
Constants for general management.
Constants for the different bit offsets of general permissions.
Constants for general management.
Constants for the different bit offsets of text channel permissions.
Constants for the different bit offsets of text channel permissions.
Constants for the different bit offsets of text channel permissions.
Constants for the different bit offsets of text channel permissions.
Constants for the different bit offsets of text channel permissions.
Constants for the different bit offsets of text channel permissions.
Constants for the different bit offsets of voice permissions.
Constants for the different bit offsets of voice permissions.
Constants for the different bit offsets of voice permissions.
Constants for the different bit offsets of voice permissions.
Constants for the different bit offsets of voice permissions.
Constants for the different bit offsets of voice permissions.
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.
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 Symantic Versioning.

# Variables

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.
ErrJSONUnmarshal is returned for JSON Unmarshall errors.
ErrNilState is returned when the state is nil.

# Structs

An Ack is used to ack messages.
An APIErrorMessage is an api error message returned from discord.
An Application struct stores values for a Discord OAuth2 Application.
Bucket represents a ratelimit bucket, each bucket gets ratelimited individually (-global ratelimits).
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.
ChannelPinsUpdate stores data for a ChannelPinsUpdate event.
ChannelUpdate is the data for a ChannelUpdate event.
Connect is the data for a Connect event.
Disconnect is the data for a Disconnect event.
Emoji struct holds data related to Emoji's.
Event provides a basic initial struct for all websocket events.
FriendSourceFlags stores ..
A Game struct holds the name of the "playing .." game for a user.
A Guild holds all data related to a specific Discord Guild.
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.
A GuildIntegration stores data for a guild integration.
A GuildIntegrationAccount stores data for a guild integration account.
GuildIntegrationsUpdate is the data for a GuildIntegrationsUpdate event.
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.
GuildUpdate is the data for a GuildUpdate event.
A ICEServer stores data for a specific voice ICE server.
A Invite stores all data related to a specific Discord Guild or Channel invite.
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 MessageAttachment stores data for message attachments.
MessageCreate is the data for a MessageCreate event.
MessageDelete is the data for a MessageDelete event.
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.
MessageReaction stores the data for a message reaction.
MessageReactionAdd is the data for a MessageReactionAdd event.
MessageReactionRemove is the data for a MessageReactionRemove event.
MessageReactions holds a reactions object for a message.
MessageUpdate is the data for a MessageUpdate event.
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.
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.
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.
A Session represents a connection to the Discord API.
A Settings stores data for a specific users Discord client settings.
A State contains the current known state.
A TooManyRequests struct holds information received from Discord when receiving a HTTP 429 response.
TypingStart is the data for a TypingStart event.
A User stores all data for an individual Discord user.
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.
UserUpdate is the data for a UserUpdate event.
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.

# Interfaces

EventHandler is an interface for Discord events.
EventInterfaceProvider is an interface for providing empty interfaces for Discord events.

# Type aliases

PresencesReplace is the data for a PresencesReplace event.
Status type defination.
Timestamp stores a timestamp, as sent by the Discord API.
UserSettingsUpdate is the data for a UserSettingsUpdate event.
VerificationLevel type defination.
VoiceSpeakingUpdateHandler type provides a function defination for the VoiceSpeakingUpdate event.