-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm:discord.js hangs #17391
Comments
What is the command that you use to run this program? |
Here's my deno.jsonc file: {
"tasks": {
"dev": "deno run --allow-read --allow-env --allow-net --watch main.ts",
"start": "deno run --allow-read --allow-env --allow-net --no-check main.ts"
}
} I tried with both tasks |
Does the problem go away if you add |
Nothing happens, both in repl.it and in my machine, the returned promise from method |
But you don't get error about missing |
You're right, no errors. But the bot doesn't initialize, in node it does. |
@ghaerdi You want to listen for debug events to see more details about what's going wrong, see the example below:
@bartlomieju I investigated this issue and determined that this "hanging" is simply due to a persistent connection error that causes |
Thank you for the debug display client.on(Events.Debug, (message) => console.log("Debug:", message)); // Listen for debug messages I was fighting against this "hanging" without understanding what was going on. |
Is there any updates about it? |
With #19412 merged this is now supported. Will be released in v1.34.3 later this week. |
Summary
I found a bug by trying to create a discord bot in Deno using the discord.js package from npm.
I ran the following code (replacing the empty string in the line 3):
I got the following error in repl.it:
But if I run the same code in my machine it doesn't output any error but it also doesn't initialize the bot, it just freeze in the last line.
The code should initialize the bot by changing bot status to online in discord, output in console "Logged in as {bot name and tag}" and if someone write "/ping" on a discord server (where is the bot) the bot should response with "pong". In node it runs as I described.
Specs
Repl.it
Deno version: 1.28.3
My Machine
Deno version: 1.29.2
OS: Arch Linux on WSL
The text was updated successfully, but these errors were encountered: