bug: unable to start bot #41

Closed
opened 2026-02-16 12:26:51 -05:00 by yindo · 2 comments
Owner

Originally created by @nogegg on GitHub (Feb 9, 2026).

What happened?

Looked into porting my discord bot's code to Revolt/Stoat today but I haven't been able to launch even the template code provided in the readme:

import { Client } from "stoat.js";

let client = new Client();

client.on("ready", async () => {
	console.info(`User ID: ${client.user._id}!`);
	console.info(`Logged in as ${client.user.username}!`);
	console.info(`Bot online: ${client.user.online}!`);
	
	client.users.edit({
		status: {
			text: "Listening to you.",
			presence: "Idle",
		},
	});
	
	console.info(`Logged in as ${client.user.bot.status}!`);
});

client.on("message", async (message) => {
	if (message.content === "hello") {
		message.channel.sendMessage("world");
	}
});

client.loginBot(`removed`);

The following error appears if I try to launch it:

node:internal/event_target:1122
  process.nextTick(() => { throw err; });
                           ^

Error: Unhandled 'error' event emitted, received ErrorEvent {
  type: 'error',
  defaultPrevented: false,
  cancelable: false,
  timeStamp: 422.254331
}
    at Client.emit (file:///home/administrator/Toaster/node_modules/@vladfrangu/async_event_emitter/dist/index.mjs:2469:19)
    at EventClient.<anonymous> (file:///home/administrator/Toaster/node_modules/stoat.js/lib/Client.js:105:49)
    at EventClient.emit (file:///home/administrator/Toaster/node_modules/@vladfrangu/async_event_emitter/dist/index.mjs:2478:31)
    at #socket.onerror (file:///home/administrator/Toaster/node_modules/stoat.js/lib/events/EventClient.js:99:18)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:845:20)
    at WebSocket.dispatchEvent (node:internal/event_target:778:26)
    at fireEvent (node:internal/deps/undici/undici:12652:14)
    at #onSocketClose (node:internal/deps/undici/undici:13907:11)
    at Object.onSocketClose (node:internal/deps/undici/undici:13611:72)
    at failWebsocketConnection (node:internal/deps/undici/undici:13071:17) {
  context: ErrorEvent {
    Symbol(type): 'error',
    Symbol(kTarget): WebSocket {
      Symbol(kEvents): SafeMap(4) {
        'open' => <ref *1> {
          size: 1,
          next: Listener {
            next: undefined,
            previous: [Circular *1],
            listener: [Function (anonymous)],
            flags: 0,
            callback: [Function (anonymous)]
          },
          resistStopPropagation: false
        },
        'error' => <ref *2> {
          size: 1,
          next: Listener {
            next: undefined,
            previous: [Circular *2],
            listener: [Function (anonymous)],
            flags: 0,
            callback: [Function (anonymous)]
          },
          resistStopPropagation: false
        },
        'message' => <ref *3> {
          size: 1,
          next: Listener {
            next: undefined,
            previous: [Circular *3],
            listener: [Function (anonymous)],
            flags: 0,
            callback: [Function (anonymous)]
          },
          resistStopPropagation: false
        },
        'close' => <ref *4> {
          size: 1,
          next: Listener {
            next: undefined,
            previous: [Circular *4],
            listener: [Function (anonymous)],
            flags: 0,
            callback: [Function (anonymous)]
          },
          resistStopPropagation: false
        }
      },
      Symbol(events.maxEventTargetListeners): 10,
      Symbol(events.maxEventTargetListenersWarned): false,
      Symbol(kHandlers): SafeMap(0) {}
    },
    Symbol(kIsBeingDispatched): false,
    Symbol(kInPassiveListener): false
  }
}

Node.js v24.12.0

I've made sure that my Node JS version exceeds the one required and that it was running in ES module mode with no luck

Originally created by @nogegg on GitHub (Feb 9, 2026). ### What happened? Looked into porting my discord bot's code to Revolt/Stoat today but I haven't been able to launch even the template code provided in the readme: ```// This is a bot.js example. import { Client } from "stoat.js"; let client = new Client(); client.on("ready", async () => { console.info(`User ID: ${client.user._id}!`); console.info(`Logged in as ${client.user.username}!`); console.info(`Bot online: ${client.user.online}!`); client.users.edit({ status: { text: "Listening to you.", presence: "Idle", }, }); console.info(`Logged in as ${client.user.bot.status}!`); }); client.on("message", async (message) => { if (message.content === "hello") { message.channel.sendMessage("world"); } }); client.loginBot(`removed`); ``` The following error appears if I try to launch it: ``` node:internal/event_target:1122 process.nextTick(() => { throw err; }); ^ Error: Unhandled 'error' event emitted, received ErrorEvent { type: 'error', defaultPrevented: false, cancelable: false, timeStamp: 422.254331 } at Client.emit (file:///home/administrator/Toaster/node_modules/@vladfrangu/async_event_emitter/dist/index.mjs:2469:19) at EventClient.<anonymous> (file:///home/administrator/Toaster/node_modules/stoat.js/lib/Client.js:105:49) at EventClient.emit (file:///home/administrator/Toaster/node_modules/@vladfrangu/async_event_emitter/dist/index.mjs:2478:31) at #socket.onerror (file:///home/administrator/Toaster/node_modules/stoat.js/lib/events/EventClient.js:99:18) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:845:20) at WebSocket.dispatchEvent (node:internal/event_target:778:26) at fireEvent (node:internal/deps/undici/undici:12652:14) at #onSocketClose (node:internal/deps/undici/undici:13907:11) at Object.onSocketClose (node:internal/deps/undici/undici:13611:72) at failWebsocketConnection (node:internal/deps/undici/undici:13071:17) { context: ErrorEvent { Symbol(type): 'error', Symbol(kTarget): WebSocket { Symbol(kEvents): SafeMap(4) { 'open' => <ref *1> { size: 1, next: Listener { next: undefined, previous: [Circular *1], listener: [Function (anonymous)], flags: 0, callback: [Function (anonymous)] }, resistStopPropagation: false }, 'error' => <ref *2> { size: 1, next: Listener { next: undefined, previous: [Circular *2], listener: [Function (anonymous)], flags: 0, callback: [Function (anonymous)] }, resistStopPropagation: false }, 'message' => <ref *3> { size: 1, next: Listener { next: undefined, previous: [Circular *3], listener: [Function (anonymous)], flags: 0, callback: [Function (anonymous)] }, resistStopPropagation: false }, 'close' => <ref *4> { size: 1, next: Listener { next: undefined, previous: [Circular *4], listener: [Function (anonymous)], flags: 0, callback: [Function (anonymous)] }, resistStopPropagation: false } }, Symbol(events.maxEventTargetListeners): 10, Symbol(events.maxEventTargetListenersWarned): false, Symbol(kHandlers): SafeMap(0) {} }, Symbol(kIsBeingDispatched): false, Symbol(kInPassiveListener): false } } Node.js v24.12.0 ``` I've made sure that my Node JS version exceeds the one required and that it was running in ES module mode with no luck
yindo closed this issue 2026-02-16 12:26:51 -05:00
Author
Owner

@nogegg commented on GitHub (Feb 10, 2026):

Did more troubleshooting today and found that I can launch it (after changing my DNS settings) from my phone hotspot, and also found out I can't access any of Stoat's developer documentation outside of it either, so I'm pretty sure this is a Comcast problem and not a Stoat problem

@nogegg commented on GitHub (Feb 10, 2026): Did more troubleshooting today and found that I can launch it (after changing my DNS settings) from my phone hotspot, and also found out I can't access any of Stoat's developer documentation outside of it either, so I'm pretty sure this is a Comcast problem and not a Stoat problem
Author
Owner

@DeclanChidlow commented on GitHub (Feb 10, 2026):

Yeah, unfortunately a lot of ISPs and telcos are blocking us. We're working to get whitelisted with them. Glad you managed to get it sorted.

@DeclanChidlow commented on GitHub (Feb 10, 2026): Yeah, unfortunately a lot of ISPs and telcos are blocking us. We're working to get whitelisted with them. Glad you managed to get it sorted.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: stoatchat/javascript-client-sdk#41