所以,我打算创建一个反垃圾邮件系统,如果用户连续发送5条消息,中间有少量延迟,我希望它自动将它们静音1分钟并显示嵌入并拥有剩余时间字段,用剩余的秒数编辑,直到静音到期。
我怎么能做到这一点?
感谢。
注意:我已经为默认用户设置了一个名为“Muted”的角色。
答案 0 :(得分:1)
我会考虑使用它:
var anti_spam = require("discord-anti-spam");
antispam(bot,
{
warnBuffer: 3, //Maximum amount of messages allowed to send in the interval time before getting warned.
maxBuffer: 5, // Maximum amount of messages allowed to send in the interval time before getting banned.
interval: 1000, // Amount of time in ms users can send a maximum of the maxBuffer variable before getting banned.
warningMessage: "stop spamming or I'll whack your head off.", // Warning message send to the user indicating they are going to fast.
banMessage: "has been banned for spamming, anyone else?", // Ban message, always tags the banned user in front of it.
maxDuplicatesWarning = 7; // Maximum amount of duplicate messages a user can send in a timespan before getting warned
maxDuplicatesBan = 10; // Maximum amount of duplicate messages a user can send in a timespan before getting banned
});