(Golang) Go bindings for Discord
Find a file
Carson Hoffman fb996efa76
Merge pull request #838 from qaisjp/webhook-appid
Add ApplicationID to Webhook
2020-11-15 15:02:07 -05:00
docs Remove references to develop branch 2020-07-25 22:09:24 -04:00
examples Add barebones voice receive example 2020-07-21 21:47:59 -04:00
tools/cmd/eventhandlers Remove type checks for handlers, it's done implicitly in the handlerForInterface call. (#305) 2016-12-29 09:58:51 -08:00
.gitignore Add bitwise permission const PermissionViewChannel 2020-04-01 08:04:42 -04:00
.travis.yml Add Go v1.15 in CI (#803) 2020-08-12 10:22:20 -04:00
discord.go Bump version to v0.22.0 2020-07-25 22:18:54 -04:00
discord_test.go Remove tests against email/password. 2017-12-27 20:03:15 +00:00
endpoints.go Add support for news channels 2020-08-05 18:31:38 -04:00
event.go gofmt pass 2020-10-28 21:25:22 -04:00
eventhandlers.go adds support for Webhooks Update event (#561) 2018-08-19 12:43:41 -07:00
events.go Add ChunkIndex and ChunkCount fields to GuildMembersChunk 2020-05-16 11:26:48 -04:00
go.mod Since Go is intent on a Go value being in go.mod 2019-10-18 11:29:55 -05:00
go.sum Add go module support 2018-11-02 11:12:51 -07:00
LICENSE Rename GoDiscord to Discordgo in LICENSE (develop) 2016-05-17 09:45:25 -04:00
logging.go Changed "consistancy" to "consistency" in logging.go 2020-06-08 14:01:37 +02:00
message.go Updates API (#785) 2020-06-28 18:53:46 -04:00
message_test.go Remove redundant line 2018-07-25 12:00:40 +03:00
mkdocs.yml Some website contented added :) 2016-04-26 14:48:06 -05:00
oauth2.go Add team data to applications (#787) 2020-06-28 16:50:55 -04:00
oauth2_test.go fixed small typo in oauth2_test.go 2018-04-21 21:55:51 -04:00
ratelimit.go Linting. 2017-11-08 19:54:04 +00:00
ratelimit_test.go Ratelimits (#273) 2016-11-04 08:07:22 -07:00
README.md Remove references to develop branch 2020-07-25 22:09:24 -04:00
restapi.go Add State helper methods for reading permissions and role colors from Message roles. 2020-10-16 18:09:59 +11:00
restapi_test.go Changed test Nickname, for fun! 2017-11-11 15:08:49 +00:00
state.go Add comments on new methods 2020-10-29 11:42:11 -04:00
structs.go Add ApplicationID to Webhook 2020-11-15 19:40:37 +00:00
types.go Fixed compilation issues 2017-07-23 08:46:05 +02:00
types_test.go Timestamp type; a string with a Parse() function 2016-07-28 21:16:10 +02:00
user.go chore: add missing fields in User struct (#790) 2020-10-24 16:24:31 -04:00
user_test.go add String() method to User (#350) 2017-04-07 08:19:48 -07:00
util.go Adding millisecond precision to SnowflakeTimestamp utility (#732) 2020-06-16 23:43:34 -04:00
util_test.go Adding millisecond precision to SnowflakeTimestamp utility (#732) 2020-06-16 23:43:34 -04:00
voice.go Add lock to prevent race condition (#816) 2020-11-15 14:55:36 -05:00
wsapi.go Fix double commit on merge 2020-06-20 22:51:20 -04:00

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

Installing

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

go get will always pull the latest tagged release from the master branch.

go get github.com/bwmarrin/discordgo

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("Bot " + "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.
  • 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 master 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.