首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >(discord js antispam)如何创建白名单通道命令?

(discord js antispam)如何创建白名单通道命令?
EN

Stack Overflow用户
提问于 2020-12-07 00:01:46
回答 1查看 398关注 0票数 0

我刚刚公开了我的机器人,我想知道如何创建通道白名单命令,以便反垃圾邮件忽略垃圾邮件通道。如果你们中的任何人想知道,它是基于河豚吃胡萝卜的表情包。这是我的反垃圾邮件代码:

代码语言:javascript
复制
const antiSpam = new AntiSpam({
    warnThreshold: 10, // Amount of messages sent in a row that will cause a warning.
    kickThreshold: 20, // Amount of messages sent in a row that will cause a ban.
    banThreshold: 30, // Amount of messages sent in a row that will cause a ban.
    maxInterval: 6000, // Amount of time (in milliseconds) in which messages are considered spam.
    warnMessage: '{@user}, Please stop spamming.', // Message that will be sent in chat upon warning a user.
    kickMessage: ':carrot: **{user_tag}** has been aeughed for spamming :carrot:', // Message that will be sent in chat upon kicking a user.
    banMessage: ':knife: **{user_tag}** has been chopped for spamming :knife:', // Message that will be sent in chat upon banning a user.
    maxDuplicatesWarning: 10, // Amount of duplicate messages that trigger a warning.
    maxDuplicatesKick: 20, // Amount of duplicate messages that trigger a warning.
    maxDuplicatesBan: 30, // Amount of duplicate messages that trigger a warning.
    exemptPermissions: [ 'ADMINISTRATOR'], // Bypass users with any of these permissions.
    ignoreBots: true, // Ignore bot messages.
    verbose: true, // Extended Logs from module.
    ignoredUsers: [], // Array of User IDs that get ignored
    ignoredChannels: ['channels to be whitelisted'] // Array of string channels IDs that are ignored.
});```
EN

回答 1

Stack Overflow用户

发布于 2021-05-18 19:59:40

·首先启用developer mode

·现在右键单击任意通道,然后单击copy id

因此,在数组中添加您的通道in

代码语言:javascript
复制
ignoredChannels: ["1234567890", "1234567890","1234567890"]

您还可以使用快速db来存储这些id。

代码语言:javascript
复制
 const db = require('quick.db')
 db.push('<server_id>.channels', "channel_id")

现在,在将反垃圾邮件变量放在quick.db变量下面之后

将ignoredChannels替换为

代码语言:javascript
复制
ignoredChannels: db.get('<server_id>.channels')
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65170113

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档