-
Notifications
You must be signed in to change notification settings - Fork 908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error When launch #1981
Comments
I'm facing the same issue on my node project. But when I try some dummy connection with Bun, it works. |
What is Bun? How to implement it |
https://bun.sh another js runtime import { Telegraf, Telegram } from "telegraf";
import { message } from "telegraf/filters";
const bot = new Telegraf('your token');
bot.start((ctx) => {
console.log('==========')
const message = ctx.update;
console.log(message)
console.log(message.message.entities)
// convert Unix time to Date time
console.log({ date: new Date(message.message.date * 1000) })
console.log('==========')
})
bot.launch();
console.log('Bot is running...'); |
telegraf is using old version of node-fetch (v2.7.0), so if you got the error ETIMEDOUT like me, downgrade to v18 will make telegraf work again |
Got the same issue .. |
@kubeplusplus node-fetch v3 only supports ESM packages, and Telegraf supports both CJS and ESM projects. Node has to implement this: Consider this fix? Using the latest version of Bun instead of Node might also work. If nothing else, downgrading to Node v18 until they implement/fix RFC 8305 (in v22, potentially backported to v20 LTS?) is an idea. |
Context
Error Message and Logs (
export DEBUG='telegraf:*'
)I think, this is a network/ISP problem. But when I tried to hit
it get respon, ok.
So, what do you think? Is it just a network problem, or is there another problem?
So is there a solution?
The text was updated successfully, but these errors were encountered: