简体   繁体   中英

Discord.js bot with cluster responding several times

I have a discord bot done with discord.js and I decided to use cluster on it, but it is responding several times, can someone help me?

from what it looks like, cluster is a way to multithread nodejs, so the same request is getting passed to multiple threads and they all respond with the same message. Make sure the message only gets passed to one thread

Discord.js have it owner to take advantage of multithread is call sharding Docs it here

Try this instead of using cluster for multithread

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM