Is there an event loop for Twitter4R where when a user mentions the bot's handle, it will notify the bot?
I have tried to make it work with checking client.mentions_timeline
every 5 seconds to see if there are new tweets that are mentioning the bot's handle. It worked, however, the rate limit often time gets exceeded after checking client.mentions_timeline
numerous times. Is there a way that I can optimize this or am I missing something?
6: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/twitter-6.2.0/lib/twitter/rest/users.rb:237:in `user'
5: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/twitter-6.2.0/lib/twitter/rest/users.rb:53:in `verify_credentials'
4: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/twitter-6.2.0/lib/twitter/rest/utils.rb:57:in `perform_get_with_object'
3: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/twitter-6.2.0/lib/twitter/rest/utils.rb:72:in `perform_request_with_object'
2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/twitter-6.2.0/lib/twitter/rest/utils.rb:50:in `perform_request'
1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/twitter-6.2.0/lib/twitter/rest/request.rb:39:in `perform'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/twitter-6.2.0/lib/twitter/rest/request.rb:81:in `fail_or_return_response_body': Rate limit exceeded (Twitter::Error::TooManyRequests)
Thanks!