Don't apply rate limit to bot owner

This commit is contained in:
Supositware 2023-04-19 17:05:43 +02:00
parent 59bf0b9430
commit fb4db75f09

View file

@ -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] = {};
}