From ee893cbea3ae68d8b9878ee1f4ae46db939d7a16 Mon Sep 17 00:00:00 2001 From: lyx0 <66651385+lyx0@users.noreply.github.com> Date: Wed, 4 Jan 2023 15:24:40 +0100 Subject: [PATCH] clean up --- cmd/bot/main.go | 4 +++- cmd/bot/timer.go | 9 +++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cmd/bot/main.go b/cmd/bot/main.go index 397bb66..4c9d213 100644 --- a/cmd/bot/main.go +++ b/cmd/bot/main.go @@ -22,7 +22,6 @@ type config struct { twitchOauth string twitchClientId string twitchClientSecret string - twitchAccessToken string commandPrefix string environment string db struct { @@ -92,6 +91,9 @@ func main() { "err", err, ) } + sugar.Infow("Got new helix AppAccessToken", + "helixClient", helixResp, + ) // Set the access token on the client helixClient.SetAppAccessToken(helixResp.Data.AccessToken) diff --git a/cmd/bot/timer.go b/cmd/bot/timer.go index 7aeaeca..d14ab45 100644 --- a/cmd/bot/timer.go +++ b/cmd/bot/timer.go @@ -82,7 +82,7 @@ func (app *Application) AddTimer(name string, message twitch.PrivateMessage) { "timer", timer, "error", err, ) - reply := fmt.Sprintf("Something went wrong FeelsBadMan received wrong time format. Allowed formats: 30m, 10h, 10h30m") + reply := "Something went wrong FeelsBadMan received wrong time format. Allowed formats: 30m, 10h, 10h30m" common.Send(message.Channel, reply, app.TwitchClient) return } @@ -98,7 +98,7 @@ func (app *Application) EditTimer(name string, message twitch.PrivateMessage) { "timer", old, "error", err, ) - reply := fmt.Sprintf("Something went wrong FeelsBadMan") + reply := "Something went wrong FeelsBadMan" common.Send(message.Channel, reply, app.TwitchClient) return } @@ -198,7 +198,7 @@ func (app *Application) EditTimer(name string, message twitch.PrivateMessage) { "timer", timer, "error", err, ) - reply := fmt.Sprintf("Something went wrong FeelsBadMan received wrong time format. Allowed formats: 30s, 30m, 10h, 10h30m") + reply := "Something went wrong FeelsBadMan received wrong time format. Allowed formats: 30s, 30m, 10h, 10h30m" common.Send(message.Channel, reply, app.TwitchClient) return } @@ -241,14 +241,12 @@ func (app *Application) InitialTimers() { app.Logger.Infow("Initial timers", "timer", ts, ) - return } // newPrivateMessageTimer is a helper function to set timers // which trigger into sending a twitch PrivateMessage. func (app *Application) newPrivateMessageTimer(channel, text string) { common.Send(channel, text, app.TwitchClient) - return } // DeleteTimer takes in the name of a timer and tries to delete the timer from the database. @@ -277,5 +275,4 @@ func (app *Application) DeleteTimer(name string, message twitch.PrivateMessage) reply := fmt.Sprintf("Deleted timer with name %s", name) common.Send(message.Channel, reply, app.TwitchClient) - return }