Merge pull request #140 from velour/screaming

twitch: configerize the stream word
This commit is contained in:
Chris Sexton 2019-02-04 22:21:34 -05:00 committed by GitHub
commit 75d2127396
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -224,7 +224,7 @@ func TestLimitList(t *testing.T) {
for i := 0; i < 25; i++ { 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], 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") assert.NotContains(t, mb.Messages[3], "26) tester -> testuser")
} }

View File

@ -221,20 +221,21 @@ func (p *TwitchPlugin) checkTwitch(channel string, twitcher *Twitcher, alwaysPri
if len(games) > 0 { if len(games) > 0 {
game = games[0].Title game = games[0].Title
} }
streamWord := p.config.Get("Twitch.StreamWord", "streaming")
if alwaysPrintStatus { if alwaysPrintStatus {
if game == "" { 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 { } 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 == "" { } else if game == "" {
if twitcher.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 = "" twitcher.game = ""
} else { } else {
if twitcher.game != game { 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 twitcher.game = game
} }