TS2339: Property 'send' does not exist on type 'Channel'.
See original GitHub issueJust installed this lib and I’m getting TS2339: Property 'send' does not exist on type 'Channel'.
I guess you need to update the types.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Property does not exist on type Request in TypeScript
The "Property does not exist on type Request" error occurs when we access a property that does not exist in the Request interface....
Read more >cast or convert GuildChannel to TextChannel-discord.js
If you are using Typescript and are getting the error Property 'send' does not exist on type 'GuildChannel'.ts(2339) . You can fix this...
Read more >error ts2339: property 'findoperator' does not exist on type nestjs
To fix the error “TS2339: Property 'x' does not exist on type 'Y'” with TypeScript, we should make sure the properties are listed...
Read more >Build a 100 Days of Code Discord Bot with TypeScript ...
This is because while we know the environment variable exists, TypeScript still cannot infer it. The validation function is set up to exit...
Read more >How to resolve the error ' Error:(54,6) TS2339:property 'name ...
How do I resolve the error " Error:(54,6) TS2339:property 'name' does not exist on type ' {}' " in JavaScript?
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The
Channel
class does not have asend
method, because categories and voice channels are also a child classes of theChannel
class. When you’re certain you have a text channel you can cast it to a TextChannel like so:You have to import
TextChannel
from the discord.js library for it to work.For further questions please come by the official Discord server.
the tutorial says this: https://discordjs.guide/popular-topics/common-questions.html#how-do-i-send-a-message-to-a-certain-channel I guess the tutorial is wrong in this case.
I think the casting solution is just a hack, not a proper solution or I am wrong?