Skip to content

Tag: node.js

Sharding Crashing On Shard 0 Discordjs

I am trying to shard my discord bot in v13, and when I run just the main file (bot.js) on my beta bot without sharding, it works fine, but when I try running it with sharding, It gives this error. Here is the index.js code where I shard When I try running just bot.js without sharding, it gives the error

how to return in connection.query

I have a problem… I wanted to return “A” but The result was “B” I don’t know what to do Please help me my code: My results Answer You are mixing here callback with promises. To reach what you want, wrap your function in a promise: