Open Daniele-Tentoni opened 3 years ago
I had the same issue with JetBrain's WebStorm IDE. It's simply because the IDE is not smart enough to figure it out. You can disable the inspection for that method to remove the warning. The developers of telebot could JSDoc the methods such that IDEs figure it out.
bot.sendMessage is not a function
Hi all, probably is a problem with my entry level of Javascript. I made a module with a sample code for webhook bot:
And then required it in main module:
But console log me that bot.sendMessage is not a function.
Solution proposal
The solution I made was to create a new function:
and then call it in main module:
Question
Is this the only solution can be made? There's one better than this?