pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 1 | import type Discord from "discord.js"; |
| 2 | import { Collection, MongoClient } from "mongodb"; |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 3 | // @ts-expect-error |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 4 | import structuredClone from "@ungap/structured-clone"; |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 5 | import config from "../config/main.json" assert { type: "json" }; |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 6 | |
| 7 | const mongoClient = new MongoClient(config.mongoUrl); |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 8 | await mongoClient.connect(); |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 9 | const database = mongoClient.db("Nucleus"); |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 10 | |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 11 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 12 | export const Entry = (data: any) => { |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 13 | data = data ?? {}; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 14 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 15 | data.getKey = (key: any) => data[key]; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 16 | return { |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 17 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 18 | get(target: Record<string, any>, prop: string, receiver: any) { |
| 19 | let dataToReturn = data[prop]; |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 20 | if (dataToReturn === null) return Reflect.get(target, prop, receiver); |
| 21 | if (typeof dataToReturn === "object" && !Array.isArray(dataToReturn)) |
| 22 | dataToReturn = new Proxy(Reflect.get(target, prop, receiver), Entry(dataToReturn)); |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 23 | return dataToReturn ?? Reflect.get(target, prop, receiver); |
| 24 | } |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 25 | }; |
| 26 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 27 | |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 28 | export class Guilds { |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 29 | guilds: Collection<GuildConfig>; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 30 | defaultData: GuildConfig | null; |
| 31 | |
| 32 | constructor() { |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 33 | this.guilds = database.collection<GuildConfig>("guilds"); |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 34 | this.defaultData = null; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 35 | return this; |
| 36 | } |
| 37 | |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 38 | async setup() { |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 39 | this.defaultData = (await import("../config/default.json", { assert: { type: "json" } })) |
| 40 | .default as unknown as GuildConfig; |
| 41 | return this; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 42 | } |
| 43 | |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 44 | async read(guild: string) { |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 45 | const entry = await this.guilds.findOne({ id: guild }); |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 46 | return new Proxy(structuredClone(this.defaultData), Entry(entry)) as unknown as GuildConfig; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 47 | } |
| 48 | |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 49 | async write(guild: string, set: object | null, unset: string[] | string = []) { |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 50 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 51 | const uo: Record<string, any> = {}; |
| 52 | if (!Array.isArray(unset)) unset = [unset]; |
| 53 | for (const key of unset) { |
pineafan | 0bc0416 | 2022-07-25 17:22:26 +0100 | [diff] [blame] | 54 | uo[key] = null; |
pineafan | 6702cef | 2022-06-13 17:52:37 +0100 | [diff] [blame] | 55 | } |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 56 | const out = { $set: {}, $unset: {} }; |
| 57 | if (set) out.$set = set; |
| 58 | if (unset.length) out.$unset = uo; |
pineafan | 0bc0416 | 2022-07-25 17:22:26 +0100 | [diff] [blame] | 59 | await this.guilds.updateOne({ id: guild }, out, { upsert: true }); |
pineafan | 6702cef | 2022-06-13 17:52:37 +0100 | [diff] [blame] | 60 | } |
| 61 | |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 62 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
pineafan | 6702cef | 2022-06-13 17:52:37 +0100 | [diff] [blame] | 63 | async append(guild: string, key: string, value: any) { |
| 64 | if (Array.isArray(value)) { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 65 | await this.guilds.updateOne( |
| 66 | { id: guild }, |
| 67 | { |
| 68 | $addToSet: { [key]: { $each: value } } |
| 69 | }, |
| 70 | { upsert: true } |
| 71 | ); |
pineafan | 6702cef | 2022-06-13 17:52:37 +0100 | [diff] [blame] | 72 | } else { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 73 | await this.guilds.updateOne( |
| 74 | { id: guild }, |
| 75 | { |
| 76 | $addToSet: { [key]: value } |
| 77 | }, |
| 78 | { upsert: true } |
| 79 | ); |
pineafan | 6702cef | 2022-06-13 17:52:37 +0100 | [diff] [blame] | 80 | } |
| 81 | } |
| 82 | |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 83 | async remove( |
| 84 | guild: string, |
| 85 | key: string, |
Skyler Grey | c634e2b | 2022-08-06 17:50:48 +0100 | [diff] [blame] | 86 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 87 | value: any, |
| 88 | innerKey?: string | null |
| 89 | ) { |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 90 | console.log(Array.isArray(value)); |
pineafan | 02ba023 | 2022-07-24 22:16:15 +0100 | [diff] [blame] | 91 | if (innerKey) { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 92 | await this.guilds.updateOne( |
| 93 | { id: guild }, |
| 94 | { |
| 95 | $pull: { [key]: { [innerKey]: { $eq: value } } } |
| 96 | }, |
| 97 | { upsert: true } |
| 98 | ); |
pineafan | 0bc0416 | 2022-07-25 17:22:26 +0100 | [diff] [blame] | 99 | } else if (Array.isArray(value)) { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 100 | await this.guilds.updateOne( |
| 101 | { id: guild }, |
| 102 | { |
| 103 | $pullAll: { [key]: value } |
| 104 | }, |
| 105 | { upsert: true } |
| 106 | ); |
pineafan | 6702cef | 2022-06-13 17:52:37 +0100 | [diff] [blame] | 107 | } else { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 108 | await this.guilds.updateOne( |
| 109 | { id: guild }, |
| 110 | { |
| 111 | $pullAll: { [key]: [value] } |
| 112 | }, |
| 113 | { upsert: true } |
| 114 | ); |
pineafan | 6702cef | 2022-06-13 17:52:37 +0100 | [diff] [blame] | 115 | } |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 116 | } |
pineafan | e23c4ec | 2022-07-27 21:56:27 +0100 | [diff] [blame] | 117 | |
| 118 | async delete(guild: string) { |
| 119 | await this.guilds.deleteOne({ id: guild }); |
| 120 | } |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 121 | } |
| 122 | |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 123 | export class History { |
| 124 | histories: Collection<HistorySchema>; |
| 125 | defaultData: GuildConfig; |
| 126 | |
| 127 | async setup() { |
| 128 | this.histories = database.collection<HistorySchema>("history"); |
| 129 | return this; |
| 130 | } |
| 131 | |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 132 | async create( |
| 133 | type: string, |
| 134 | guild: string, |
| 135 | user: Discord.User, |
| 136 | moderator: Discord.User | null, |
| 137 | reason: string | null, |
| 138 | before?: null, |
| 139 | after?: null, |
| 140 | amount?: null |
| 141 | ) { |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 142 | await this.histories.insertOne({ |
| 143 | type: type, |
| 144 | guild: guild, |
| 145 | user: user.id, |
| 146 | moderator: moderator.id, |
| 147 | reason: reason, |
| 148 | occurredAt: new Date(), |
| 149 | before: before, |
| 150 | after: after, |
| 151 | amount: amount |
| 152 | }); |
| 153 | } |
| 154 | |
| 155 | async read(guild: string, user: string, year: number) { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 156 | const entry = (await this.histories |
| 157 | .find({ |
| 158 | guild: guild, |
| 159 | user: user, |
| 160 | occurredAt: { |
| 161 | $gte: new Date(year - 1, 11, 31, 23, 59, 59), |
| 162 | $lt: new Date(year + 1, 0, 1, 0, 0, 0) |
| 163 | } |
| 164 | }) |
| 165 | .toArray()) as HistorySchema[]; |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 166 | return entry; |
| 167 | } |
pineafan | e23c4ec | 2022-07-27 21:56:27 +0100 | [diff] [blame] | 168 | |
| 169 | async delete(guild: string) { |
| 170 | await this.histories.deleteMany({ guild: guild }); |
| 171 | } |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 172 | } |
| 173 | |
| 174 | export class ModNotes { |
| 175 | modNotes: Collection<ModNoteSchema>; |
| 176 | defaultData: GuildConfig; |
| 177 | |
| 178 | async setup() { |
| 179 | this.modNotes = database.collection<ModNoteSchema>("modNotes"); |
| 180 | return this; |
| 181 | } |
| 182 | |
| 183 | async create(guild: string, user: string, note: string | null) { |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 184 | await this.modNotes.updateOne({ guild: guild, user: user }, { $set: { note: note } }, { upsert: true }); |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 185 | } |
| 186 | |
| 187 | async read(guild: string, user: string) { |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 188 | const entry = await this.modNotes.findOne({ guild: guild, user: user }); |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 189 | return entry?.note ?? null; |
| 190 | } |
| 191 | } |
| 192 | |
pineafan | 73a7c4a | 2022-07-24 10:38:04 +0100 | [diff] [blame] | 193 | export class Premium { |
| 194 | premium: Collection<PremiumSchema>; |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 195 | |
| 196 | async setup() { |
pineafan | 73a7c4a | 2022-07-24 10:38:04 +0100 | [diff] [blame] | 197 | this.premium = database.collection<PremiumSchema>("premium"); |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 198 | return this; |
| 199 | } |
| 200 | |
pineafan | 73a7c4a | 2022-07-24 10:38:04 +0100 | [diff] [blame] | 201 | async hasPremium(guild: string) { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 202 | const entry = await this.premium.findOne({ |
| 203 | appliesTo: { $in: [guild] } |
| 204 | }); |
pineafan | e23c4ec | 2022-07-27 21:56:27 +0100 | [diff] [blame] | 205 | return entry !== null; |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 206 | } |
| 207 | } |
| 208 | |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 209 | export interface GuildConfig { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 210 | id: string; |
| 211 | version: number; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 212 | singleEventNotifications: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 213 | statsChannelDeleted: boolean; |
| 214 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 215 | filters: { |
| 216 | images: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 217 | NSFW: boolean; |
| 218 | size: boolean; |
| 219 | }; |
| 220 | malware: boolean; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 221 | wordFilter: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 222 | enabled: boolean; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 223 | words: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 224 | strict: string[]; |
| 225 | loose: string[]; |
| 226 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 227 | allowed: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 228 | users: string[]; |
| 229 | roles: string[]; |
| 230 | channels: string[]; |
| 231 | }; |
| 232 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 233 | invite: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 234 | enabled: boolean; |
| 235 | channels: string[]; |
| 236 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 237 | pings: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 238 | mass: number; |
| 239 | everyone: boolean; |
| 240 | roles: boolean; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 241 | allowed: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 242 | roles: string[]; |
| 243 | rolesToMention: string[]; |
| 244 | users: string[]; |
| 245 | channels: string[]; |
| 246 | }; |
| 247 | }; |
| 248 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 249 | welcome: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 250 | enabled: boolean; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 251 | verificationRequired: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 252 | message: boolean; |
| 253 | role: string | null; |
| 254 | }; |
| 255 | role: string | null; |
| 256 | ping: string | null; |
| 257 | channel: string | null; |
| 258 | message: string | null; |
| 259 | }; |
| 260 | stats: Record<string, { name: string; enabled: boolean }>; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 261 | logging: { |
| 262 | logs: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 263 | enabled: boolean; |
| 264 | channel: string | null; |
| 265 | toLog: string | null; |
| 266 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 267 | staff: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 268 | channel: string | null; |
| 269 | }; |
pineafan | 73a7c4a | 2022-07-24 10:38:04 +0100 | [diff] [blame] | 270 | attachments: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 271 | channel: string | null; |
| 272 | saved: Record<string, string>; |
| 273 | }; |
| 274 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 275 | verify: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 276 | enabled: boolean; |
| 277 | role: string | null; |
| 278 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 279 | tickets: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 280 | enabled: boolean; |
| 281 | category: string | null; |
| 282 | types: string | null; |
| 283 | customTypes: string[]; |
| 284 | useCustom: boolean; |
| 285 | supportRole: string | null; |
| 286 | maxTickets: number; |
| 287 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 288 | moderation: { |
| 289 | mute: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 290 | timeout: boolean; |
| 291 | role: string | null; |
| 292 | text: string | null; |
| 293 | link: string | null; |
| 294 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 295 | kick: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 296 | text: string | null; |
| 297 | link: string | null; |
| 298 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 299 | ban: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 300 | text: string | null; |
| 301 | link: string | null; |
| 302 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 303 | softban: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 304 | text: string | null; |
| 305 | link: string | null; |
| 306 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 307 | warn: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 308 | text: string | null; |
| 309 | link: string | null; |
| 310 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 311 | role: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 312 | role: string | null; |
| 313 | }; |
| 314 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 315 | tracks: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 316 | name: string; |
| 317 | retainPrevious: boolean; |
| 318 | nullable: boolean; |
| 319 | track: string[]; |
| 320 | manageableBy: string[]; |
| 321 | }[]; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 322 | roleMenu: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 323 | enabled: boolean; |
| 324 | allowWebUI: boolean; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 325 | options: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 326 | name: string; |
| 327 | description: string; |
| 328 | min: number; |
| 329 | max: number; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 330 | options: { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 331 | name: string; |
| 332 | description: string | null; |
| 333 | role: string; |
| 334 | }[]; |
| 335 | }[]; |
| 336 | }; |
| 337 | tags: Record<string, string>; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 338 | } |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 339 | |
| 340 | export interface HistorySchema { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 341 | type: string; |
| 342 | guild: string; |
| 343 | user: string; |
| 344 | moderator: string | null; |
| 345 | reason: string; |
| 346 | occurredAt: Date; |
| 347 | before: string | null; |
| 348 | after: string | null; |
| 349 | amount: string | null; |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 350 | } |
| 351 | |
| 352 | export interface ModNoteSchema { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 353 | guild: string; |
| 354 | user: string; |
| 355 | note: string; |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 356 | } |
| 357 | |
pineafan | 73a7c4a | 2022-07-24 10:38:04 +0100 | [diff] [blame] | 358 | export interface PremiumSchema { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 359 | user: string; |
| 360 | level: number; |
| 361 | expires: Date; |
| 362 | appliesTo: string[]; |
| 363 | } |