2 Commits

Author SHA1 Message Date
Anthony Berg
c76a514a2c feat(db): add table for logging clear commands 2024-08-06 20:48:19 +02:00
Anthony Berg
f77758c039 feat(arabot): allow mods to run. add a requirement needing delete perms 2024-08-06 20:47:31 +02:00
2 changed files with 12 additions and 1 deletions

View File

@@ -66,6 +66,7 @@ model User {
TempBanEndMod TempBan[] @relation("endTbanMod") TempBanEndMod TempBan[] @relation("endTbanMod")
VCMuteUser VCMute[] @relation("vcMuteUser") VCMuteUser VCMute[] @relation("vcMuteUser")
VCMuteMod VCMute[] @relation("vcMuteMod") VCMuteMod VCMute[] @relation("vcMuteMod")
ClearCommandMod ClearCommand[]
} }
model Verify { model Verify {
@@ -312,3 +313,11 @@ model VCMute {
endTime DateTime? endTime DateTime?
reason String? reason String?
} }
model ClearCommand {
id Int @id @default(autoincrement())
mod User @relation(fields: [modId], references: [id])
modId String
messages Int
time DateTime @default(now())
}

View File

@@ -18,6 +18,7 @@
*/ */
import { Args, Command, RegisterBehavior } from '@sapphire/framework'; import { Args, Command, RegisterBehavior } from '@sapphire/framework';
import { PermissionFlagsBits } from 'discord.js';
import type { Message } from 'discord.js'; import type { Message } from 'discord.js';
export class ClearCommand extends Command { export class ClearCommand extends Command {
@@ -26,7 +27,8 @@ export class ClearCommand extends Command {
...options, ...options,
name: 'clear', name: 'clear',
description: 'Deletes 1-100 messages in bulk', description: 'Deletes 1-100 messages in bulk',
preconditions: ['CoordinatorOnly'], preconditions: [['CoordinatorOnly', 'ModOnly']],
requiredUserPermissions: [PermissionFlagsBits.ManageMessages]
}); });
} }