add go.mod and update to latest discordgo changes
This commit is contained in:
@@ -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
|
||||
)
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user