From cf809a3cdc25e1ff17e06c2918de961871b29583 Mon Sep 17 00:00:00 2001 From: Asaf Gartner Date: Thu, 13 Oct 2022 19:38:46 +0300 Subject: [PATCH] Twitch fixes --- src/discord/streams.go | 2 +- src/twitch/twitch.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/discord/streams.go b/src/discord/streams.go index 9de52568..0cfa0396 100644 --- a/src/discord/streams.go +++ b/src/discord/streams.go @@ -167,7 +167,7 @@ func PostStreamHistory(ctx context.Context, history *models.TwitchStreamHistory) } duration := history.EndedAt.Sub(history.StartedAt).Truncate(time.Minute).String() messageContent := fmt.Sprintf( - "**%s** was live: https://twitch.tv/%s\n> _%s_\nAt For %s%s", + ":o: **%s** was live: https://twitch.tv/%s\n> _%s_\nOn for %s%s", history.TwitchLogin, history.TwitchLogin, history.Title, diff --git a/src/twitch/twitch.go b/src/twitch/twitch.go index 09bd2068..b1589779 100644 --- a/src/twitch/twitch.go +++ b/src/twitch/twitch.go @@ -774,7 +774,7 @@ func fetchLatestStreamStatus(ctx context.Context, conn db.ConnOrTx, twitchID str result = &models.TwitchLatestStatus{ TwitchID: twitchID, TwitchLogin: twitchLogin, - Tags: []string{}, + Tags: make([]string, 0), } } else if err != nil { return nil, oops.New(err, "failed to fetch existing twitch status") @@ -874,6 +874,7 @@ func updateStreamHistory(ctx context.Context, dbConn db.ConnOrTx, status *models if err == db.NotFound { history = &models.TwitchStreamHistory{} + history.Tags = make([]string, 0) history.StreamID = status.StreamID history.TwitchID = status.TwitchID history.TwitchLogin = status.TwitchLogin