feat: add rateLimit event (#447)

* fix(controllers): change return value of INTERACTION_CREATE event

* feat: add rateLimit event

Closes https://github.com/discordeno/discordeno/issues/349

* Revert "fix(controllers): change return value of INTERACTION_CREATE event"

This reverts commit 9bc52d2ebf.

* https://open.spotify.com/track/6fxVffaTuwjgEk5h9QyRjy
This commit is contained in:
Ayyan
2021-01-24 23:04:34 +04:00
committed by GitHub
parent b679905b5c
commit 417315f89e
2 changed files with 27 additions and 0 deletions
+11
View File
@@ -423,5 +423,16 @@ function processHeaders(url: string, headers: Headers) {
}
}
if (ratelimited) {
eventHandlers.rateLimit?.({
remaining,
bucketID,
global,
resetTimestamp,
retryAfter,
url,
});
}
return ratelimited ? bucketID : undefined;
}