From 5910b8c9e388267766c0d3b144487a8023d620fb Mon Sep 17 00:00:00 2001 From: barbequeorbarbecue <151953193+barbequeorbarbecue@users.noreply.github.com> Date: Sun, 18 Feb 2024 11:58:01 +0300 Subject: [PATCH] refactor(discord-bot): rename StreamName var to GameName for using the same name --- apps/discord-bot/internal/service/streamer/streamer.go | 7 ++++--- packages/gosenchabot/models/models.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/discord-bot/internal/service/streamer/streamer.go b/apps/discord-bot/internal/service/streamer/streamer.go index e7532059..0886ded0 100644 --- a/apps/discord-bot/internal/service/streamer/streamer.go +++ b/apps/discord-bot/internal/service/streamer/streamer.go @@ -319,15 +319,16 @@ func CheckLiveStreams(s *discordgo.Session, ctx context.Context, service service } func FormatContent(str string, sd models.TwitchStreamerData) string { - if sd.StreamGame == "" { - sd.StreamGame = "Just Chatting" + if sd.GameName == "" { + sd.GameName = "Just Chatting" } stringTemplates := map[string]string{ "{twitch.username}": sd.UserName, "{twitch.url}": "https://www.twitch.tv/" + sd.UserLogin, "{stream.title}": sd.Title, - "{stream.category}": sd.StreamGame, + "{stream.category}": sd.GameName, + "{stream.game}": sd.GameName, } for k, v := range stringTemplates { diff --git a/packages/gosenchabot/models/models.go b/packages/gosenchabot/models/models.go index abe6b073..a3f6077f 100644 --- a/packages/gosenchabot/models/models.go +++ b/packages/gosenchabot/models/models.go @@ -105,7 +105,7 @@ type TwitchStreamerData struct { UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` - StreamGame string `json:"game_name"` + GameName string `json:"game_name"` Type string `json:"type"` Title string `json:"title"` Tags []string `json:"tags"`