alexemanuelol / rustplusplus

A NodeJS Discord Bot that uses the rustplus.js library to utilize the power of the Rust+ Companion App with additional Quality-of-Life features.
GNU General Public License v3.0
198 stars 99 forks source link

Error: Response contain error property with value: rate_limit #130

Closed undeci16 closed 1 year ago

undeci16 commented 1 year ago

Keep getting this in my terminal. https://i.imgur.com/4YMujYy.png It's from some of my switches in discord it "qfw (V10) could not be found! Either it have been destroyed or *** have lost tool cupboard access." https://i.imgur.com/xW5Rexv.png The switch is still there, I have TC and it doesn't lose any power. I can turn the switch on/off in discord and it re-finds the switch, but after some time I get the same error again. https://i.imgur.com/juaHZ9e.png

alexemanuelol commented 1 year ago

Could it perhaps have something to do with the amount of smart devices you currently have?

undeci16 commented 1 year ago

I believe so, did some looking around and found that there's 25 token limit with 3 replenished each second. Different requests cost a certain amount with EntitiyInfo using 1 as I'm guessing the bot uses that to check switches. bottom of page here: https://github.com/liamcottle/rustplus.js

I'm guessing nothing can be done unless there's a way to check for the first 24 switches, wait 8 seconds for tokens to replenish then check for the next 1-24 switches etc.

alexemanuelol commented 1 year ago

There is already a token replenish system in place that works in most cases, not sure if Ill dig into this any more.