From 0c93259c55dc00308fcee60232c035bbd8ef83a9 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Mon, 4 Feb 2019 22:17:33 -0500 Subject: [PATCH] twitch: configerize the stream word --- plugins/reminder/reminder_test.go | 2 +- plugins/twitch/twitch.go | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/reminder/reminder_test.go b/plugins/reminder/reminder_test.go index c9095d9..d3c6155 100644 --- a/plugins/reminder/reminder_test.go +++ b/plugins/reminder/reminder_test.go @@ -224,7 +224,7 @@ func TestLimitList(t *testing.T) { for i := 0; i < 25; i++ { assert.Contains(t, mb.Messages[3], fmt.Sprintf("%d) tester -> testuser :: don't fail this test", i+1)) } - assert.Contains(t, mb.Messages[3], "...5 more...") + assert.Contains(t, mb.Messages[3], "more...") assert.NotContains(t, mb.Messages[3], "26) tester -> testuser") } diff --git a/plugins/twitch/twitch.go b/plugins/twitch/twitch.go index 6e22f14..9b2c2b7 100644 --- a/plugins/twitch/twitch.go +++ b/plugins/twitch/twitch.go @@ -221,20 +221,21 @@ func (p *TwitchPlugin) checkTwitch(channel string, twitcher *Twitcher, alwaysPri if len(games) > 0 { game = games[0].Title } + streamWord := p.config.Get("Twitch.StreamWord", "streaming") if alwaysPrintStatus { if game == "" { - p.Bot.SendMessage(channel, twitcher.name+" is not streaming.") + p.Bot.SendMessage(channel, fmt.Sprintf("%s is not %s.", twitcher.name, streamWord)) } else { - p.Bot.SendMessage(channel, twitcher.name+" is streaming "+game+" at "+twitcher.URL()) + p.Bot.SendMessage(channel, fmt.Sprintf("%s is %s %s at %s", twitcher.name, streamWord, game, twitcher.URL())) } } else if game == "" { if twitcher.game != "" { - p.Bot.SendMessage(channel, twitcher.name+" just stopped streaming.") + p.Bot.SendMessage(channel, fmt.Sprintf("%s just stopped %s.", twitcher.name, streamWord)) } twitcher.game = "" } else { if twitcher.game != game { - p.Bot.SendMessage(channel, twitcher.name+" just started streaming "+game+" at "+twitcher.URL()) + p.Bot.SendMessage(channel, fmt.Sprintf("%s is %s %s at %s", twitcher.name, streamWord, game, twitcher.URL())) } twitcher.game = game }