From b50ef3b543b845048c71aff505e52e8516ce67f3 Mon Sep 17 00:00:00 2001 From: Daniel Aberger Date: Mon, 12 Apr 2021 18:01:21 +0200 Subject: [PATCH] add go.mod and update to latest discordgo changes --- go.mod | 12 ++++++++++++ main.go | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 go.mod diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..b30fa57 --- /dev/null +++ b/go.mod @@ -0,0 +1,12 @@ +module dev.ixab.de/da/gidbig + +go 1.16 + +require ( + github.com/bwmarrin/discordgo v0.23.2 + github.com/dustin/go-humanize v1.0.0 + github.com/gorilla/mux v1.8.0 + github.com/gorilla/sessions v1.2.1 + github.com/sirupsen/logrus v1.8.1 + golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602 +) diff --git a/main.go b/main.go index 8d9541a..89ade8e 100644 --- a/main.go +++ b/main.go @@ -17,9 +17,9 @@ import ( "text/tabwriter" "time" - log "github.com/Sirupsen/logrus" "github.com/bwmarrin/discordgo" humanize "github.com/dustin/go-humanize" + log "github.com/sirupsen/logrus" ) var ( @@ -477,7 +477,7 @@ func setIdleStatus() { } for { discord.UpdateStreamingStatus(1, "", "") - discord.UpdateStatus(0, games[randomRange(0, len(games))]) + discord.UpdateGameStatus(0, games[randomRange(0, len(games))]) time.Sleep(time.Duration(randomRange(5, 15)) * time.Minute) } } @@ -495,7 +495,7 @@ func onMessageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { } // Updating bot status - s.UpdateStatus(0, "Ping Pong with "+m.Author.Username) + s.UpdateGameStatus(0, "Ping Pong with "+m.Author.Username) } if len(m.Content) <= 0 || (m.Content[0] != '!' && len(m.Mentions) < 1) { return