Typescript Error 'typeof Client' incorrectly extends base class
Hi! Recently updated some packages and started running into this ts build error:
Packages list:
├── @types/node@20.16.13
├── @types/react-dom@18.3.1
├── @types/react@18.3.11
├── @types/ws@8.5.12
├── body-parser@1.20.3
├── cookie-parser@1.4.7
├── discord.js@14.16.3
├── express-session@1.18.1
├── express@4.21.1
├── https@1.0.0
├── react-dom@18.3.1
├── react@18.3.1
├── ts-loader@9.5.1
├── typescript@5.6.3
├── webpack-cli@5.1.4
└── webpack@5.95.0
4 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 OPIn case it is relevant, my tsconfig is pretty simple:
Well, I jumped forward from typescript 5.2.0-dev.20230804; it being a weird dev build was one of the reasons I updated. I'll try reverting to those other versions and get back to you
Looks like 5.5 works.
Now I just gotta typeguard my message.channel.sends
Let me check. The method I am using this in has the param specified as a TextBasedChannel, since that's what I was getting at the time
So maybe I just need to update the param type
Getting it from an interaction
Still looks like a TextBasedChannel type
Sorry, I was mixing two seperate examples. In one example, it's an interaction.channel, in the other it's a message coming from a messagecreate event
Most of my bot has been updated to use slash commands, but I still have some that just read chat
Either way, I'll be using that isSendable()
Thank you for your help
And bots don't get permission to send messages in GroupDMs?
I assume
👍🏻
Again, I appreciate your help
I thought I had, but I can double check later
Thanks for the follow-up