#Using discord.js in Deno?

1 messages · Page 1 of 1 (latest)

oblique falcon
#

Apparently Deno supports discord.js now. Awesome. But now I can't make it work.

According to debug logs, the Websocket connection is timing out. What could be happening?

#

If I shut off my internet, nothing happens so it's on Deno's side I assume.

#

@swift breach Maybe you can help? I'll make an issue, but for now might as well ask.

This is my logs:

Debug: Preparing to connect to the gateway...
Debug: [WS => Manager] Manager was destroyed. Called by:
Error
    at WebSocketManager.destroy (file:///C:/Users/erisf/llm-bot/llm-bot/node_modules/.deno/[email protected]/node_modules/discord.js/src/client/websocket/WebSocketManager.js:326:54)
    at Client.destroy (file:///C:/Users/erisf/llm-bot/llm-bot/node_modules/.deno/[email protected]/node_modules/discord.js/src/client/Client.js:251:13)
    at Client.login (file:///C:/Users/erisf/llm-bot/llm-bot/node_modules/.deno/[email protected]/node_modules/discord.js/src/client/Client.js:229:12)
    at eventLoopTick (ext:core/01_core.js:197:13)
    at async file:///C:/Users/erisf/llm-bot/llm-bot/basic_test.mjs:19:1

My code:

import { Client, Events } from "npm:discord.js";

import { config } from "dotenv";

// Begin variable definitions

config();

const client = new Client({
  intents: []
});

client.on(Events.ClientReady, () => {
    console.log(`Logged in as ${client.user.tag}!`);
  });

client.on(Events.Debug, (message) => console.log("Debug:", message)); // Listen for debug messages

await client.login("You_Cannot_Have_My_Token"); // Yes, I pass in a valid token.
swift breach
#

I really haven't checked myself and I got some other high priority work that I need to look into. I'm gonna defer to @pastel spindle to handle this

oblique falcon
#

UPDATE: So I made a new VSCode project and it works.

#

What The Fuck Part 1

oblique falcon
#

It's happening again!

undone falcon
oblique falcon
#

I've moved it to an external server and it's fine now.

balmy dew
#

I use Discordeno. Never had a problem

oblique falcon
#

which they support now

untold light
#

note: npm:discord.js doesn't work on windows but it works on wsl ubuntu

pastel spindle
#

havent had the chance yet to investigate. I'll make myself a slot for the coming week to look into this