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