[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\u003cp\u003eDialogflow Telegram Integration enables the creation of Telegram bots that utilize natural language understanding through Dialogflow technology.\u003c/p\u003e\n"],["\u003cp\u003eSetting up the integration involves creating a bot via Telegram's BotFather and then linking it to Dialogflow by entering the generated access token within the Dialogflow integration settings.\u003c/p\u003e\n"],["\u003cp\u003eThe integration supports specific events like \u003ccode\u003eTELEGRAM_WELCOME\u003c/code\u003e, \u003ccode\u003eTELEGRAM_HELP\u003c/code\u003e, and \u003ccode\u003eTELEGRAM_SETTINGS\u003c/code\u003e, which are triggered by user actions such as starting a conversation or typing specific commands.\u003c/p\u003e\n"],["\u003cp\u003eImage, card, quick reply, and custom payload messages are supported as rich response messages, with formatting and hyperlinks available for text responses, and inline keyboard buttons can be implemented.\u003c/p\u003e\n"],["\u003cp\u003eOnly the default agent language set within Dialogflow is supported by this integration.\u003c/p\u003e\n"]]],[],null,["# Telegram\n\nDialogflow Telegram Integration allows you to easily create Telegram bots with\nnatural language understanding based on the Dialogflow technology.\n\n\n| **Note:** When using a third party integration, requests and end-user data are sent to both Google and the third party. The terms of service, SLA, pricing, and quotas [for your agent edition](/dialogflow/docs/editions) are applicable for Google's handling of these requests. The third party's terms of service, SLA, pricing, and quotas are applicable for the third party's handling of these requests.\n\n\u003cbr /\u003e\n\nLimitations\n-----------\n\nOnly the\n[default agent language](/dialogflow/es/docs/agents-settings#lang)\nis supported by this integration.\n\nSetting Up Telegram\n-------------------\n\nIn order to set up the Telegram integration for your agent, you'll need the\nfollowing:\n\n- a [Telegram account](https://web.telegram.org/#/login).\n\n### Creating a Bot in Telegram\n\n1. Login to Telegram and go to \u003chttps://telegram.me/botfather\u003e\n2. Click the **Start** button in the web interface or type /start\n3. Click on or type **/newbot** and enter a name\n4. Enter a username for the bot, ending in \"bot\" (e.g. garthsweatherbot)\n5. Copy the generated access token \n\nSetting Up Dialogflow\n---------------------\n\n1. In Dialogflow, go to **Integrations** in the left hand menu\n2. Click on the **Telegram** tile\n3. Paste the **Access Token** into the related field\n4. Click the **Start** button \n\nTesting\n-------\n\nBotFather will provide a link to your bot once you've completed the setup. Go to\nthis link to test out your agent. \n\nRegenerating Telegram Token\n---------------------------\n\nTo regenerate the Telegram token for an agent with Telegram integration enabled,\ndo the following:\n\n1. Go to the Dialogflow integration settings and click **STOP**.\n2. Regenerate the token in Telegram.\n3. Enter the new Telegram token in the integration settings and click **START**.\n\nIntegrating Agent with a New Telegram Bot\n-----------------------------------------\n\nFor an agent with Telegram integration enabled, to link it to a new Telegram bot,\ndo the following:\n\n1. Go to the Dialogflow integration settings and click **STOP**.\n2. Delete the old bot in Telegram if needed.\n3. Enter the new Telegram token in the integration settings and click **START**.\n\nEvents\n------\n\nThe following [events](/dialogflow/docs/events-overview)\nare triggered by this integration:\n\nRich response messages\n----------------------\n\nThe following\n[rich response messages](/dialogflow/docs/intents-rich-messages)\nare supported.\n\n### Image responses\n\nSupported formats and sizes:\n\n- 5 MB max size\n\n### Card responses\n\nEither the image URL field or the title field is mandatory.\n\nButtons with a URL and with a text postback are supported. When tapped, a button with a URL will open a web page, whereas a button with text will send the text as a user query.\n\n### Quick reply responses\n\nQuick replies in one-click Telegram integrations correspond to [keyboard buttons in Telegram](https://core.telegram.org/bots/api/#keyboardbutton).\n\nWhen a user clicks one of the buttons, the buttons are dismissed. This prevents the issue where users could click buttons that are attached to old messages in a conversation.\n\n### Custom payload responses\n\n**Formatted text and hyperlinks in one-click Telegram integration**\n\nYour Telegram bots can send formatted text and hyperlinks.\n\nThe following example sends formatted text with a hyperlink using the Markdown parsing mode: \n\n```transact-sql\n{\n \"telegram\": {\n \"text\": \"You can read about *entities* [here](/docs/concept-entities).\",\n \"parse_mode\": \"Markdown\"\n }\n}\n```\n\nSee the [Telegram documentation](https://core.telegram.org/bots/api#formatting-options) for reference.\n\n##### Inline Keyboard Buttons\n\nThe following example shows how you can define [Inline Keyboard buttons](https://core.telegram.org/bots/api#inlinekeyboardmarkup) in the Custom payload element. \n\n```scdoc\n{\n \"telegram\": {\n \"text\": \"Pick a color\",\n \"reply_markup\": {\n \"inline_keyboard\": [\n [\n {\n \"text\": \"Red\",\n \"callback_data\": \"Red\"\n }\n ],\n [\n {\n \"text\": \"Green\",\n \"callback_data\": \"Green\"\n }\n ],\n [\n {\n \"text\": \"Yellow\",\n \"callback_data\": \"Yellow\"\n }\n ],\n [\n {\n \"text\": \"Blue\",\n \"callback_data\": \"Blue\"\n }\n ],\n [\n {\n \"text\": \"Pink\",\n \"callback_data\": \"Pink\"\n }\n ]\n ]\n }\n }\n}\n```"]]