[GH-ISSUE #441] [Feature] 建议在 newTelegramBot 函数内初始化 botInfo,可以节约一次查询 #159

Closed
opened 2026-02-26 20:35:56 +03:00 by kerem · 2 comments
Owner

Originally created by @toadfans on GitHub (Sep 4, 2024).
Original GitHub issue: https://github.com/dreamhunter2333/cloudflare_temp_email/issues/441

请描述您的 Feature

telegraf 会在 handleUpdate 内查询一次 getMe(),可以通过设置 botInfo 跳过,回调接口会稍微快一点

https://github.com/dreamhunter2333/cloudflare_temp_email/blob/main/worker/src/telegram_api/index.ts#L35

https://github.com/telegraf/telegraf/blob/v4/src/telegraf.ts#L329-L333

描述您想要的解决方案

https://github.com/dreamhunter2333/cloudflare_temp_email/blob/main/worker/src/telegram_api/telegram.ts#L47

这里加入

bot.botInfo = {...BOT_INFO}

附加上下文

Originally created by @toadfans on GitHub (Sep 4, 2024). Original GitHub issue: https://github.com/dreamhunter2333/cloudflare_temp_email/issues/441 ## 请描述您的 Feature telegraf 会在 handleUpdate 内查询一次 getMe(),可以通过设置 botInfo 跳过,回调接口会稍微快一点 https://github.com/dreamhunter2333/cloudflare_temp_email/blob/main/worker/src/telegram_api/index.ts#L35 https://github.com/telegraf/telegraf/blob/v4/src/telegraf.ts#L329-L333 ## 描述您想要的解决方案 https://github.com/dreamhunter2333/cloudflare_temp_email/blob/main/worker/src/telegram_api/telegram.ts#L47 这里加入 bot.botInfo = {...BOT_INFO} ## 附加上下文
kerem 2026-02-26 20:35:56 +03:00
Author
Owner

@dreamhunter2333 commented on GitHub (Sep 4, 2024):

感谢反馈,我之后加上测试一下

<!-- gh-comment-id:2329511229 --> @dreamhunter2333 commented on GitHub (Sep 4, 2024): 感谢反馈,我之后加上测试一下
Author
Owner

@dreamhunter2333 commented on GitHub (Sep 9, 2024):

main 分支已增加

<!-- gh-comment-id:2338333897 --> @dreamhunter2333 commented on GitHub (Sep 9, 2024): main 分支已增加
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cloudflare_temp_email#159
No description provided.