Updated copyright year, cleaned up some comments.
This commit is contained in:
parent
d737b91b77
commit
301fb980d3
8 changed files with 26 additions and 48 deletions
43
discord.go
43
discord.go
|
@ -1,7 +1,7 @@
|
||||||
// Discordgo - Discord bindings for Go
|
// Discordgo - Discord bindings for Go
|
||||||
// Available at https://github.com/bwmarrin/discordgo
|
// Available at https://github.com/bwmarrin/discordgo
|
||||||
|
|
||||||
// Copyright 2015 Bruce Marriner <bruce@sqls.net>. All rights reserved.
|
// Copyright 2015-2016 Bruce Marriner <bruce@sqls.net>. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
@ -15,45 +15,10 @@ package discordgo
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
// DiscordGo Version, follows Symantic Versioning. (http://semver.org/)
|
// Discordgo Version, follows Symantic Versioning. (http://semver.org/)
|
||||||
const VERSION = "0.9.0-alpha"
|
const VERSION = "0.9.0-alpha"
|
||||||
|
|
||||||
/*
|
// New creates a new Discord session and will automate some startup
|
||||||
type Config struct {
|
|
||||||
Debug bool
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
// possible future main struct for discord connection
|
|
||||||
type Discord struct {
|
|
||||||
Debug bool // Set to true to enable debug logging
|
|
||||||
Token string // authentication token
|
|
||||||
User User // authenticated user info
|
|
||||||
Guilds []Guild // Cached Guild info
|
|
||||||
Channels []Channel // Cached Channel info
|
|
||||||
API api // all api endpoint functions
|
|
||||||
DataWS dataWS // data websocket connection
|
|
||||||
VoiceWS voiceWS // voice websocket/udp connections
|
|
||||||
VoiceUDP voiceUDP
|
|
||||||
}
|
|
||||||
|
|
||||||
type api struct {
|
|
||||||
Session
|
|
||||||
}
|
|
||||||
type dataWS struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
type voiceWS struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
type voiceUDP struct {
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
// NOTICE: This function should be considered unstable because I am still
|
|
||||||
// exploring the best way to implement my goals here. So, it is more likely
|
|
||||||
// to change than than the low level API functions.
|
|
||||||
//
|
|
||||||
// New creates a new Discord session interface and will automate some startup
|
|
||||||
// tasks if given enough information to do so. Currently you can pass zero
|
// tasks if given enough information to do so. Currently you can pass zero
|
||||||
// arguments and it will return an empty Discord session. If you pass a token
|
// arguments and it will return an empty Discord session. If you pass a token
|
||||||
// or username and password (in that order), then it will attempt to login to
|
// or username and password (in that order), then it will attempt to login to
|
||||||
|
@ -72,7 +37,7 @@ func New(args ...interface{}) (s *Session, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Varibles used below when parsing func arguments
|
// Variables used below when parsing func arguments
|
||||||
var auth, pass string
|
var auth, pass string
|
||||||
|
|
||||||
// Parse passed arguments
|
// Parse passed arguments
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
// Discordgo - Discord bindings for Go
|
// Discordgo - Discord bindings for Go
|
||||||
// Available at https://github.com/bwmarrin/discordgo
|
// Available at https://github.com/bwmarrin/discordgo
|
||||||
|
|
||||||
// Copyright 2015 Bruce Marriner <bruce@sqls.net>. All rights reserved.
|
// Copyright 2015-2016 Bruce Marriner <bruce@sqls.net>. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// This file contains variables for all known Discord end points. All functions
|
// This file contains variables for all known Discord end points. All functions
|
||||||
// throughout the discordgo package use these variables for all connections
|
// throughout the Discordgo package use these variables for all connections
|
||||||
// to Discord. These are all exported and you may modify them if needed.
|
// to Discord. These are all exported and you may modify them if needed.
|
||||||
|
|
||||||
package discordgo
|
package discordgo
|
||||||
|
@ -79,6 +79,6 @@ var (
|
||||||
INVITE = func(iID string) string { return API + "invite/" + iID }
|
INVITE = func(iID string) string { return API + "invite/" + iID }
|
||||||
|
|
||||||
INTEGRATIONS_JOIN = func(iID string) string { return API + "integrations/" + iID + "/join" }
|
INTEGRATIONS_JOIN = func(iID string) string { return API + "integrations/" + iID + "/join" }
|
||||||
|
|
||||||
EMOJI = func(eID string) string { return API + "emojis/" + eID + ".png" }
|
EMOJI = func(eID string) string { return API + "emojis/" + eID + ".png" }
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Discordgo - Discord bindings for Go
|
// Discordgo - Discord bindings for Go
|
||||||
// Available at https://github.com/bwmarrin/discordgo
|
// Available at https://github.com/bwmarrin/discordgo
|
||||||
|
|
||||||
// Copyright 2015 Bruce Marriner <bruce@sqls.net>. All rights reserved.
|
// Copyright 2015-2016 Bruce Marriner <bruce@sqls.net>. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
|
15
state.go
15
state.go
|
@ -1,8 +1,21 @@
|
||||||
|
// Discordgo - Discord bindings for Go
|
||||||
|
// Available at https://github.com/bwmarrin/discordgo
|
||||||
|
|
||||||
|
// Copyright 2015-2016 Bruce Marriner <bruce@sqls.net>. 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 state tracking. If enabled, state
|
||||||
|
// tracking will capture the initial READY packet and many other websocket
|
||||||
|
// events and maintain an in-memory state of of guilds, channels, users, and
|
||||||
|
// so forth. This information can be accessed through the Session.State struct.
|
||||||
|
// This code was contributed by https://github.com/iopred
|
||||||
|
|
||||||
package discordgo
|
package discordgo
|
||||||
|
|
||||||
import "errors"
|
import "errors"
|
||||||
|
|
||||||
var nilError error = errors.New("State not instantiated, please use discordgo.New() or assign session.State.")
|
var nilError error = errors.New("State not instantiated, please use discordgo.New() or assign Session.State.")
|
||||||
|
|
||||||
// NewState creates an empty state.
|
// NewState creates an empty state.
|
||||||
func NewState() *State {
|
func NewState() *State {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Discordgo - Discord bindings for Go
|
// Discordgo - Discord bindings for Go
|
||||||
// Available at https://github.com/bwmarrin/discordgo
|
// Available at https://github.com/bwmarrin/discordgo
|
||||||
|
|
||||||
// Copyright 2015 Bruce Marriner <bruce@sqls.net>. All rights reserved.
|
// Copyright 2015-2016 Bruce Marriner <bruce@sqls.net>. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
|
2
util.go
2
util.go
|
@ -1,7 +1,7 @@
|
||||||
// Discordgo - Discord bindings for Go
|
// Discordgo - Discord bindings for Go
|
||||||
// Available at https://github.com/bwmarrin/discordgo
|
// Available at https://github.com/bwmarrin/discordgo
|
||||||
|
|
||||||
// Copyright 2015 Bruce Marriner <bruce@sqls.net>. All rights reserved.
|
// Copyright 2015-2016 Bruce Marriner <bruce@sqls.net>. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
|
2
voice.go
2
voice.go
|
@ -1,7 +1,7 @@
|
||||||
// Discordgo - Discord bindings for Go
|
// Discordgo - Discord bindings for Go
|
||||||
// Available at https://github.com/bwmarrin/discordgo
|
// Available at https://github.com/bwmarrin/discordgo
|
||||||
|
|
||||||
// Copyright 2015 Bruce Marriner <bruce@sqls.net>. All rights reserved.
|
// Copyright 2015-2016 Bruce Marriner <bruce@sqls.net>. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
|
2
wsapi.go
2
wsapi.go
|
@ -1,7 +1,7 @@
|
||||||
// Discordgo - Discord bindings for Go
|
// Discordgo - Discord bindings for Go
|
||||||
// Available at https://github.com/bwmarrin/discordgo
|
// Available at https://github.com/bwmarrin/discordgo
|
||||||
|
|
||||||
// Copyright 2015 Bruce Marriner <bruce@sqls.net>. All rights reserved.
|
// Copyright 2015-2016 Bruce Marriner <bruce@sqls.net>. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue