Turki
Turki
DIAdiscord.js - Imagine an app
Created by Turki on 4/27/2024 in #djs-voice
unknown interaction
No description
4 replies
DIAdiscord.js - Imagine an app
Created by Turki on 10/4/2023 in #djs-questions
issue with regex in autoModerationRules
await message.guild.autoModerationRules.create({
name: 'This message has been deleted because it contains a bad word. By ' + client.user.username,
creator: message.author.id,
enabled: true,
eventType: 1,
triggerType: 1,
triggerMetadata:
{
regexPatterns
},
actions: [
{
type: 1,
metadata: {
customMessage: 'This message has been deleted because it contains a bad word.\nBy ' + client.user.username
}
},
{
type: 2,
metadata: {
channel: message.channel.id,
}
},
{
type: 3,
metadata: {
durationSeconds: 300,
}
}
]
})
await message.guild.autoModerationRules.create({
name: 'This message has been deleted because it contains a bad word. By ' + client.user.username,
creator: message.author.id,
enabled: true,
eventType: 1,
triggerType: 1,
triggerMetadata:
{
regexPatterns
},
actions: [
{
type: 1,
metadata: {
customMessage: 'This message has been deleted because it contains a bad word.\nBy ' + client.user.username
}
},
{
type: 2,
metadata: {
channel: message.channel.id,
}
},
{
type: 3,
metadata: {
durationSeconds: 300,
}
}
]
})
its not working it show this error
DiscordAPIError: Invalid Form Body
trigger_metadata.regex_patterns./discord(?:app\.com\/invite|\.(?:(?:com\/invit|m)e|li|io|gg))|\u0645\u062E(?:\u0627\u0646\u064A|\u0646)\u062B|\u0627(?:\u0632\u063A\u0628|\u0645)\u0643|\u062C\u0631\u0627\u0631|\u0642(?:\u0648\u0627\u062F|\u062D\u0628)|\u0646\u064A\u0643|\u0643\u0633/|ـ: "/discord(?:app\.com\/invite|\.(?:(?:com\/invit|m)e|li|io|gg))|\u0645\u062E(?:\u0627\u0646\u064A|\u0646)\u062B|\u0627(?:\u0632\u063A\u0628|\u0645)\u0643|\u062C\u0631\u0627\u0631|\u0642(?:\u0648\u0627\u062F|\u062D\u0628)|\u0646\u064A\u0643|\u0643\u0633/|ـ" has invalid syntax
at RequestHandler.execute (/root/system/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/root/system/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
at async AutoModerationRuleManager.create (/root/system/node_modules/discord.js/src/managers/AutoModerationRuleManager.js:116:18)
at async Object.run (/root/system/commands/⚙️ Settings/badword.js:313:9)
at async Object.run (/root/system/events/handler/messageCreate.js:81:7) {
method: 'post',
path: '/guilds/1017666948902965260/auto-moderation/rules',
code: 50035,
httpStatus: 400,
requestData: {
json: {
name: 'This message has been deleted because it contains a bad word. By Right System',
event_type: 1,
trigger_type: 1,
trigger_metadata: [Object],
actions: [Array],
enabled: true,
exempt_roles: undefined,
exempt_channels: undefined
},
files: []
}
}
DiscordAPIError: Invalid Form Body
trigger_metadata.regex_patterns./discord(?:app\.com\/invite|\.(?:(?:com\/invit|m)e|li|io|gg))|\u0645\u062E(?:\u0627\u0646\u064A|\u0646)\u062B|\u0627(?:\u0632\u063A\u0628|\u0645)\u0643|\u062C\u0631\u0627\u0631|\u0642(?:\u0648\u0627\u062F|\u062D\u0628)|\u0646\u064A\u0643|\u0643\u0633/|ـ: "/discord(?:app\.com\/invite|\.(?:(?:com\/invit|m)e|li|io|gg))|\u0645\u062E(?:\u0627\u0646\u064A|\u0646)\u062B|\u0627(?:\u0632\u063A\u0628|\u0645)\u0643|\u062C\u0631\u0627\u0631|\u0642(?:\u0648\u0627\u062F|\u062D\u0628)|\u0646\u064A\u0643|\u0643\u0633/|ـ" has invalid syntax
at RequestHandler.execute (/root/system/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/root/system/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
at async AutoModerationRuleManager.create (/root/system/node_modules/discord.js/src/managers/AutoModerationRuleManager.js:116:18)
at async Object.run (/root/system/commands/⚙️ Settings/badword.js:313:9)
at async Object.run (/root/system/events/handler/messageCreate.js:81:7) {
method: 'post',
path: '/guilds/1017666948902965260/auto-moderation/rules',
code: 50035,
httpStatus: 400,
requestData: {
json: {
name: 'This message has been deleted because it contains a bad word. By Right System',
event_type: 1,
trigger_type: 1,
trigger_metadata: [Object],
actions: [Array],
enabled: true,
exempt_roles: undefined,
exempt_channels: undefined
},
files: []
}
}
10 replies