diff --git a/discord.go b/discord.go index 19d80a411..0fe4b829a 100644 --- a/discord.go +++ b/discord.go @@ -1,12 +1,12 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo +// disgoself - Discord bindings for Go +// Available at https://github.com/MehulKhanna/disgoself // Copyright 2015-2016 Bruce Marriner . All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains high level helper functions and easy entry points for the -// entire discordgo package. These functions are being developed and are very +// entire disgoself package. These functions are being developed and are very // experimental at this point. They will most likely change so please use the // low level functions if that's a problem. @@ -21,7 +21,7 @@ import ( "github.com/gorilla/websocket" ) -// VERSION of DiscordGo, follows Semantic Versioning. (http://semver.org/) +// VERSION of disgoself, follows Semantic Versioning. (http://semver.org/) const VERSION = "0.27.1" // New creates a new Discord session with provided token. @@ -48,7 +48,7 @@ func New(token string) (s *Session, err error) { MaxRestRetries: 3, Client: &http.Client{Timeout: (20 * time.Second)}, Dialer: websocket.DefaultDialer, - UserAgent: "DiscordBot (https://github.com/bwmarrin/discordgo, v" + VERSION + ")", + UserAgent: "DiscordBot (https://github.com/MehulKhanna/disgoself, v" + VERSION + ")", sequence: new(int64), LastHeartbeatAck: time.Now().UTC(), } @@ -58,7 +58,7 @@ func New(token string) (s *Session, err error) { s.Identify.Compress = true s.Identify.LargeThreshold = 250 s.Identify.Properties.OS = runtime.GOOS - s.Identify.Properties.Browser = "DiscordGo v" + VERSION + s.Identify.Properties.Browser = "disgoself v" + VERSION s.Identify.Intents = IntentsAllWithoutPrivileged s.Identify.Token = token s.Token = token diff --git a/discord_test.go b/discord_test.go index d4c83059a..97e7e1fd6 100644 --- a/discord_test.go +++ b/discord_test.go @@ -12,8 +12,8 @@ import ( // //////////////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////// VARS NEEDED FOR TESTING var ( - dg *Session // Stores a global discordgo user session - dgBot *Session // Stores a global discordgo bot session + dg *Session // Stores a global disgoself user session + dgBot *Session // Stores a global disgoself bot session envOAuth2Token = os.Getenv("DG_OAUTH2_TOKEN") // Token to use when authenticating using OAuth2 token envBotToken = os.Getenv("DGB_TOKEN") // Token to use when authenticating the bot account diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md deleted file mode 100644 index 481991cf7..000000000 --- a/docs/GettingStarted.md +++ /dev/null @@ -1,81 +0,0 @@ -# Getting Started - -This page is dedicated to helping you get started on your way to making the -next great Discord bot or client with DiscordGo. Once you've done that please -don't forget to submit it to the -[Awesome DiscordGo](https://github.com/bwmarrin/discordgo/wiki/Awesome-DiscordGo) list :). - - -**First, lets cover a few topics so you can make the best choices on how to -move forward from here.** - -#### Bot Application -A bot application is a special program that interacts with the Discord servers -to perform some form of automation or provide some type of service. Examples -are things like number trivia games, music streaming, channel moderation, -sending reminders, playing loud airhorn sounds, comic generators, YouTube -integration, Twitch integration... You're *almost* only limited by your imagination. - -Bot applications require the use of a special Bot account. These accounts are -tied to your personal user account. Bot accounts cannot login with the normal -user clients and they cannot join servers the same way a user does. They do not -have access to some user client specific features however they gain access to -many Bot specific features. - -To create a new bot account first create yourself a normal user account on -Discord then visit the [My Applications](https://discord.com/developers/applications/me) -page and click on the **New Application** box. Follow the prompts from there -to finish creating your account. - - -**More information about Bot vs Client accounts can be found [here](https://discord.com/developers/docs/topics/oauth2#bot-vs-user-accounts).** - -# Requirements - -DiscordGo requires Go version 1.4 or higher. It has been tested to compile and -run successfully on Debian Linux 8, FreeBSD 10, and Windows 7. It is expected -that it should work anywhere Go 1.4 or higher works. If you run into problems -please let us know :). - -You must already have a working Go environment setup to use DiscordGo. If you -are new to Go and have not yet installed and tested it on your computer then -please visit [this page](https://golang.org/doc/install) first then I highly -recommend you walk though [A Tour of Go](https://tour.golang.org/welcome/1) to -help get your familiar with the Go language. Also checkout the relevant Go plugin -for your editor — they are hugely helpful when developing Go code. - -* Vim — [vim-go](https://github.com/fatih/vim-go) -* Sublime — [GoSublime](https://github.com/DisposaBoy/GoSublime) -* Atom — [go-plus](https://atom.io/packages/go-plus) -* Visual Studio — [vscode-go](https://github.com/Microsoft/vscode-go) - - -# Install DiscordGo - -Like any other Go package the fist step is to `go get` the package. This will -always pull the latest tagged release from the master branch. Then run -`go install` to compile and install the libraries on your system. - -#### Linux/BSD - -Run go get to download the package to your GOPATH/src folder. - -```sh -go get github.com/bwmarrin/discordgo -``` - -Finally, compile and install the package into the GOPATH/pkg folder. This isn't -absolutely required but doing this will allow the Go plugin for your editor to -provide autocomplete for all DiscordGo functions. - -```sh -cd $GOPATH/src/github.com/bwmarrin/discordgo -go install -``` - -#### Windows -Placeholder. - - -# Next... -More coming soon. diff --git a/docs/img/discordgo.svg b/docs/img/discordgo.svg deleted file mode 100644 index 059ae7ab7..000000000 --- a/docs/img/discordgo.svg +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index c63dffdfe..000000000 --- a/docs/index.md +++ /dev/null @@ -1,33 +0,0 @@ -## DiscordGo -
- - -[Go](https://golang.org/) (Golang) interface for the [Discord](https://discord.com/) -chat service. Provides both low-level direct bindings to the -Discord API and helper functions that allow you to make custom clients and chat -bot applications easily. - -[Discord](https://discord.com/) is an all-in-one voice and text chat for -gamers that's free, secure, and works on both your desktop and phone. - -### Why DiscordGo? -* High Performance -* Minimal Memory & CPU Load -* Low-level bindings to Discord REST API Endpoints -* Support for the data websocket interface -* Multi-Server voice connections (send and receive) -* State tracking and caching - -### Learn More -* Check out the [Getting Started](GettingStarted.md) section -* Read the reference docs on [Godoc](https://godoc.org/github.com/bwmarrin/discordgo) or [GoWalker](https://gowalker.org/github.com/bwmarrin/discordgo) -* Try the [examples](https://github.com/bwmarrin/discordgo/tree/master/examples) -* Explore [Awesome DiscordGo](https://github.com/bwmarrin/discordgo/wiki/Awesome-DiscordGo) - -### Join Us! -Both of the below links take you to chat channels where you can get more -information and support for DiscordGo. There's also a chance to make some -friends :). - -* Join the [Discord Gophers](https://discord.gg/0f1SbxBZjYoCtNPP) chat server dedicated to Go programming. -* Join the [Discord API](https://discord.com/invite/discord-API) chat server dedicated to the Discord API. diff --git a/endpoints.go b/endpoints.go index 29693625e..e7773df6f 100644 --- a/endpoints.go +++ b/endpoints.go @@ -1,12 +1,12 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo +// disgoself - Discord bindings for Go +// Available at https://github.com/MehulKhanna/disgoself // Copyright 2015-2016 Bruce Marriner . All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains variables for all known Discord end points. All functions -// throughout the Discordgo package use these variables for all connections +// throughout the disgoself package use these variables for all connections // to Discord. These are all exported and you may modify them if needed. package disgoself diff --git a/event.go b/event.go index c208424b4..27f6c9449 100644 --- a/event.go +++ b/event.go @@ -41,7 +41,7 @@ func (eh interfaceEventHandler) Handle(s *Session, i interface{}) { var registeredInterfaceProviders = map[string]EventInterfaceProvider{} -// registerInterfaceProvider registers a provider so that DiscordGo can +// registerInterfaceProvider registers a provider so that disgoself can // access it's New() method. func registerInterfaceProvider(eh EventInterfaceProvider) { if _, ok := registeredInterfaceProviders[eh.Type()]; ok { @@ -103,12 +103,12 @@ func (s *Session) addEventHandlerOnce(eventHandler EventHandler) func() { // // eg: // -// Session.AddHandler(func(s *discordgo.Session, m *discordgo.MessageCreate) { +// Session.AddHandler(func(s *disgoself.Session, m *disgoself.MessageCreate) { // }) // // or: // -// Session.AddHandler(func(s *discordgo.Session, m *discordgo.PresenceUpdate) { +// Session.AddHandler(func(s *disgoself.Session, m *disgoself.PresenceUpdate) { // }) // // List of events can be found at this page, with corresponding names in the diff --git a/eventhandlers.go b/eventhandlers.go index 7f4a65fde..5990df564 100644 --- a/eventhandlers.go +++ b/eventhandlers.go @@ -5,7 +5,7 @@ package disgoself // Following are all the event types. // Event type values are used to match the events returned by Discord. -// EventTypes surrounded by __ are synthetic and are internal to DiscordGo. +// EventTypes surrounded by __ are synthetic and are internal to disgoself. const ( applicationCommandPermissionsUpdateEventType = "APPLICATION_COMMAND_PERMISSIONS_UPDATE" autoModerationActionExecutionEventType = "AUTO_MODERATION_ACTION_EXECUTION" diff --git a/logging.go b/logging.go index 5afe1684e..5d44f43f7 100644 --- a/logging.go +++ b/logging.go @@ -1,11 +1,11 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo +// disgoself - Discord bindings for Go +// Available at https://github.com/Mehulkhanna/disgoself // Copyright 2015-2016 Bruce Marriner . All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// This file contains code related to discordgo package logging +// This file contains code related to disgoself package logging package disgoself @@ -34,10 +34,10 @@ const ( LogDebug ) -// Logger can be used to replace the standard logging for discordgo +// Logger can be used to replace the standard logging for disgoself var Logger func(msgL, caller int, format string, a ...interface{}) -// msglog provides package wide logging consistency for discordgo +// msglog provides package wide logging consistency for disgoself // the format, a... portion this command follows that of fmt.Printf // // msgL : LogLevel of the message diff --git a/message.go b/message.go index ede66aa10..6cad20a70 100644 --- a/message.go +++ b/message.go @@ -1,5 +1,5 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo +// disgoself - Discord bindings for Go +// Available at https://github.com/MehulKhanna/disgoself // Copyright 2015-2016 Bruce Marriner . All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/oauth2.go b/oauth2.go index 9f8c6a225..9ba352b50 100644 --- a/oauth2.go +++ b/oauth2.go @@ -1,5 +1,5 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo +// disgoself - Discord bindings for Go +// Available at https://github.com/MehulKhanna/disgoself // Copyright 2015-2016 Bruce Marriner . All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/restapi.go b/restapi.go index f753185b9..ff28e3e2c 100644 --- a/restapi.go +++ b/restapi.go @@ -1,5 +1,5 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo +// disgoself - Discord bindings for Go +// Available at https://github.com/MehulKhanna/disgoself // Copyright 2015-2016 Bruce Marriner . All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/state.go b/state.go index abb3728a1..498422c71 100644 --- a/state.go +++ b/state.go @@ -1,5 +1,5 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo +// disgoself - Discord bindings for Go +// Available at https://github.com/MehulKhanna/disgoself // Copyright 2015-2016 Bruce Marriner . All rights reserved. // Use of this source code is governed by a BSD-style @@ -19,7 +19,7 @@ import ( ) // ErrNilState is returned when the state is nil. -var ErrNilState = errors.New("state not instantiated, please use discordgo.New() or assign Session.State") +var ErrNilState = errors.New("state not instantiated, please use disgoself.New() or assign Session.State") // ErrStateNotFound is returned when the state cache // requested is not found @@ -176,7 +176,7 @@ func (s *State) GuildRemove(guild *Guild) error { // Guild gets a guild by ID. // Useful for querying if @me is in a guild: // -// _, err := discordgo.Session.State.Guild(guildID) +// _, err := disgoself.Session.State.Guild(guildID) // isInGuild := err == nil func (s *State) Guild(guildID string) (*Guild, error) { if s == nil { diff --git a/structs.go b/structs.go index 9ba422030..e1fd4ef7f 100644 --- a/structs.go +++ b/structs.go @@ -1,11 +1,11 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo +// disgoself - Discord bindings for Go +// Available at https://github.com/MehulKhanna/disgoself // Copyright 2015-2016 Bruce Marriner . All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// This file contains all structures for the discordgo package. These +// This file contains all structures for the disgoself package. These // may be moved about later into separate files but I find it easier to have // them all located together. diff --git a/structs_test.go b/structs_test.go index f845caa6b..1335fefb0 100644 --- a/structs_test.go +++ b/structs_test.go @@ -1,5 +1,5 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo +// disgoself - Discord bindings for Go +// Available at https://github.com/MehulKhanna/disgoself // Copyright 2015-2016 Bruce Marriner . All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/voice.go b/voice.go index 919f3a7e0..30cbf33b6 100644 --- a/voice.go +++ b/voice.go @@ -1,11 +1,11 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo +// disgoself - Discord bindings for Go +// Available at https://github.com/MehulKhanna/disgoself // Copyright 2015-2016 Bruce Marriner . All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// This file contains code related to Discord voice suppport +// This file contains code related to Discord voice support package disgoself diff --git a/wsapi.go b/wsapi.go index 775edfb9e..b155c79b0 100644 --- a/wsapi.go +++ b/wsapi.go @@ -1,5 +1,5 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo +// disgoself - Discord bindings for Go +// Available at https://github.com/MehulKhanna/disgoself // Copyright 2015-2016 Bruce Marriner . All rights reserved. // Use of this source code is governed by a BSD-style @@ -409,9 +409,9 @@ func (s *Session) UpdateCustomStatus(state string) (err error) { return s.UpdateStatusComplex(data) } -// UpdateStatusComplex allows for sending the raw status update data untouched by discordgo. +// UpdateStatusComplex allows for sending the raw status update data untouched by disgoself. func (s *Session) UpdateStatusComplex(usd UpdateStatusData) (err error) { - // The comment does say "untouched by discordgo", but we might need to lie a bit here. + // The comment does say "untouched by disgoself", but we might need to lie a bit here. // The Discord documentation lists `activities` as being nullable, but in practice this // doesn't seem to be the case. I had filed an issue about this at // https://github.com/discord/discord-api-docs/issues/2559, but as of writing this