Izzibaby
DIdiscord.js - Imagine ❄
•Created by Izzibaby on 1/7/2025 in #djs-questions
Require Vs Import, trying to "import" another script via the require method.
So I was following the discordjs.guide site on setting up the bot and they used require for everything,
Example ^
So now in one of my slash-commands I'm trying to get one of my scripts, which normally I'd do, for example:
However I need to choose require instead of import, and I followed the code along, so it's a bit too much for me to try and make all the rest of the code and the way it's written utilize the import feature versus require.
So I followed the same format as the others and wrote:
However now I'm getting the error:
Error: Cannot find module './apiAccess/hydra.js'
No matter what I do, it can't find it properly and I'm not sure what to change as I'm used to the import/export method, and attempting to figure out the require method for this.5 replies
DIdiscord.js - Imagine ❄
•Created by Izzibaby on 10/17/2024 in #djs-questions
DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE
I'm used to the old days of just doing commands with text in the chat !commands for example. Slash commands and such are quite new so I was going over the documentation page from Discord themselves, and have been trying to figure out "
DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE
".
I have this part.. but now I'm trying to figure out.. where do I end up sending the "DEFERRED_UPDATE_MESSAGE
" to update the message, and how do I do it specifically? There wasn't much on the topic of editing messages much in a clear way that I could figure out myself.19 replies