【发布时间】:2020-11-28 01:28:56
【问题描述】:
client.on('messageDelete', function (message) {
if (message.channel.type === 'text') {
var log = client.channels.cache.get("44444444444444444")
if (log != null) {
client.channels.cache.get('4444444444444').send('**DELETED** ' + `${message.author}` + '\: ' + message.cleanContent + ' ')
}
}
})
这是我记录已删除消息的脚本。
如何排除某些渠道和/或某些用户,例如机器人?
我应该使用类似的东西:
if (message.channel.type === 'text') & channels... & users...
【问题讨论】:
-
是的,应该可以。你会想做一些更像
if( message.channel.type === "text" && channels && users)的事情。试一试,如果您在运行它时遇到任何问题,请告诉我们。
标签: javascript node.js discord bots discord.js