Getting started with Typescript and discord.js/voice
Hi, I presume that discord.js/voice is typescript only. Are there any recommended getting started tutorials for discord.js/voice?
I tried this one but after a few hours, I couldn't reconcile the commonjs/es module mess (I dare say it's worse than python) 😺
https://dev.to/fellipeutaka/creating-your-first-discord-bot-using-typescript-1eh6
Even just a
package.json
and tsconfig.json
for reference would be handy.
Thank you!
xoxo
Naomi3 Replies
- 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!
- ✅
Marked as resolved by OPits not typescript only you can use typescript dependencies with javascript
I suppose if I really wanted to be masochistic I could take that approach! LOL even then, I'd still be in the mess of having to compile the TS, and dealing with the myriad of combinations for the
All of this comes about since the
module
and target
settings . . .
In fact, npm run dev
and npm run build
works from that particular demo. npm run start
fails when js comes across the export
in the "compiled" (?) ts -> js files.All of this comes about since the
deploy-commands
is setup to execute when a guild is added, but that's not very useful for development.
I have multiple bots running using javascript informed by the main discord.js guides and documentation. But since discord.js/voice is typeface, I now need to explore this rabbit hole!
I think having a reference package.json
and tsconfig.json
files for discord.js/voice would be helpful, if anyone has those to share.
(I'm also trying sort out ts-node
, vs tsup
vs tsc
vs npx tsc
etc. -- this is def worse than python! 😸 LOL)
xoxo
Naomi 🖤
Aaaha ok. I will try that approach!