mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +01:00
fix: reactions ratelimits (#2795)
* each reaction doesn't have it's own ratelimit * fix hard-coded reset for reacting
This commit is contained in:
@@ -22,6 +22,7 @@ function buildRoute(manager) {
|
|||||||
versioned: manager.versioned,
|
versioned: manager.versioned,
|
||||||
route: route.map((r, i) => {
|
route: route.map((r, i) => {
|
||||||
if (/\d{16,19}/g.test(r)) return /channels|guilds/.test(route[i - 1]) ? r : ':id';
|
if (/\d{16,19}/g.test(r)) return /channels|guilds/.test(route[i - 1]) ? r : ':id';
|
||||||
|
if (route[i - 1] === 'reactions') return ':reaction';
|
||||||
return r;
|
return r;
|
||||||
}).join('/'),
|
}).join('/'),
|
||||||
}, options)).catch(error => {
|
}, options)).catch(error => {
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ class RequestHandler {
|
|||||||
|
|
||||||
// https://github.com/discordapp/discord-api-docs/issues/182
|
// https://github.com/discordapp/discord-api-docs/issues/182
|
||||||
if (item.request.route.includes('reactions')) {
|
if (item.request.route.includes('reactions')) {
|
||||||
this.reset = Date.now() + getAPIOffset(serverDate) + 250;
|
this.reset = new Date(serverDate).getTime() - getAPIOffset(serverDate) + 250;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user