我刚刚公开了我的机器人,我想知道如何创建通道白名单命令,以便反垃圾邮件忽略垃圾邮件通道。如果你们中的任何人想知道,它是基于河豚吃胡萝卜的表情包。这是我的反垃圾邮件代码:
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.
});```发布于 2021-05-18 19:59:40
·首先启用developer mode
·现在右键单击任意通道,然后单击copy id
因此,在数组中添加您的通道in
ignoredChannels: ["1234567890", "1234567890","1234567890"]您还可以使用快速db来存储这些id。
const db = require('quick.db')
db.push('<server_id>.channels', "channel_id")现在,在将反垃圾邮件变量放在quick.db变量下面之后
将ignoredChannels替换为
ignoredChannels: db.get('<server_id>.channels')https://stackoverflow.com/questions/65170113
复制相似问题