private async void OnViewCount(object sender, OnViewCountArgs e) { BotChannel bChan = await Program.Channels.GetTwitchChannelByName(_twitchChannelName); if (bChan != null) { if (bChan.viewerCount != e.Viewers) { bChan.viewerCount = e.Viewers; Program.Channels.ChannelSave(bChan); } } }
/// <summary> /// Passes <see cref="OnViewCount"/> events down to subscribed plugins. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">An <see cref="OnViewCountArgs"/> object.</param> private void TwitchPubSub_OnViewCount(object sender, OnViewCountArgs e) => OnViewCount?.Invoke(this, e);
private void PubSub_OnViewCount(object sender, OnViewCountArgs e) { _logger.Information($"Current viewers: {e.Viewers}"); }