Bot won't start no matter what (discordjs/core, discordjs/rest and discordjs/ws)

https://sourceb.in/RLr7zcg7Og - client.ts https://sourceb.in/pgbUy0pxiG - gateway.ts https://sourceb.in/xssyXZSDYj - worker.ts https://sourceb.in/8vsX9nteZ7 - rest.ts tried to log client.on(debug) and (error), also tried to log the dispatch event, nothing never gets logged
13 Replies
d.js toolkit
d.js toolkit2w ago
so friendly
so friendlyOP2w ago
latest version for the pacckages i listed
monbrey
monbrey2w ago
What does happen when you run this, assuming you're running client.ts? I'm not sure "ready" is accepted as an event name in core
so friendly
so friendlyOP2w ago
nothing, and i just kinda found the issue looks like bun is not compatible with WorkerShardingStrategy for some reason with SimpleShardingStrategy it works @ʎǝɹquoɯ do yk why it doesnt works with bun?
monbrey
monbrey2w ago
Nope, we don't test bun If it works it works
so friendly
so friendlyOP2w ago
ah thats quite sad
Amgelo
Amgelo2w ago
a /core bot is already a pretty lightweight application you shouldn't need another runtime like bun or deno just use node imho
so friendly
so friendlyOP2w ago
i just like bun lol been using it for 2 or 3 years tweaked some stuff here and there https://sourceb.in/UNZTIhGqSY - client.ts https://sourceb.in/fnc8fBI2Iy - gateway.ts (rest.ts stays the same ofc) https://sourceb.in/FFnNHtRWRz - event builder
PS C:\Users\arthu\OneDrive\KomonoCanary> bun run src/bot/client.ts
Ready!
Komono Canary
3 |
4 | export default new Event({
5 | name: "ready",
6 | type: GatewayDispatchEvents.Ready,
7 | async run(payload) {
8 | console.log(payload.data.user.username);
^
TypeError: undefined is not an object (evaluating 'payload.data.user')
at <anonymous> (C:\Users\arthu\OneDrive\KomonoCanary\src\bot\events\ready.ts:8:25)
at run (C:\Users\arthu\OneDrive\KomonoCanary\src\bot\events\ready.ts:7:13)
at emit (C:\Users\arthu\OneDrive\KomonoCanary\node_modules\@vladfrangu\async_event_emitter\dist\index.mjs:272:37)
at <anonymous> (C:\Users\arthu\OneDrive\KomonoCanary\src\bot\client.ts:19:10)
at emit (C:\Users\arthu\OneDrive\KomonoCanary\node_modules\@vladfrangu\async_event_emitter\dist\index.mjs:272:37)
at emit (C:\Users\arthu\OneDrive\KomonoCanary\node_modules\@vladfrangu\async_event_emitter\dist\index.mjs:264:31)
at <anonymous> (C:\Users\arthu\OneDrive\KomonoCanary\node_modules\@discordjs\ws\dist\index.mjs:1052:14)

Bun v1.2.7 (Windows x64)
PS C:\Users\arthu\OneDrive\KomonoCanary> bun run src/bot/client.ts
Ready!
Komono Canary
3 |
4 | export default new Event({
5 | name: "ready",
6 | type: GatewayDispatchEvents.Ready,
7 | async run(payload) {
8 | console.log(payload.data.user.username);
^
TypeError: undefined is not an object (evaluating 'payload.data.user')
at <anonymous> (C:\Users\arthu\OneDrive\KomonoCanary\src\bot\events\ready.ts:8:25)
at run (C:\Users\arthu\OneDrive\KomonoCanary\src\bot\events\ready.ts:7:13)
at emit (C:\Users\arthu\OneDrive\KomonoCanary\node_modules\@vladfrangu\async_event_emitter\dist\index.mjs:272:37)
at <anonymous> (C:\Users\arthu\OneDrive\KomonoCanary\src\bot\client.ts:19:10)
at emit (C:\Users\arthu\OneDrive\KomonoCanary\node_modules\@vladfrangu\async_event_emitter\dist\index.mjs:272:37)
at emit (C:\Users\arthu\OneDrive\KomonoCanary\node_modules\@vladfrangu\async_event_emitter\dist\index.mjs:264:31)
at <anonymous> (C:\Users\arthu\OneDrive\KomonoCanary\node_modules\@discordjs\ws\dist\index.mjs:1052:14)

Bun v1.2.7 (Windows x64)
what is going on chat 😭
Amgelo
Amgelo2w ago
could you try running in node just in case, no idea if that'll fix it but worth a try
so friendly
so friendlyOP2w ago
aaa, ok ill see what i guess i forgot to remove the manual emit cause i was trying to use worker stuff lelll thank you @Jiralite 🙏
Argument of type 'ToEventProps<APIInteraction>' is not assignable to parameter of type 'APIChatInputApplicationCommandInteraction'.
Type 'ToEventProps<APIInteraction>' is missing the following properties from type 'APIBaseInteraction<InteractionType.ApplicationCommand, APIChatInputApplicationCommandInteractionData>': id, application_id, type, token, and 6 more.ts(2345)
(parameter) interaction: ToEventProps<APIInteraction>
Argument of type 'ToEventProps<APIInteraction>' is not assignable to parameter of type 'APIChatInputApplicationCommandInteraction'.
Type 'ToEventProps<APIInteraction>' is missing the following properties from type 'APIBaseInteraction<InteractionType.ApplicationCommand, APIChatInputApplicationCommandInteractionData>': id, application_id, type, token, and 6 more.ts(2345)
(parameter) interaction: ToEventProps<APIInteraction>
how should I fix that
Amgelo
Amgelo2w ago
I think you forgot to destructure it can you show your code
so friendly
so friendlyOP2w ago
Prob that lol Mind telling me how As im quite new to core stuff
Amgelo
Amgelo2w ago
I'm pretty sure the README has a full example with interactions you should only need to copy and paste quite literally at most change var names ig

Did you find this page helpful?