Skip to content

Commit 2229662

Browse files
committed
Version 1.9.1. Just improved the display of info when someone goes live.
1 parent bff5498 commit 2229662

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Beef/TwitchManager/TwitchPollingService.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ namespace Beef.TwitchManager {
1717
public class TwitchPollingService : PollingService {
1818
private const String TwitchNameVariable = "{TwitchName}";
1919
private const String StreamLinkVariable = "{StreamLink}";
20-
private const String DefaultGoLiveMessage = "Hey everyone, " + TwitchNameVariable + " is live on Twitch!\n\n" + StreamLinkVariable;
20+
private const String GameVariable = "{Game}";
21+
private const String StreamTitleVariable = "{StreamTitle}";
22+
private const String DefaultGoLiveMessage = "Hey everyone, " + TwitchNameVariable + " is live on Twitch!\n\n**{StreamTitle}**\n{Game}\n" + StreamLinkVariable;
2123
private const String TwitchStreamPrefix = "https://www.twitch.tv/";
2224

2325
private Dictionary<String, StreamInfo> _monitoredStreams; // Maps Twitch Stream Name to StreamInfo
@@ -123,7 +125,9 @@ protected void UpdateLiveStatus(StreamInfo stream, String accessToken) {
123125
// Fill in the variables for the go live message
124126
String goLiveMessage = stream.GoLiveMessage
125127
.Replace(TwitchNameVariable, name)
126-
.Replace(StreamLinkVariable, stream.StreamUrl);
128+
.Replace(StreamLinkVariable, stream.StreamUrl)
129+
.Replace(GameVariable, entry.game_name)
130+
.Replace(StreamTitleVariable, entry.title);
127131
_twitchLiveListener.OnTwitchStreamLive(stream.GetTwitchUsername(), goLiveMessage);
128132
}
129133
}

0 commit comments

Comments
 (0)