summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-07-01 11:13:12 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-07-01 11:13:12 +0200
commit3a8c7ec1c338d52b50a63d4e783820d4d5c55917 (patch)
tree580eeb3afff580c041e9fd48772113c1d6206c59 /src
parent1.3.22 (diff)
downloadserver-3a8c7ec1c338d52b50a63d4e783820d4d5c55917.tar.xz
:sparkles: Rate Limit Bucket
Diffstat (limited to 'src')
-rw-r--r--src/models/RateLimit.ts11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/models/RateLimit.ts b/src/models/RateLimit.ts

index 6ccfafe0..6a0e1ffd 100644 --- a/src/models/RateLimit.ts +++ b/src/models/RateLimit.ts
@@ -1,15 +1,12 @@ import { Schema, Document, Types } from "mongoose"; import db from "../util/Database"; -import { ChannelModel } from "./Channel"; -import { UserModel } from "./User"; -import { GuildModel } from "./Guild"; export interface Bucket { - id: "global" | string; // channel_239842397 | guild_238927349823 | webhook_238923423498 - user: string; + id: "global" | "error" | string; // channel_239842397 | guild_238927349823 | webhook_238923423498 + user_id: string; hits: number; blocked: boolean; - created_at: Date; + expires_at: Date; } export interface BucketDocument extends Bucket, Document { @@ -21,7 +18,7 @@ export const BucketSchema = new Schema({ user_id: { type: String, required: true }, // bot, user, oauth_application, webhook hits: { type: Number, required: true }, // Number of times the user hit this bucket blocked: { type: Boolean, required: true }, - created_at: { type: Date, required: true }, + expires_at: { type: Date, required: true }, }); // @ts-ignore