diff --git a/cmd/vcbot/event/event.go b/cmd/vcbot/event/event.go index 1dcc31e..9c7f7c3 100644 --- a/cmd/vcbot/event/event.go +++ b/cmd/vcbot/event/event.go @@ -8,7 +8,7 @@ import ( ) func JoinEvent(event *events.GuildVoiceJoin) { - log.Printf("DEBUG: JoinEvent") + log.Println("DEBUG: JoinEvent") channelId := *event.VoiceState.ChannelID channel, _ := event.Client().Rest().GetChannel(channelId) channelName := channel.Name() @@ -27,7 +27,7 @@ func MoveEvent(event *events.GuildVoiceMove) { // no that's not a move event return } - log.Printf("DEBUG: MoveEvent") + log.Println("DEBUG: MoveEvent") channelOldId := *event.OldVoiceState.ChannelID channelOld, _ := event.Client().Rest().GetChannel(channelOldId) channelOldName := channelOld.Name() @@ -45,9 +45,9 @@ func MoveEvent(event *events.GuildVoiceMove) { } func LeaveEvent(event *events.GuildVoiceLeave) { - log.Printf("DEBUG: LeaveEvent") + log.Println("DEBUG: LeaveEvent") if event.OldVoiceState.ChannelID == nil { - log.Printf("ERROR: OldVoiceState.ChannelID missing") + log.Println("ERROR: OldVoiceState.ChannelID missing") return } channelOldId := *event.OldVoiceState.ChannelID diff --git a/cmd/vcbot/main.go b/cmd/vcbot/main.go index 4b3f9f1..cc97133 100644 --- a/cmd/vcbot/main.go +++ b/cmd/vcbot/main.go @@ -5,7 +5,9 @@ import ( "github.com/disgoorg/disgo" "github.com/disgoorg/disgo/bot" "github.com/disgoorg/disgo/cache" + "github.com/disgoorg/disgo/events" "github.com/disgoorg/disgo/gateway" + disgolog "github.com/disgoorg/log" "github.com/getsentry/sentry-go" "grow.rievo.dev/discordBots/cmd/vcbot/config" "grow.rievo.dev/discordBots/cmd/vcbot/event" @@ -21,6 +23,7 @@ var release string func main() { + disgolog.SetLevel(disgolog.LevelDebug) err := sentry.Init(sentry.ClientOptions{ // Either set your DSN here or set the SENTRY_DSN environment variable. //Dsn: "", @@ -62,6 +65,12 @@ func main() { bot.WithEventListenerFunc(event.JoinEvent), bot.WithEventListenerFunc(event.MoveEvent), bot.WithEventListenerFunc(event.LeaveEvent), + bot.WithEventListenerFunc(func(event *events.Ready) { + log.Println("DEBUG: Connection Ready") + }), + bot.WithEventListenerFunc(func(event *events.Resumed) { + log.Println("DEBUG: Connection Resumed") + }), ) if err != nil { log.Fatal("error while building vcbot instance: ", err)