admin管理员组文章数量:1415099
I have a webhook bot. It sends webhook messages but it detects webhooks messages as same as normal messages. So it makes spam.
I use discord.js
version 11.5.1
I thought this code will work but it did not work.
if (message.author.nickname == null) return;
I have a webhook bot. It sends webhook messages but it detects webhooks messages as same as normal messages. So it makes spam.
I use discord.js
version 11.5.1
I thought this code will work but it did not work.
if (message.author.nickname == null) return;
Share
Improve this question
edited Jan 19, 2020 at 20:12
flashy
asked Aug 31, 2019 at 20:08
flashyflashy
56411 silver badges25 bronze badges
3
- Maybe it's not null try this: if (!message.author.nickname) return; – EugenSunic Commented Aug 31, 2019 at 20:10
-
I think
message.author.nickname
is not the true variable to test. I think there should be another variable for this case. – flashy Commented Aug 31, 2019 at 20:13 - The code you gave cancels all mands – flashy Commented Aug 31, 2019 at 20:13
1 Answer
Reset to default 6I think this is what you're looking for: Message#webhookId
if (message.webhookId) return;
(For Discord.js V12 and under, use #webhookID
with ID
all capitalised instead.)
本文标签: javascriptDiscordjs Detecting Message From WebhookStack Overflow
版权声明:本文标题:javascript - Discord.js: Detecting Message From Webhook - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745165902a2645677.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论