poke-env
poke-env copied to clipboard
Throw exception when being rate limited (or handle rate limits within poke_env itself)
Feature request -- would it be possible to throw an exception when we're being rate limited? This is the Showdown code:
if (this.chatQueue.length >= THROTTLE_BUFFER_LIMIT - 1) {
connection.sendTo(
room,
`|raw|<strong class="message-throttle-notice">Your message was not sent because you've been typing too quickly.</strong>`
);
return false;
IIRC, right now that raw tag is being handled in battle.py, where it tries to parse it as a rating instead. I feel like something lower-level should be listening to this and throwing an exception or something to let you know you're being rate limited. Alternatively, if poke_env could handle the rate limiting itself (either by resending after a delay if it gets that message or keeping track on its own), that'd work too.
Originally posted by @Jay2645 in https://github.com/hsahovic/poke-env/issues/88#issuecomment-724272314