Skip to content

Commit

Permalink
fix(ci): run gofmt
Browse files Browse the repository at this point in the history
These are changes from 1.18 to 1.21
  • Loading branch information
Earlopain committed Sep 2, 2023
1 parent 2f8b019 commit 59856a9
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 28 deletions.
7 changes: 5 additions & 2 deletions discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ const VERSION = "0.27.1"

// New creates a new Discord session with provided token.
// If the token is for a bot, it must be prefixed with "Bot "
// e.g. "Bot ..."
//
// e.g. "Bot ..."
//
// Or if it is an OAuth2 token, it must be prefixed with "Bearer "
// e.g. "Bearer ..."
//
// e.g. "Bearer ..."
func New(token string) (s *Session, err error) {

// Create an empty Session interface.
Expand Down
4 changes: 2 additions & 2 deletions discord_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"time"
)

//////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////// VARS NEEDED FOR TESTING
// ////////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////// VARS NEEDED FOR TESTING
var (
dg *Session // Stores a global discordgo user session
dgBot *Session // Stores a global discordgo bot session
Expand Down
10 changes: 6 additions & 4 deletions event.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ func (s *Session) addEventHandlerOnce(eventHandler EventHandler) func() {
// to a struct corresponding to the event for which you want to listen.
//
// eg:
// Session.AddHandler(func(s *discordgo.Session, m *discordgo.MessageCreate) {
// })
//
// Session.AddHandler(func(s *discordgo.Session, m *discordgo.MessageCreate) {
// })
//
// or:
// Session.AddHandler(func(s *discordgo.Session, m *discordgo.PresenceUpdate) {
// })
//
// Session.AddHandler(func(s *discordgo.Session, m *discordgo.PresenceUpdate) {
// })
//
// List of events can be found at this page, with corresponding names in the
// library for each event: https://discord.com/developers/docs/topics/gateway#event-names
Expand Down
9 changes: 5 additions & 4 deletions logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ var Logger func(msgL, caller int, format string, a ...interface{})

// msglog provides package wide logging consistency for discordgo
// the format, a... portion this command follows that of fmt.Printf
// msgL : LogLevel of the message
// caller : 1 + the number of callers away from the message source
// format : Printf style message format
// a ... : comma separated list of values to pass
//
// msgL : LogLevel of the message
// caller : 1 + the number of callers away from the message source
// format : Printf style message format
// a ... : comma separated list of values to pass
func msglog(msgL, caller int, format string, a ...interface{}) {

if Logger != nil {
Expand Down
16 changes: 10 additions & 6 deletions oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ type Team struct {
}

// Application returns an Application structure of a specific Application
// appID : The ID of an Application
//
// appID : The ID of an Application
func (s *Session) Application(appID string) (st *Application, err error) {

body, err := s.RequestWithBucketID("GET", EndpointOAuth2Application(appID), nil, EndpointOAuth2Application(""))
Expand All @@ -66,8 +67,9 @@ func (s *Session) Applications() (st []*Application, err error) {
}

// ApplicationCreate creates a new Application
// name : Name of Application / Bot
// uris : Redirect URIs (Not required)
//
// name : Name of Application / Bot
// uris : Redirect URIs (Not required)
func (s *Session) ApplicationCreate(ap *Application) (st *Application, err error) {

data := struct {
Expand All @@ -85,7 +87,8 @@ func (s *Session) ApplicationCreate(ap *Application) (st *Application, err error
}

// ApplicationUpdate updates an existing Application
// var : desc
//
// var : desc
func (s *Session) ApplicationUpdate(appID string, ap *Application) (st *Application, err error) {

data := struct {
Expand All @@ -103,7 +106,8 @@ func (s *Session) ApplicationUpdate(appID string, ap *Application) (st *Applicat
}

// ApplicationDelete deletes an existing Application
// appID : The ID of an Application
//
// appID : The ID of an Application
func (s *Session) ApplicationDelete(appID string) (err error) {

_, err = s.RequestWithBucketID("DELETE", EndpointOAuth2Application(appID), nil, EndpointOAuth2Application(""))
Expand Down Expand Up @@ -139,7 +143,7 @@ func (s *Session) ApplicationAssets(appID string) (ass []*Asset, err error) {

// ApplicationBotCreate creates an Application Bot Account
//
// appID : The ID of an Application
// appID : The ID of an Application
//
// NOTE: func name may change, if I can think up something better.
func (s *Session) ApplicationBotCreate(appID string) (st *User, err error) {
Expand Down
5 changes: 3 additions & 2 deletions state.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ 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)
// isInGuild := err == nil
//
// _, err := discordgo.Session.State.Guild(guildID)
// isInGuild := err == nil
func (s *State) Guild(guildID string) (*Guild, error) {
if s == nil {
return nil, ErrNilState
Expand Down
16 changes: 8 additions & 8 deletions wsapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -682,10 +682,10 @@ type voiceChannelJoinOp struct {

// ChannelVoiceJoin joins the session user to a voice channel.
//
// gID : Guild ID of the channel to join.
// cID : Channel ID of the channel to join.
// mute : If true, you will be set to muted upon joining.
// deaf : If true, you will be set to deafened upon joining.
// gID : Guild ID of the channel to join.
// cID : Channel ID of the channel to join.
// mute : If true, you will be set to muted upon joining.
// deaf : If true, you will be set to deafened upon joining.
func (s *Session) ChannelVoiceJoin(gID, cID string, mute, deaf bool) (voice *VoiceConnection, err error) {

s.log(LogInformational, "called")
Expand Down Expand Up @@ -729,10 +729,10 @@ func (s *Session) ChannelVoiceJoin(gID, cID string, mute, deaf bool) (voice *Voi
//
// This should only be used when the VoiceServerUpdate will be intercepted and used elsewhere.
//
// gID : Guild ID of the channel to join.
// cID : Channel ID of the channel to join, leave empty to disconnect.
// mute : If true, you will be set to muted upon joining.
// deaf : If true, you will be set to deafened upon joining.
// gID : Guild ID of the channel to join.
// cID : Channel ID of the channel to join, leave empty to disconnect.
// mute : If true, you will be set to muted upon joining.
// deaf : If true, you will be set to deafened upon joining.
func (s *Session) ChannelVoiceJoinManual(gID, cID string, mute, deaf bool) (err error) {

s.log(LogInformational, "called")
Expand Down

0 comments on commit 59856a9

Please sign in to comment.