NyR
DIAdiscord.js - Imagine an app
•Created by Vitee. on 11/17/2024 in #djs-questions
Slash Command Not working
anyway...
- Show your command handler
- verify
client.commands
contain the said command (do you get the No matching command found... error on console?)
- verify interactionCreate is being fired at all?38 replies
DIAdiscord.js - Imagine an app
•Created by Vitee. on 11/17/2024 in #djs-questions
Slash Command Not working
yeah, so why are you listening to
interactionCreate
directly instead of using your handler38 replies
DIAdiscord.js - Imagine an app
•Created by chicken man on 11/17/2024 in #djs-questions
message event not working
Make sure you have invited the app with
bot
scope9 replies
DIAdiscord.js - Imagine an app
•Created by eveeifyeve on 11/16/2024 in #djs-questions
TS Bot Handlers not running with correct envs
Yes, because I don't see you using any of the properties of the said type, you already have the command data in your
data
property, extending it seems pointless44 replies
DIAdiscord.js - Imagine an app
•Created by eveeifyeve on 11/16/2024 in #djs-questions
TS Bot Handlers not running with correct envs
Why is your
SlashCommand
extending ChatInputApplicationCommandData
, i see no corelation there? You can just have it as a sole interface. And about your error, make sure you import the type where you are using it44 replies
DIAdiscord.js - Imagine an app
•Created by eveeifyeve on 11/16/2024 in #djs-questions
TS Bot Handlers not running with correct envs
I'm still not understanding, what does type has to do with importing dynamically, if you want to type the imported stuff, just do how i showed here ^
44 replies
DIAdiscord.js - Imagine an app
•Created by eveeifyeve on 11/16/2024 in #djs-questions
TS Bot Handlers not running with correct envs
What does type has to do with this?
44 replies
DIAdiscord.js - Imagine an app
•Created by eveeifyeve on 11/16/2024 in #djs-questions
TS Bot Handlers not running with correct envs
Yes
44 replies
DIAdiscord.js - Imagine an app
•Created by eveeifyeve on 11/16/2024 in #djs-questions
TS Bot Handlers not running with correct envs
44 replies
DIAdiscord.js - Imagine an app
•Created by eveeifyeve on 11/16/2024 in #djs-questions
TS Bot Handlers not running with correct envs
Well, as i said, it's asynchronous, so you'll need to resolve it's promise.
await it
44 replies
DIAdiscord.js - Imagine an app
•Created by eveeifyeve on 11/16/2024 in #djs-questions
TS Bot Handlers not running with correct envs
What's the error?
44 replies
DIAdiscord.js - Imagine an app
•Created by eveeifyeve on 11/16/2024 in #djs-questions
TS Bot Handlers not running with correct envs
In Bun's JavaScript runtime, require can be used by both ES Modules and CommonJS moduleshttps://bun.sh/docs/runtime/modules#module-systems So i suppose you can keep it as is, as long as you are planning to use Bun only
44 replies
DIAdiscord.js - Imagine an app
•Created by eveeifyeve on 11/16/2024 in #djs-questions
TS Bot Handlers not running with correct envs
It's asynchronous, so you'll have to make your function async
44 replies
DIAdiscord.js - Imagine an app
•Created by eveeifyeve on 11/16/2024 in #djs-questions
TS Bot Handlers not running with correct envs
Dynamic import
44 replies
DIAdiscord.js - Imagine an app
•Created by eveeifyeve on 11/16/2024 in #djs-questions
TS Bot Handlers not running with correct envs
I'm also confused, I see you using esm, but you are using
require
there, that should error, unless this is a bun feature which idk or some transforming is happening under the hood44 replies
DIAdiscord.js - Imagine an app
•Created by eveeifyeve on 11/16/2024 in #djs-questions
TS Bot Handlers not running with correct envs
That's the same thing, but as you can see, that's the default export and loading dynamically, you'll have to access the default property to get those,
So
const handler: ... = require(filepath).default
44 replies
DIAdiscord.js - Imagine an app
•Created by LuisTTV on 11/14/2024 in #djs-questions
client is undefined error
Button style is a number, not a string, use the
ButtonStyle
enum36 replies
DIAdiscord.js - Imagine an app
•Created by LuisTTV on 11/14/2024 in #djs-questions
client is undefined error
Also, i notice you creating an interactionCreate listener inside the XpOrTimeout function, that is a bad idea which will pretty soon lead to memory leak considering you call thay function in cron job, if you need a temporary listener, use a collector, otherwise handle it in your main
interactionCreate
event listener, you only ideally need one36 replies
DIAdiscord.js - Imagine an app
•Created by LuisTTV on 11/14/2024 in #djs-questions
client is undefined error
Please don't, AI is known to give outdated codes, thats why we have guides to help you and docs for stuff you may need, if you have confusion, you can always ask here
36 replies
DIAdiscord.js - Imagine an app
•Created by LuisTTV on 11/14/2024 in #djs-questions
client is undefined error
This also is relevant to you ^
36 replies