From fb4db75f0932db309b8db9035ceb60afa07e9219 Mon Sep 17 00:00:00 2001 From: Supositware Date: Wed, 19 Apr 2023 17:05:43 +0200 Subject: [PATCH] Don't apply rate limit to bot owner --- utils/ratelimiter.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils/ratelimiter.js b/utils/ratelimiter.js index 971b8e65..242df4d6 100644 --- a/utils/ratelimiter.js +++ b/utils/ratelimiter.js @@ -1,4 +1,6 @@ const ratelimit = {}; +const { ownerId } = process.env; + import db from '../models/index.js'; export default { @@ -8,6 +10,11 @@ function check(user, commandName, commands) { const userID = user.id; const userTag = user.tag; + // Don't apply the rate limit to bot owner + if (userID === ownerId) { + return false; + } + if (!ratelimit[userID]) { ratelimit[userID] = {}; }