0

i have a basic Discord.js application in a nodejs project. When i launch my file via node client.js everything works completly fine, the bot listens to messages/commands and events at all. But after compiling my app to an executable (with node module pkg) the client doesnt work anymore.

I debugged quiet a lot and the mysterious thing is that the ready event does fire on the client, but nothing else. In my ready event i've got a client.user.setActivity('listening') but that gives an error that it cannot read property of .setActivity (Debug of client.user was equal to null).

You may ask why i want an executable to start my discord bot, well its my project :)

  • Do you catch the "ready" event in your main-file or do you use an eventhandler with a structuring of the events? – Toasty Apr 01 '21 at 06:43
  • I catch the "ready" event in the main process. I think Discord.js doesnt work in an executable, can you try it on your own? Just a simple discordjs app and compile it with pkg to an executable – Trebossa Blue Apr 01 '21 at 15:13
  • I would but I’m not at home rn. You can have a look at [my discord bot](https://github.com/Toasty65/Discord-Bot/tree/develop) – Toasty Apr 01 '21 at 15:26

0 Answers0