feat(bots/discord): add moderation.roles config to be used in moderation commands

This commit is contained in:
PalmDevs
2024-06-24 18:32:04 +07:00
parent 7fdf8c0dc7
commit 39d5b3a479
5 changed files with 8 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ export type Config = {
owners: string[]
guilds: string[]
moderation?: {
roles: string[]
log?: {
channel: string
thread?: string

View File

@@ -4,6 +4,7 @@ export default {
owners: ['USER_ID_HERE'],
guilds: ['GUILD_ID_HERE'],
moderation: {
roles: ['ROLE_ID_HERE'],
log: {
channel: 'CHANNEL_ID_HERE',
// Optional

View File

@@ -4,6 +4,7 @@ import CommandError, { CommandErrorType } from '$/classes/CommandError'
import { applyRolePreset } from '$/utils/discord/rolePresets'
import type { Command } from '..'
import { config } from '$/context'
import { applyReferenceToModerationActionEmbed, createModerationActionEmbed } from '$/utils/discord/embeds'
import { parse } from 'simple-duration'
@@ -17,7 +18,7 @@ export default {
.toJSON(),
memberRequirements: {
permissions: 8n,
roles: config.moderation?.roles ?? [],
},
global: false,

View File

@@ -4,6 +4,7 @@ import { durationToString, parseDuration } from '$/utils/duration'
import { SlashCommandBuilder } from 'discord.js'
import CommandError, { CommandErrorType } from '$/classes/CommandError'
import { config } from '$/context'
import type { Command } from '..'
export default {
@@ -20,7 +21,7 @@ export default {
.toJSON(),
memberRequirements: {
roles: ['955220417969262612', '973886585294704640'],
roles: config.moderation?.roles ?? [],
},
global: false,

View File

@@ -1,6 +1,7 @@
import { SlashCommandBuilder } from 'discord.js'
import CommandError, { CommandErrorType } from '$/classes/CommandError'
import { config } from '$/context'
import { applyReferenceToModerationActionEmbed, createModerationActionEmbed } from '$/utils/discord/embeds'
import { removeRolePreset } from '$/utils/discord/rolePresets'
import type { Command } from '..'
@@ -13,7 +14,7 @@ export default {
.toJSON(),
memberRequirements: {
permissions: 8n,
roles: config.moderation?.roles ?? [],
},
global: false,