Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Discord.js: Detecting Message From Webhook

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;
like image 913
flashy Avatar asked Sep 21 '25 01:09

flashy


1 Answers

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

like image 61
Cloud Avatar answered Sep 22 '25 14:09

Cloud