mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
chore(bots/discord): add default config
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { PermissionFlagsBits } from 'discord.js'
|
||||
import type { Config } from './config.example'
|
||||
import type { Config } from './config.schema'
|
||||
|
||||
export default {
|
||||
owners: ['629368283354628116', '737323631117598811', '282584705218510848'],
|
||||
|
||||
@@ -1,47 +1,3 @@
|
||||
export default {
|
||||
owners: ['USER_ID_HERE'],
|
||||
guilds: ['GUILD_ID_HERE'],
|
||||
messageScan: {
|
||||
filter: {
|
||||
channels: ['CHANNEL_ID_HERE'],
|
||||
roles: ['ROLE_ID_HERE'],
|
||||
users: ['USER_ID_HERE'],
|
||||
whitelist: false,
|
||||
},
|
||||
humanCorrections: {
|
||||
falsePositiveLabel: 'false_positive',
|
||||
allow: {
|
||||
members: {
|
||||
permissions: 8n,
|
||||
roles: ['ROLE_ID_HERE'],
|
||||
},
|
||||
},
|
||||
},
|
||||
allowedAttachmentMimeTypes: ['image/jpeg', 'image/png', 'image/webp'],
|
||||
responses: [
|
||||
{
|
||||
triggers: {
|
||||
text: [/^regexp?$/, { label: 'label', threshold: 0.85 }],
|
||||
},
|
||||
response: {
|
||||
title: 'Embed title',
|
||||
description: 'Embed description',
|
||||
fields: [
|
||||
{
|
||||
name: 'Field name',
|
||||
value: 'Field value',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
logLevel: 'log',
|
||||
api: {
|
||||
websocketUrl: 'ws://127.0.0.1:3000',
|
||||
},
|
||||
} satisfies Config as Config
|
||||
|
||||
export type Config = {
|
||||
owners: string[]
|
||||
guilds: string[]
|
||||
45
bots/discord/config.ts
Normal file
45
bots/discord/config.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { Config } from './config.schema'
|
||||
|
||||
export default {
|
||||
owners: ['USER_ID_HERE'],
|
||||
guilds: ['GUILD_ID_HERE'],
|
||||
messageScan: {
|
||||
filter: {
|
||||
channels: ['CHANNEL_ID_HERE'],
|
||||
roles: ['ROLE_ID_HERE'],
|
||||
users: ['USER_ID_HERE'],
|
||||
whitelist: false,
|
||||
},
|
||||
humanCorrections: {
|
||||
falsePositiveLabel: 'false_positive',
|
||||
allow: {
|
||||
members: {
|
||||
permissions: 8n,
|
||||
roles: ['ROLE_ID_HERE'],
|
||||
},
|
||||
},
|
||||
},
|
||||
allowedAttachmentMimeTypes: ['image/jpeg', 'image/png', 'image/webp'],
|
||||
responses: [
|
||||
{
|
||||
triggers: {
|
||||
text: [/^regexp?$/, { label: 'label', threshold: 0.85 }],
|
||||
},
|
||||
response: {
|
||||
title: 'Embed title',
|
||||
description: 'Embed description',
|
||||
fields: [
|
||||
{
|
||||
name: 'Field name',
|
||||
value: 'Field value',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
logLevel: 'log',
|
||||
api: {
|
||||
websocketUrl: 'ws://127.0.0.1:3000',
|
||||
},
|
||||
} satisfies Config as Config
|
||||
@@ -1,6 +1,6 @@
|
||||
# ⚙️ Configuration
|
||||
|
||||
You will need to copy `config.example.ts` to `config.ts` to be able to start the bot, as it is the default configuration.
|
||||
See [`config.ts`](../config.ts).
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ filterOverride: {
|
||||
},
|
||||
```
|
||||
|
||||
[^1]: Possible triggers are regular expressions or [label configurations](../config.example.ts#L83).
|
||||
[^1]: Possible triggers are regular expressions or [label configurations](../config.schema.ts#L83).
|
||||
Label configurations are only allowed for **text scans** currently. However in the future, it may also come for image scans. There is nothing preventing this from happening.
|
||||
|
||||
## ⏭️ What's next
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from 'discord.js'
|
||||
|
||||
import { handleUserResponseCorrection } from '$/utils/discord/messageScan'
|
||||
import type { ConfigMessageScanResponseLabelConfig } from 'config.example'
|
||||
import type { ConfigMessageScanResponseLabelConfig } from 'config.schema'
|
||||
|
||||
const PossibleReactions = Object.values(Reactions) as string[]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DefaultEmbedColor, MessageScanHumanizedMode, ReVancedLogoURL } from '$/constants'
|
||||
import { EmbedBuilder } from 'discord.js'
|
||||
import type { ConfigMessageScanResponseMessage } from '../../../config.example'
|
||||
import type { ConfigMessageScanResponseMessage } from '../../../config.schema'
|
||||
|
||||
export const createErrorEmbed = (title: string, description?: string) =>
|
||||
applyCommonEmbedStyles(
|
||||
|
||||
@@ -4,7 +4,7 @@ import type {
|
||||
ConfigMessageScanResponse,
|
||||
ConfigMessageScanResponseLabelConfig,
|
||||
ConfigMessageScanResponseMessage,
|
||||
} from 'config.example'
|
||||
} from 'config.schema'
|
||||
import type { Message, PartialUser, User } from 'discord.js'
|
||||
import { createMessageScanResponseEmbed } from './embeds'
|
||||
|
||||
|
||||
0
bots/discord/src/utils/discord/modLogs.ts
Normal file
0
bots/discord/src/utils/discord/modLogs.ts
Normal file
Reference in New Issue
Block a user