how can I load commands dynamically without require

I want to use an async sqlite module but that requires to use import and I can't import files inside code with it
11 Replies
d.js toolkit
d.js toolkitβ€’10mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Unknown User
Unknown Userβ€’10mo ago
Message Not Public
Sign In & Join Server To View
asdf
asdfβ€’10mo ago
I am using the thing from the guide to load commands from other files
Unknown User
Unknown Userβ€’10mo ago
Message Not Public
Sign In & Join Server To View
asdf
asdfβ€’10mo ago
You can't use the import keyword inside code right
d.js docs
d.js docsβ€’10mo ago
mdn import() The import() syntax, commonly called dynamic import, is a function-like expression that allows loading an ECMAScript module asynchronously and dynamically into a potentially non-module environment.
asdf
asdfβ€’10mo ago
I just want to use asqlite-async module but I can't use import if I don't set the type to module and idk how to dynamically load commands from files without require or should I use an sqlite module that isn't async?
gamer50082
gamer50082β€’10mo ago
smh you are trying not to send the code
asdf
asdfβ€’10mo ago
what code exactly So I just followed the tutorial in the website so what should I do to import modules that require import and don't work with require()
πŸŒΊπŸ‡«πŸ‡· Shigu :3 🌺
import() you should also await it