MD
DIAdiscord.js - Imagine a bot
•Created by MD on 8/5/2023 in #djs-questions
Bot posts randomly 1 - 3 welcome messages for the same member that already joined.
update to 14.13 didn't change anything for me
95 replies
DIAdiscord.js - Imagine a bot
•Created by Lawrence on 10/1/2023 in #djs-questions
Bot send multiple message unpredictably
but if something will go wrong, bot will not post message at all, so it should be considered only as temporary solution
8 replies
DIAdiscord.js - Imagine a bot
•Created by Lawrence on 10/1/2023 in #djs-questions
Bot send multiple message unpredictably
i have exactly the same problem https://discord.com/channels/222078108977594368/1137513755840872449
We found the reason, but nobody can find proper solution.
Add this listener in your code, and check if
retries
value is greater than 0
I kinda fixed it by setting rest retries value to 0 in client settings8 replies
DIAdiscord.js - Imagine a bot
•Created by MD on 8/5/2023 in #djs-questions
Bot posts randomly 1 - 3 welcome messages for the same member that already joined.
After i set rest timeout to 30 seconds, i still get duplicated messages, but after that 30 seconds.
Correct message immediately, 2nd after 30 seconds, and 3rd after 1 minute.
Kinda fixed the problem when i set rest retries value to 0.
It is not posting duplicated messages anymore, but if something will go wrong, it will not post message at all
95 replies
DIAdiscord.js - Imagine a bot
•Created by MD on 8/5/2023 in #djs-questions
Bot posts randomly 1 - 3 welcome messages for the same member that already joined.
message id is a snowflake, that means is unique, and there is now way it can be the same for 2 messages
95 replies
DIAdiscord.js - Imagine a bot
•Created by MD on 8/5/2023 in #djs-questions
Bot posts randomly 1 - 3 welcome messages for the same member that already joined.
i also think it is Discord issue. On my server is the same https://discord.com/channels/222078108977594368/1137513755840872449/1146872636257861683
Default discord welcome messages are duplicated for so many people, and that also correlate with my bot duplicated messages.
I checked timestamps of default Discord welcome messages, and 3 messages for the same person has exactly the same timestamp. It is not possible that one person 3 times within one second joined and left my server
95 replies
DIAdiscord.js - Imagine a bot
•Created by .demonslayer on 9/1/2023 in #djs-questions
Duplicate Message Send
I created similar thread here: https://discord.com/channels/222078108977594368/1137513755840872449
try to add this to your code
if you get "retries" value not equal to 0 in duplicated message, probably you have the same issue
6 replies
DIAdiscord.js - Imagine a bot
•Created by MD on 8/5/2023 in #djs-questions
Bot posts randomly 1 - 3 welcome messages for the same member that already joined.
it's also not consistent for me, in old messages when i compare timestamps can be even 18 seconds difference, in messages 2 days ago is 2 seconds difference...
I also added bot to my other two servers and it works there fine, not that many people joins, but bot didn't post even one duplicated message so far.
I dont know if it is related in any way, but i took a suggestion from this message https://discord.com/channels/222078108977594368/1137513755840872449/1146228888180101180
I have enabled onboarding on the server where bot posts multiple messages, and disabled on servers where bot works fine (so far) 🤔
95 replies
DIAdiscord.js - Imagine a bot
•Created by MD on 8/5/2023 in #djs-questions
Bot posts randomly 1 - 3 welcome messages for the same member that already joined.
I increased rest timeout to 30 seconds, and it didn't change anything. My droplet network seems to be very stable. Also i don't see any ECONNRESET error in the logs.
I set up cronjob, to ping my other server on Google Cloud every 5 minutes and check time in which response came back, the highest delay was 378ms, and average around 150ms.
Bot still retries to post that messages
95 replies
DIAdiscord.js - Imagine a bot
•Created by MD on 8/5/2023 in #djs-questions
Bot posts randomly 1 - 3 welcome messages for the same member that already joined.
Ping to discord from the droplet
95 replies
DIAdiscord.js - Imagine a bot
•Created by MD on 8/5/2023 in #djs-questions
Bot posts randomly 1 - 3 welcome messages for the same member that already joined.
Me too, i host all of my bots on Digital Ocean, and only one bot has this issue. Problematic bot is on another droplet, but i created recently new droplet for this bot and problem still exists.
From my experience Digital Ocean has really good network speed and ping, compare to other hosting services, better has only Google Cloud
95 replies
DIAdiscord.js - Imagine a bot
•Created by MD on 8/5/2023 in #djs-questions
Bot posts randomly 1 - 3 welcome messages for the same member that already joined.
I have never changed any timeouts. I remember ECONNRESET error in the logs, but since i flushed the logs around a week ago, i don't see even one ECONNRESET error.
95 replies
DIAdiscord.js - Imagine a bot
•Created by MD on 8/5/2023 in #djs-questions
Bot posts randomly 1 - 3 welcome messages for the same member that already joined.
i just used this function to check latency:
and Roundtrip latency is 347ms
and ping 101 ms
95 replies
DIAdiscord.js - Imagine a bot
•Created by MD on 8/5/2023 in #djs-questions
Bot posts randomly 1 - 3 welcome messages for the same member that already joined.
node.js 18.16.1
95 replies
DIAdiscord.js - Imagine a bot
•Created by MD on 8/5/2023 in #djs-questions
Bot posts randomly 1 - 3 welcome messages for the same member that already joined.
idk if we can connect it with any API outages, but bot posted this 3 messages at <t:1693247160:f>
95 replies
DIAdiscord.js - Imagine a bot
•Created by MD on 8/5/2023 in #djs-questions
Bot posts randomly 1 - 3 welcome messages for the same member that already joined.
All other welcome messages has retries value 0, and ofc were not posted multiple times.
95 replies
DIAdiscord.js - Imagine a bot
•Created by MD on 8/5/2023 in #djs-questions
Bot posts randomly 1 - 3 welcome messages for the same member that already joined.
That is first log that showed something.
Bot posted 3 messages for that person
95 replies
DIAdiscord.js - Imagine a bot
•Created by MD on 8/5/2023 in #djs-questions
Bot posts randomly 1 - 3 welcome messages for the same member that already joined.
Yes, i updated discord.js to v14.13, and hoped that will fix the issue, but nothing changed.
I always try to keep my bots up to date and update all libraries at least once a month.
Hard to tell when exactly my bot started posting duplicated messages, because i deleted some of them, At the beginning it was very very rare, i remember i noticed it, but thought, maybe that member rejoined my server.
First duplicated messages i can see around March 2023, so around discord.js v14.8, but it started to be really annoying 2 - 3 months ago when bot started posting almost every message 2 - 3 times. Around 2 months ago I even reverted one of the library updates commits, but it didn't fix it either.
I will add
<Client>.rest.on(RESTEvents.Response, console.dir)
and come back with results.95 replies