Skip to content

Commit

Permalink
Merge pull request #441 from barbequeorbarbecue/use-sane-name
Browse files Browse the repository at this point in the history
refactor(discord-bot): rename StreamName var to GameName for using the same name
  • Loading branch information
senchabot-github authored Feb 18, 2024
2 parents 62649a4 + 5910b8c commit ee08ce0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions apps/discord-bot/internal/service/streamer/streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion packages/gosenchabot/models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down

0 comments on commit ee08ce0

Please sign in to comment.