mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
feat(bots/discord): add moderation.roles config to be used in moderation commands
This commit is contained in:
@@ -4,6 +4,7 @@ export type Config = {
|
||||
owners: string[]
|
||||
guilds: string[]
|
||||
moderation?: {
|
||||
roles: string[]
|
||||
log?: {
|
||||
channel: string
|
||||
thread?: string
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user