javascript - Discord.js: Detecting Message From Webhook - Stack Overflow

I have a webhook bot. It sends webhook messages but it detects webhooks messages as same as normal mess

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
Add a ment  | 

1 Answer 1

Reset to default 6

I 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.)

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745165902a4614628.html

相关推荐

  • javascript - Discord.js: Detecting Message From Webhook - Stack Overflow

    I have a webhook bot. It sends webhook messages but it detects webhooks messages as same as normal mess

    2小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信