mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-18 08:43:57 +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[]
|
owners: string[]
|
||||||
guilds: string[]
|
guilds: string[]
|
||||||
moderation?: {
|
moderation?: {
|
||||||
|
roles: string[]
|
||||||
log?: {
|
log?: {
|
||||||
channel: string
|
channel: string
|
||||||
thread?: string
|
thread?: string
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export default {
|
|||||||
owners: ['USER_ID_HERE'],
|
owners: ['USER_ID_HERE'],
|
||||||
guilds: ['GUILD_ID_HERE'],
|
guilds: ['GUILD_ID_HERE'],
|
||||||
moderation: {
|
moderation: {
|
||||||
|
roles: ['ROLE_ID_HERE'],
|
||||||
log: {
|
log: {
|
||||||
channel: 'CHANNEL_ID_HERE',
|
channel: 'CHANNEL_ID_HERE',
|
||||||
// Optional
|
// Optional
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
|||||||
import { applyRolePreset } from '$/utils/discord/rolePresets'
|
import { applyRolePreset } from '$/utils/discord/rolePresets'
|
||||||
import type { Command } from '..'
|
import type { Command } from '..'
|
||||||
|
|
||||||
|
import { config } from '$/context'
|
||||||
import { applyReferenceToModerationActionEmbed, createModerationActionEmbed } from '$/utils/discord/embeds'
|
import { applyReferenceToModerationActionEmbed, createModerationActionEmbed } from '$/utils/discord/embeds'
|
||||||
import { parse } from 'simple-duration'
|
import { parse } from 'simple-duration'
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ export default {
|
|||||||
.toJSON(),
|
.toJSON(),
|
||||||
|
|
||||||
memberRequirements: {
|
memberRequirements: {
|
||||||
permissions: 8n,
|
roles: config.moderation?.roles ?? [],
|
||||||
},
|
},
|
||||||
|
|
||||||
global: false,
|
global: false,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { durationToString, parseDuration } from '$/utils/duration'
|
|||||||
import { SlashCommandBuilder } from 'discord.js'
|
import { SlashCommandBuilder } from 'discord.js'
|
||||||
|
|
||||||
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
||||||
|
import { config } from '$/context'
|
||||||
import type { Command } from '..'
|
import type { Command } from '..'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -20,7 +21,7 @@ export default {
|
|||||||
.toJSON(),
|
.toJSON(),
|
||||||
|
|
||||||
memberRequirements: {
|
memberRequirements: {
|
||||||
roles: ['955220417969262612', '973886585294704640'],
|
roles: config.moderation?.roles ?? [],
|
||||||
},
|
},
|
||||||
|
|
||||||
global: false,
|
global: false,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js'
|
import { SlashCommandBuilder } from 'discord.js'
|
||||||
|
|
||||||
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
||||||
|
import { config } from '$/context'
|
||||||
import { applyReferenceToModerationActionEmbed, createModerationActionEmbed } from '$/utils/discord/embeds'
|
import { applyReferenceToModerationActionEmbed, createModerationActionEmbed } from '$/utils/discord/embeds'
|
||||||
import { removeRolePreset } from '$/utils/discord/rolePresets'
|
import { removeRolePreset } from '$/utils/discord/rolePresets'
|
||||||
import type { Command } from '..'
|
import type { Command } from '..'
|
||||||
@@ -13,7 +14,7 @@ export default {
|
|||||||
.toJSON(),
|
.toJSON(),
|
||||||
|
|
||||||
memberRequirements: {
|
memberRequirements: {
|
||||||
permissions: 8n,
|
roles: config.moderation?.roles ?? [],
|
||||||
},
|
},
|
||||||
|
|
||||||
global: false,
|
global: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user