[PR #442] [MERGED] feat: telegram Set manually to avoid implicit call in or #577

Closed
opened 2026-02-26 21:31:52 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dreamhunter2333/cloudflare_temp_email/pull/442
Author: @dreamhunter2333
Created: 9/9/2024
Status: Merged
Merged: 9/9/2024
Merged by: @dreamhunter2333

Base: mainHead: feature/dev


📝 Commits (1)

  • c5e6c97 feat: telegram Set manually to avoid implicit call in or

📊 Changes

12 files changed (+42 additions, -6 deletions)

View changed files

📝 CHANGELOG.md (+4 -0)
📝 frontend/package.json (+1 -1)
📝 pages/package.json (+1 -1)
📝 vitepress-docs/docs/en/cli.md (+2 -0)
📝 vitepress-docs/docs/zh/guide/cli/worker.md (+2 -0)
📝 vitepress-docs/package.json (+1 -1)
📝 worker/package.json (+1 -1)
📝 worker/src/constants.ts (+1 -1)
📝 worker/src/telegram_api/telegram.ts (+6 -1)
📝 worker/src/types.d.ts (+1 -0)
📝 worker/src/utils.ts (+20 -0)
📝 worker/wrangler.toml.template (+2 -0)

📄 Description

User description

#441


PR Type

Enhancement, Documentation


Description

  • Added retrieval of botInfo from environment variable TG_BOT_INFO and set bot.botInfo if available to reduce latency.
  • Introduced getJsonObjectValue utility function to parse JSON values.
  • Updated Bindings type to include TG_BOT_INFO.
  • Documented new TG_BOT_INFO environment variable in both English and Chinese documentation.
  • Updated changelog to reflect the new feature for setting bot info.

Changes walkthrough 📝

Relevant files
Enhancement
telegram.ts
Set Telegram bot info from environment variable to reduce latency

worker/src/telegram_api/telegram.ts

  • Added retrieval of botInfo from environment variable TG_BOT_INFO.
  • Set bot.botInfo if botInfo is available to reduce latency.
  • Imported getJsonObjectValue utility function.
  • +6/-1     
    types.d.ts
    Add TG_BOT_INFO to Bindings type                                                 

    worker/src/types.d.ts

    • Added TG_BOT_INFO to Bindings type.
    +1/-0     
    utils.ts
    Add utility function to parse JSON values                               

    worker/src/utils.ts

    • Added getJsonObjectValue utility function to parse JSON values.
    +20/-0   
    Documentation
    CHANGELOG.md
    Update changelog with new bot info feature                             

    CHANGELOG.md

    • Updated changelog to include new feature for setting bot info.
    +4/-0     
    cli.md
    Document TG_BOT_INFO environment variable                               

    vitepress-docs/docs/en/cli.md

    • Documented new TG_BOT_INFO environment variable.
    +2/-0     
    worker.md
    Document TG_BOT_INFO environment variable in Chinese         

    vitepress-docs/docs/zh/guide/cli/worker.md

    • Documented new TG_BOT_INFO environment variable in Chinese.
    +2/-0     
    wrangler.toml.template
    Add TG_BOT_INFO to configuration template                               

    worker/wrangler.toml.template

    • Added TG_BOT_INFO to configuration template.
    +2/-0     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions


    🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

    ## 📋 Pull Request Information **Original PR:** https://github.com/dreamhunter2333/cloudflare_temp_email/pull/442 **Author:** [@dreamhunter2333](https://github.com/dreamhunter2333) **Created:** 9/9/2024 **Status:** ✅ Merged **Merged:** 9/9/2024 **Merged by:** [@dreamhunter2333](https://github.com/dreamhunter2333) **Base:** `main` ← **Head:** `feature/dev` --- ### 📝 Commits (1) - [`c5e6c97`](https://github.com/dreamhunter2333/cloudflare_temp_email/commit/c5e6c97b9927e4aaf8d426fdef63e49e5d6192dd) feat: telegram Set manually to avoid implicit call in or ### 📊 Changes **12 files changed** (+42 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+4 -0) 📝 `frontend/package.json` (+1 -1) 📝 `pages/package.json` (+1 -1) 📝 `vitepress-docs/docs/en/cli.md` (+2 -0) 📝 `vitepress-docs/docs/zh/guide/cli/worker.md` (+2 -0) 📝 `vitepress-docs/package.json` (+1 -1) 📝 `worker/package.json` (+1 -1) 📝 `worker/src/constants.ts` (+1 -1) 📝 `worker/src/telegram_api/telegram.ts` (+6 -1) 📝 `worker/src/types.d.ts` (+1 -0) 📝 `worker/src/utils.ts` (+20 -0) 📝 `worker/wrangler.toml.template` (+2 -0) </details> ### 📄 Description ### **User description** #441 ___ ### **PR Type** Enhancement, Documentation ___ ### **Description** - Added retrieval of `botInfo` from environment variable `TG_BOT_INFO` and set `bot.botInfo` if available to reduce latency. - Introduced `getJsonObjectValue` utility function to parse JSON values. - Updated `Bindings` type to include `TG_BOT_INFO`. - Documented new `TG_BOT_INFO` environment variable in both English and Chinese documentation. - Updated changelog to reflect the new feature for setting bot info. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>telegram.ts</strong><dd><code>Set Telegram bot info from environment variable to reduce latency</code></dd></summary> <hr> worker/src/telegram_api/telegram.ts <li>Added retrieval of <code>botInfo</code> from environment variable <code>TG_BOT_INFO</code>.<br> <li> Set <code>bot.botInfo</code> if <code>botInfo</code> is available to reduce latency.<br> <li> Imported <code>getJsonObjectValue</code> utility function.<br> </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/442/files#diff-a62d9c6ad0b04691396db4eecb38680ea80a2690f021e18baa6012ad525a27d3">+6/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>types.d.ts</strong><dd><code>Add TG_BOT_INFO to Bindings type</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/types.d.ts - Added `TG_BOT_INFO` to `Bindings` type. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/442/files#diff-583fb024d5c9d1efac71bbea788d8379e5e8fc2f0bb1696a9863c6f6cac54bee">+1/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>utils.ts</strong><dd><code>Add utility function to parse JSON values</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/utils.ts - Added `getJsonObjectValue` utility function to parse JSON values. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/442/files#diff-87b77c56897ffc7830773b3d665c51ecf2210b44921bef7098a1dd6d64e56db6">+20/-0</a>&nbsp; &nbsp; </td> </tr> </table></td></tr><tr><td><strong>Documentation</strong></td><td><table> <tr> <td> <details> <summary><strong>CHANGELOG.md</strong><dd><code>Update changelog with new bot info feature</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> CHANGELOG.md - Updated changelog to include new feature for setting bot info. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/442/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed">+4/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>cli.md</strong><dd><code>Document TG_BOT_INFO environment variable</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> vitepress-docs/docs/en/cli.md - Documented new `TG_BOT_INFO` environment variable. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/442/files#diff-3f8f72a691fa19c8581621e91cf67ad28855af7a57e58513f6563cf4c8886e5f">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>worker.md</strong><dd><code>Document TG_BOT_INFO environment variable in Chinese</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> vitepress-docs/docs/zh/guide/cli/worker.md - Documented new `TG_BOT_INFO` environment variable in Chinese. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/442/files#diff-f760a2ec5dad4b6bda0bd4a9325274567778add8cb984e73650dbaaf680c9178">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>wrangler.toml.template</strong><dd><code>Add TG_BOT_INFO to configuration template</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/wrangler.toml.template - Added `TG_BOT_INFO` to configuration template. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/442/files#diff-743273da72481b71fbeb1dddfd294be9249554eef65691dfc9bcfa9f0fd971fb">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
    kerem 2026-02-26 21:31:52 +03:00
    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#577
    No description provided.