public void OnNext(StreamingMessage value) { TweetReceived?.Invoke(value.Json); // to avoid streaming too much data (try streaming tweets related to Trump lol) Thread.Sleep(_interval); }
private void OnMatchingTweetReceived(object sender, Tweetinvi.Events.MatchedTweetReceivedEventArgs e) { logger.LogInformation($"OnMatchingTweetReceived Twitter message received. {JsonConvert.SerializeObject(e)}"); if (e.Tweet.CreatedBy.Id == _botUser.Id) { logger.LogInformation("Skip. Tweet is created by bot."); return; } TweetReceived?.Invoke(this, e); }
private void OnMatchingTweetReceived(object sender, Tweetinvi.Events.MatchedTweetReceivedEventArgs e) { Debug.WriteLine("OnMatchingTweetReceived Twitter message received"); Debug.WriteLine(JsonConvert.SerializeObject(e)); if (e.Tweet.CreatedBy.Id == _botUser.Id) { Debug.WriteLine("Skip. Tweet is created by bot."); return; } TweetReceived?.Invoke(this, e); }
private void OnMessageReceived(object sender, Tweetinvi.Events.MessageEventArgs e) { System.Diagnostics.Debug.WriteLine("Twitter message received"); TweetReceived?.Invoke(this, e); }