diff options
-rw-r--r-- | src/api/routes/auth/register.ts | 4 | ||||
-rw-r--r-- | src/api/routes/channels/#channel_id/messages/index.ts | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/api/routes/auth/register.ts b/src/api/routes/auth/register.ts index bff35b2f..50f89522 100644 --- a/src/api/routes/auth/register.ts +++ b/src/api/routes/auth/register.ts @@ -184,7 +184,9 @@ router.post("/", route({ body: "RegisterSchema" }), async (req: Request, res: Re ) ); } else { - let retryAfterSec = Math.ceil((oldest!.created_at.getTime() - new Date(Date.now() - limits.absoluteRate.register.window).getTime())/1000); + let retryAfterSec = Math.ceil( + (oldest!.created_at.getTime() - new Date(Date.now() - limits.absoluteRate.register.window).getTime()) / 1000 + ); return res .status(429) .set("X-RateLimit-Limit", `${limits.absoluteRate.register.limit}`) diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts index 65cd42f3..87c689ec 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts @@ -188,7 +188,9 @@ router.post( ) ); } else { - let retryAfterSec = Math.ceil((oldest!.timestamp.getTime() - new Date(Date.now() - limits.absoluteRate.sendMessage.window).getTime())/1000); + let retryAfterSec = Math.ceil( + (oldest!.timestamp.getTime() - new Date(Date.now() - limits.absoluteRate.sendMessage.window).getTime()) / 1000 + ); return res .status(429) .set("X-RateLimit-Limit", `${limits.absoluteRate.sendMessage.limit}`) |