add user request limit to config, rename previous limit to read limit
This commit is contained in:
parent
0931fe103d
commit
e6d6764e34
4 changed files with 11 additions and 6 deletions
|
@ -86,7 +86,7 @@ export async function getUserLimit(user: string | { id: string }, requestTimesta
|
|||
},
|
||||
}))._all;
|
||||
|
||||
if (!userLimits || !userLimits.limit) return {limit: 25, remaining: 25 - usedLimit};
|
||||
if (!userLimits || !userLimits.limit) return {limit: config.userLimits.requests, remaining: config.userLimits.requests - usedLimit};
|
||||
|
||||
return {limit: userLimits.limit, remaining: userLimits.limit - usedLimit};
|
||||
}
|
||||
|
@ -261,9 +261,9 @@ async function executeFromQueue(channel: string) {
|
|||
if (!canReplyToRequest(message)) return;
|
||||
|
||||
try {
|
||||
let messages: DiscordApi.Collection<string, DiscordApi.Message> = await message.channel.messages.fetch({ limit: config.limits.messages, cache: false });
|
||||
let messages: DiscordApi.Collection<string, DiscordApi.Message> = await message.channel.messages.fetch({ limit: config.readLimits.messages, cache: false });
|
||||
|
||||
messages = messages.filter(m => message.createdTimestamp - m.createdTimestamp < config.limits.time );
|
||||
messages = messages.filter(m => message.createdTimestamp - m.createdTimestamp < config.readLimits.time );
|
||||
|
||||
messages.forEach(m => { Moderation.checkMessageNoReturn(m); });
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue