<commit_before>/******************************************************************************
 * Discordgo v0 by <NAME> <<EMAIL>>
 * A Discord API for Golang.
 *
 * Currently only the REST API is functional.  I will add on the websocket
 * layer once I get the API section where I want it.
 *
 */

package discordgo

// These will absolutely change.  I already don't like them.
// Constants that define the different Discord API URLs.
const (
	discordUrl = "http://discordapp.com"
	discordApi = discordUrl + "/api/"
	servers    = discordApi + "guilds"
	channels   = discordApi + "channels"
	users      = discordApi + "users"
)

// A Discord structure represents a all-inclusive (hopefully) structure to
// access the Discord REST API for a given authenticated user.
type Discord struct {
	Session Session
	User    User
	Servers []Server
}

// New creates a new connection to Discord and returns a Discord structure.
// This provides an easy entry where most commonly needed information is
// automatically fetched.
func New(email string, password string) (discord *Discord, err error) {

	session := Session{}

	session.Token, err = session.RequestToken(email, password)
	if err != nil {
		return
	}

	user, err := session.Self()
	if err != nil {
		return
	}

	servers, err := session.Servers()

	discord = &Discord{session, user, servers}

	return
}

// Renew essentially reruns the New command without creating a new session.
// This will update all the user, server, and channel information that was
// fetched with the New command.  This is not an efficient way of doing this
// but if used infrequently it does provide convenience.
func (discord Discord) Renew() (err error) {

	discord.User, err = discord.Session.Self()
	discord.Servers, err = discord.Session.Servers()

	return
}<commit_msg>Should have been a pointer, I think :)<commit_after>/******************************************************************************
 * Discordgo v0 by <NAME> <<EMAIL>>
 * A Discord API for Golang.
 *
 * Currently only the REST API is functional.  I will add on the websocket
 * layer once I get the API section where I want it.
 *
 */

package discordgo

// These will absolutely change.  I already don't like them.
// Constants that define the different Discord API URLs.
const (
	discordUrl = "http://discordapp.com"
	discordApi = discordUrl + "/api/"
	servers    = discordApi + "guilds"
	channels   = discordApi + "channels"
	users      = discordApi + "users"
)

// A Discord structure represents a all-inclusive (hopefully) structure to
// access the Discord REST API for a given authenticated user.
type Discord struct {
	Session Session
	User    User
	Servers []Server
}

// New creates a new connection to Discord and returns a Discord structure.
// This provides an easy entry where most commonly needed information is
// automatically fetched.
func New(email string, password string) (discord *Discord, err error) {

	session := Session{}

	session.Token, err = session.RequestToken(email, password)
	if err != nil {
		return
	}

	user, err := session.Self()
	if err != nil {
		return
	}

	servers, err := session.Servers()

	discord = &Discord{session, user, servers}

	return
}

// Renew essentially reruns the New command without creating a new session.
// This will update all the user, server, and channel information that was
// fetched with the New command.  This is not an efficient way of doing this
// but if used infrequently it does provide convenience.
func (discord *Discord) Renew() (err error) {

	discord.User, err = discord.Session.Self()
	discord.Servers, err = discord.Session.Servers()

	return
}
{'fraction_non_alphanumeric': 0.13072255929398788, 'fraction_numerical': 0.0005515719801434088, 'mean_word_length': 3.7976190476190474, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '589372', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1002, 'n_words': 435}