Twitter4R 是否有一个事件循环,当用户提到机器人的句柄时,它会通知机器人?
我试图让它client.mentions_timeline
每 5 秒检查一次,看看是否有新的推文提到了机器人的句柄。client.mentions_timeline
它起作用了,但是,在多次检查后,通常会超过速率限制。有没有办法可以优化这个或者我错过了什么?
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)
谢谢!