diff --git a/utils/ratelimiter.js b/utils/ratelimiter.js index e421062..7861902 100644 --- a/utils/ratelimiter.js +++ b/utils/ratelimiter.js @@ -39,12 +39,10 @@ function check(user, commandName, commands) { const dateString = `${hours > 0 ? ` ${Math.floor(hours)} hours` : ''}${minutes > 0 ? ` ${Math.floor(minutes % 60)} minutes` : ''}${seconds > 0 ? ` ${Math.floor(seconds % 60)} seconds` : ''}`; const isOptOut = db.optout.findOne({ where: { userID: userID } }); - if (isOptOut) { - console.log(`A user is rate limited on \x1b[33m${commandName}\x1b[0m for${dateString}.`); - } - else { - console.log(`\x1b[33m${userTag} (${userID})\x1b[0m is rate limited on \x1b[33m${commandName}\x1b[0m for${dateString}.`); - } + + const timestamp = new Date(); + console.log(`[${timestamp.toISOString()}] \x1b[33m${ isOptOut ? 'A user' : `${userTag} (${userID})`}\x1b[0m is rate limited on \x1b[33m${commandName}\x1b[0m for${dateString}.`); + return `You are being rate limited. You can try again in${dateString}.`; } }