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