mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Added a feature to shill the ad-free re-stream when a Twitch commercial break is detected
This commit is contained in:
@@ -148,6 +148,7 @@ public class BotServices
|
||||
}
|
||||
_twitch = new Twitch([settings[BuiltIn.Keys.TwitchBossmanJackId].ToType<int>()], settings[BuiltIn.Keys.Proxy].Value, _cancellationToken);
|
||||
_twitch.OnStreamStateUpdated += OnTwitchStreamStateUpdated;
|
||||
_twitch.OnStreamCommercial += OnTwitchStreamCommercial;
|
||||
await _twitch.StartWsClient();
|
||||
_logger.Info("Built Twitch Websocket connection for livestream notifications");
|
||||
}
|
||||
@@ -555,6 +556,22 @@ public class BotServices
|
||||
IsBmjLive = false;
|
||||
}
|
||||
|
||||
private void OnTwitchStreamCommercial(object sender, int channelId, int length, bool scheduled)
|
||||
{
|
||||
var settings = Helpers
|
||||
.GetMultipleValues([BuiltIn.Keys.TwitchShillRestreamOnCommercial, BuiltIn.Keys.RestreamUrl]).Result;
|
||||
if (!settings[BuiltIn.Keys.TwitchShillRestreamOnCommercial].ToBoolean())
|
||||
{
|
||||
_logger.Debug("Not shilling as it's disabled");
|
||||
return;
|
||||
}
|
||||
|
||||
_chatBot.SendChatMessage(
|
||||
$"Did you just get a {length} second ad on Twitch? The Kasino Kasino encourages Total Advertiser Death.[br]" +
|
||||
$"Bossman streams are being re-streamed in low latency, ad-free form thanks to @Kees H. Do not watch ads.[br]{settings[BuiltIn.Keys.RestreamUrl].Value}",
|
||||
true);
|
||||
}
|
||||
|
||||
private void OnChipsggRecentBet(object sender, ChipsggBetModel bet)
|
||||
{
|
||||
var settings = Helpers
|
||||
|
||||
Reference in New Issue
Block a user