Communication
Telegram Bot
30 min
telegram is a cloud based instant messaging service that offers secure, encrypted communication, media sharing, and group chat capabilities with the telegram bot modules in {{product name}} , you can manage messages, share various media types, and send media by url or id, edit media messages and message captions, download files, and perform other actions requirements to use the telegram bot app in {{product name}} , you must have a telegram account on a desktop app in order to use the telegram app, you have to provide your mobile phone number connect telegram bot and {{product name}} to create the connection between telegram bot and {{product name}} , you need to telegram bot /#connect telegram bot and telegram bot /#create the connection in configure the telegram bot go to https //telegram me/botfather https //telegram me/botfather to create a new bot type /newbot to the message box and press enter enter the username of your new bot you will receive the message from botfather containing the token copy the token value and store it in a safe place you'll use this value in the token connection field in {{product name}} to add your bot to your telegram app, click the link in the message from botfather or enter it manually into your browser the link is t me/yourbotname create the connection in {{product name}} once you have your telegram bot token, you're ready to create the connection in {{product name}} to create the connection log in to your {{product name}} account, add a telegram bot module to your {{scenario singular lowercase}} , and click create a connection if you add a module with an instant tag, click create a webhook , then create a connection optional in the connection name field, enter a name for the connection in the token field, enter the token you copied from your telegram bot account click save if prompted, authenticate your account and confirm access you've successfully created the connection and can now use the telegram bot app in your {{scenario plural lowercase}} if you want to make changes to your connection in the future, follow the steps here https //help make com/connect an application#tn2pj set up a telegram bot webhook the telegram bot app has an instant watch updates module that uses a webhook to instantly trigger a {{scenario singular lowercase}} in {{product name}} following updates in telegram to set up the webhook add an instant watch updates module to your {{scenario singular lowercase}} and click create a webhook optional enter a name for the webhook in the webhook name field i n the connection field, select a connection for the webhook if you haven't created a telegram bot connection yet, refer to the telegram bot /#connect telegram bot and section above in the token field, enter the token you copied from your telegram bot account click save your webhook is now set up when the selected change occurs in telegram, {{product name}} will immediately be notified and start your {{scenario singular lowercase}} telegram bot modules after connecting to the telegram bot app, you can use the following types of modules to build your {{scenario plural lowercase}} messages send a text message or reply sends a text message or a reply to your telegram desktop application connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh user id telegram bot docid\ nptqhp7q3erwnrp2cxqvh text enter (or map) the text content of the message you want to send message thread id a unique identifier for the forum's target message thread (topic) applicable for forum supergroups only parse mode specify how you want your text to be recognized html or markdown markdown syntax html syntax disable notifications select whether you want to send messages silently ios users will not receive a notification; android users will receive a notification with no sound disable link previews select whether you want to disable link previews for links in this message original message id the id of the original message if the message is a reply enter/assemble the reply markup field enter additional interface options that are a json serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user, e g more information about custom keyboards can be found on the telegram bot api page reply markup enter additional interface options that are a json serialized object, including an inline keyboard, a custom reply keyboard, instructions to remove the reply keyboard, or instructions to force a reply from the user, e g {"inline keyboard" \[\[{"text" "some button text 2","url" "https //botpress org"}]]} or {"keyboard" \[\["yes","no"],\["maybe"]]} the keyboard cannot be used with channels edit a text message edits text or game messages connection telegram bot /#configure the telegram bot edit select the message type you want to edit chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh message id enter the message id you want to forward text enter (or map) the text content of the message you want to send parse mode specify how you want your text to be recognized html or markdown markdown syntax html syntax disable link previews select whether you want to disable link previews enter/assemble the reply markup field enter additional interface options that are a json serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user, e g more information about custom keyboards can be found on the telegram bot api page reply markup enter additional interface options that are a json serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user, e g more information about custom keyboards can be found on the telegram bot api page keyboards cannot be used with channels forward a message forwards messages of any kind this module can be used to forward messages only within telegram connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh from chat id enter the chat id where the original message was sent (or channel username in the format @channelusername) message id enter the message id of the message you want to forward in the from chat id format disable notifications select whether you want to send the message silently ios users will not receive a notification; android users will receive a notification with no sound delete a message deletes a message a message can only be deleted if it was sent less than 48 hours ago only a message sent less than 48 hours ago can be deleted connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh message id enter the message id you want to delete pin a message pins a message connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh message id enter the message id you want to pin disable notifications select whether you want to disable the notifications if selected yes , sends the message silently ios users will not receive a notification, android users will receive a notification with no sound unpin a message unpins a message connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh message id enter the message id you want to unpin media send an audio file sends an audio file to your telegram desktop application connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh message thread id a unique identifier for the target message thread (topic) of the forum for forum supergroups only caption enter the caption of the audio send by audio file to send pass a file id as a string to send an audio file that exists on the telegram servers (recommended), pass an http url as a string for telegram to get an audio file from the internet, or upload a new one using multipart/form data further details about sending audio files can be found on the telegram bot api page for example, you can use your dropbox to process the file parse mode select markdown style or html style of the text, if you want telegram apps to show bold, italic, fixed width text or inline urls in your bot's message disable notification select yes to send messages silently ios users will not receive a notification, android users will receive a notification with no sound duration enter the duration of the video sent in seconds performer enter a performer title enter a track name reply markup additional interface options enter additional interface options that are a json serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user, e g more information about custom keyboards can be found on the telegram bot api page content type select or enter the mime type of data send a document or an image sends a document or an image to your telegram desktop application connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh message thread id a unique identifier for the target message thread (topic) of the forum for forum supergroups only caption enter the caption of the audio send by image file to send pass a file id as a string to send a file that exists on the telegram servers (recommended), pass an http url as a string for telegram to get a file from the internet, or upload a new one using multipart/form data further details about sending files can be found on the telegram bot api https //core telegram org/bots/api page parse mode specify how you want your text to be recognized html or markdown markdown syntax html syntax disable notification select yes to send messages silently ios users will not receive a notification, android users will receive a notification with no sound content type select or enter the mime type of data id of the original message the id of the original message if the message is a reply reply markup additional interface options enter additional interface options that are a json serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user, e g more information about custom keyboards can be found on the telegram bot api page send an album sends a group of photos or videos as an album connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh media select the items you want to add to your album message thread id a unique identifier for the target message thread (topic) of the forum applicable only for forum supergroups only disable notification select yes to send messages silently ios users will not receive a notification, android users will receive a notification with no sound enter/assemble the reply markup field select the option to enter or assemble the reply markup field reply markup enter additional interface options that are a json serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user, e g more information about custom keyboards can be found on the telegram bot api page send a photo sends a photo to your telegram desktop application connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh message thread id a unique identifier for the target message thread (topic) of the forum for forum supergroups only caption enter the caption of the video send by image file to send pass a file id as a string to send a file that exists on the telegram servers (recommended), pass an http url as a string for telegram to get a file from the internet, or upload a new one using multipart/form data further details about sending files can be found on the telegram bot api https //core telegram org/bots/api page parse mode specify how you want your text to be recognized html or markdown markdown syntax html syntax id of the original message id of the original message if the message is a reply reply markup additional interface options enter additional interface options that are a json serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user, e g more information about custom keyboard can be found on the telegram bot api page send a sticker sends a webp sticker to your telegram desktop application connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh message thread id a unique identifier for the target message thread (topic) of the forum for forum supergroups only send by image file to send pass a file id as a string to send a file that exists on the telegram servers (recommended), pass an http url as a string for telegram to get a file from the internet, or upload a new one using multipart/form data further details about sending files can be found on the telegram bot api https //core telegram org/bots/api page disable notifications select yes to send messages silently ios users will not receive a notification, android users will receive a notification with no sound original message id id of the original message if the message is a reply reply markup enter additional interface options that are a json serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user, e g more information about custom keyboards can be found on the telegram bot api page send a video sends a video file to your telegram desktop application connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh message thread id a unique identifier for the target message thread (topic) of the forum for forum supergroups only caption enter the caption of the video send by image file to send pass a file id as a string to send a file that exists on the telegram servers (recommended), pass an http url as a string for telegram to get a file from the internet, or upload a new one using multipart/form data further details about sending files can be found on the telegram bot api https //core telegram org/bots/api page disable notification select yes to send messages silently ios users will not receive a notification, android users will receive a notification with no sound content type select or enter the mime type of data duration enter the duration of the video sent in seconds width enter the video width height enter the video height enter/assemble the reply markup field select if to enter or assemble the reply markup field reply markup enter additional interface options that are a json serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user, e g more information about custom keyboards can be found on the telegram bot api page send a video note as of v4 0, telegram clients support rounded square mp4 videos of up to one minute long use this method to send video messages connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh message thread id a unique identifier for the forum's target message thread (topic) for forum supergroups only send by image file to send pass a file id as a string to send a file that exists on the telegram servers (recommended), pass an http url as a string for telegram to get a file from the internet, or upload a new one using multipart/form data further details about sending files can be found on the telegram bot api https //core telegram org/bots/api page disable notification select yes to send messages silently ios users will not receive a notification, android users will receive a notification with no sound content type select or enter the mime type of data length video width and height, i e , the diameter of the video message duration enter the duration of the sent video (in seconds) original message id id of the original message if the message is a reply enter/assemble the reply markup field select if to enter or assemble the reply markup field reply markup enter additional interface options that are a json serialized object including an inline keyboard, a custom reply keyboard, instructions to remove the reply keyboard, or instructions to force a reply from the user, e g {"inline keyboard" \[\[{"text" "some button text 2","url" "https //botpress org"}]]} or {"keyboard" \[\["yes","no"],\["maybe"]]} note keyboard cannot be used with channels send a voice message send a voice message connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh message thread id a unique identifier for the forum's target message thread (topic) for forum supergroups only caption enter the caption of the voice message send by image file to send pass a file id as a string to send a file that exists on the telegram servers (recommended), pass an http url as a string for telegram to get a file from the internet, or upload a new one using multipart/form data further details about sending files can be found on the telegram bot api https //core telegram org/bots/api page disable notification select yes to send messages silently ios users will not receive a notification, android users will receive a notification with no sound content type select or enter the mime type of data duration enter the duration of the video sent in seconds enter/assemble the reply markup field select if to enter or assemble the reply markup field reply markup enter additional interface options that are a json serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user, e g more information about custom keyboards can be found on the telegram bot api page edit a media message edits photo or video messages connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh message id enter the message id of the message you want to edit media type select whether you want to edit a photo or video caption enter the photo/video caption source file define the source file you want to edit more information about working with files docid\ oauioo6oujv0fyglzmrte parse mode specify how you want your text to be recognized html or markdown markdown syntax html syntax enter/assemble the reply markup field select whether to enter or assemble the reply markup field reply markup enter additional interface options that are a json serialized object including an inline keyboard, a custom reply keyboard, instructions to remove the reply keyboard or instructions to force a reply from the user, e g {"inline keyboard" \[\[{"text" "some button text 2","url" "https //botpress org"}]]} or {"keyboard" \[\["yes","no"],\["maybe"]]} keyboard cannot be used with channels edit a message caption edits a caption of a message connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh message id enter the message id to edit its caption caption enter the caption of the message parse mode specify how you want your text to be recognized html or markdown markdown syntax html syntax enter/assemble the reply markup field select whether to enter or assemble the reply markup field reply markup enter additional interface options that are a json serialized object including an inline keyboard, a custom reply keyboard, instructions to remove the reply keyboard or instructions to force a reply from the user, e g {"inline keyboard" \[\[{"text" "some button text 2","url" "https //botpress org"}]]} or {"keyboard" \[\["yes","no"],\["maybe"]] } note keyboard cannot be used with channels send an invoice sends an invoice connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh title enter the product name for which you want to send invoice description enter the product details payload a bot defined invoice payload, 1 128 bytes this will not be displayed to the user, use for your internal processes provide token payment provider token, obtained via @botfather currency three letter iso 4217 currency code, see more on currencies https //core telegram org/bots/payments#supported currencies prices add the product label and price details max tip amount the maximum accepted amount for tips in the smallest units of the currency (integer, not float/double) for example, for a maximum tip of us$ 1 45 pass max tip amount = 145 see the exp parameter in currencies json https //core telegram org/bots/payments/currencies json , it shows the number of digits past the decimal point for each currency (2 for the majority of currencies) defaults to 0 suggested tip amounts add the tip amounts suggested for this invoice message thread id enter the unique identifier for the target message thread (topic) of the forum (for forum supergroups only) start parameter unique deep linking parameter if left empty, forwarded copies of the sent message will have a pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice if non empty, forwarded copies of the sent message will have a url button with a deep link to the bot (instead of a pay button), with the value used as the start parameter provider data a detailed description of required fields should be provided by the payment provider photo url enter url address of the product photo for the invoice can be a photo of the goods or a marketing image for a service need name select whether if you require the user's full name to complete the order need phone number select whether if you require the user's phone number to complete the order need email select whether if you require the user's email address to complete the order need shipping address select whether if you require the user's shipping address to complete the order send phone number to provider select whehter if the user's phone number should be sent to the provider send email to provider select whether if the user's email address should be sent to the provider is flexible select whether pass true if the final price depends on the shipping method disable notifications select whether you disable notifications if so, sends the message silently ios users will not receive a notification; android users will receive a notification with no sound original message id enter the id of the original message enter/assemble the reply markup field select if to enter or assemble the reply markup field reply markup enter additional interface options that are a json serialized object including an inline keyboard, a custom reply keyboard, instructions to remove the reply keyboard or instructions to force a reply from the user, e g {"inline keyboard" \[\[{"text" "some button text 2","url" "https //botpress org"}]]} or {"keyboard" \[\["yes","no"],\["maybe"]]} keyboard cannot be used with channels send media by url or id sends a file (document, photo, video, audio, ) by http url or by id that exists on the telegram servers connection telegram bot /#configure the telegram bot chat id telegram bot docid\ nptqhp7q3erwnrp2cxqvh media type select whether you want to edit a photo or video caption enter the photo/video caption send by select a file set a file id as a string to send a file that exists on the telegram servers (recommended), or select an http url as a string for telegram to get a file from the internet disable notification select yes to send messages silently ios users will not receive a notification, android users will receive a notification with no sound id of the original message id of the original message if the message is a reply reply markup additional interface options enter additional interface options that are a json serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user, e g more information about custom keyboards can be found on the telegram bot api page download a file downloads a file from the telegram server connection telegram bot /#configure the telegram bot file id enter the id of the file already uploaded to the telegram server chats and updates create a chat invite link creates an additional invite link for a chat edit a chat invite link edits a non primary invite link created by the bot list updates retrieves a list of updates from the telegram server by default, updates starting with the earliest unconfirmed update are returned if you want to list more, you need to set the offset this module cannot be used with webhooks to use this module, you must switch off and remove all your telegram webhooks list chats list available telegram chats by default, chats starting with the earlier unconfirmed update are returned if you want to list more, you need to set the offset this module cannot be used with webhooks to use this module, you must switch off and remove all your telegram webhooks revoke a chat invite link revokes an invite link created by the bot watch updates triggers when there is a new update from your telegram desktop application the watch updates trigger cannot be combined with the get updates or get chats modules members list administrators in a chat retrieves a list of administrators from a selected chat get the number of members in a chat use this module to get the number of members in a chat kick a chat member use this method to kick a user from a group, a supergroup, or a channel the bot must be an administrator in the chat for this to work and must have the appropriate admin rights promote a chat member promotes or demotes a user in a supergroup or a channel the bot must be an administrator in the chat for this to work and must have the appropriate admin rights restrict a chat member restricts a user in a supergroup other make an api call performs an arbitrary authorized api call answer an inline query sends an answer to an inline query templates you can look for telegram bot templates in make's template gallery , where you'll find thousands of pre created {{scenario plural lowercase}} troubleshooting check the following procedures if you are facing difficulties when using the telegram bot app how to find out the id of a private channel/group one possible way to determine the id of a private channel/group is as follows create a new make place telegram bot >; watch updates module in the make configure the module by creating a webhook execute the make send a message to the private channel/group verify the output of the module by clicking the bubble above the module find the id in the output bundle how to find out the user id to find out the id of a telegram user, forward their message to the userinfobot check out the following procedure for steps on how to do that add the userinfobot to your telegram app you can do that by entering @userinfobot in the search bar and selecting the userinfobot go to the chat with the user you want to retrieve the id from forward his message to userinfobot copy the user id and paste it to the make module adding your bot to the channel click the right mouse button on the channel name and select the view channel info option click the add member icon next to the member number start typing the name of your bot in the search field click on the bot name to select the bot you want to add to the channel click the invite button make the bot admin by clicking the respective button assign the permissions to your bot and click the save button the bot has been added to the channel testing a public channel to test the public channel you need to obtain the chat id the chat id is part of the channel link the channel name is not the channel link / chat id if the public channel link is, for example, t me/imttest , then @imttest is your chat id now, you can send a message to the public channel using the send a text message or a reply module testing a private channel you need to obtain the chat id to test the private channel there are three options to retrieve the id telegram bot docid\ nptqhp7q3erwnrp2cxqvh switch the private channel to the public channel, then retrieve the id (by sending or receiving the message in make) and switch back the channel type to private invite the bot get id bot to your private channel and using the /my id\@get id bot command retrieving the id from the web version of telegram log in to your telegram account via https //web telegram org click on the private channel you want to retrieve the chat id for copy the number between the c letter and the underscore from the url if the url is https //web telegram org/#/im?p=c1424271061 11793697872942794544 then copy the 1424271061 paste the number to the desired field and add the prefix 100 the chat id of the private channel is then 100 1424271061 you can now use the id in the desired telegram bot module in make registration and login it is not required you can sign in on the site, telegram org/auth where you can change your public settings you will receive a key in your desktop application to submit your login my bot is hitting limits, how do i avoid this? when sending messages inside a particular chat, avoid sending more than one message per second we may allow short bursts that go over this limit, but eventually you'll begin receiving 429 errors if you're sending bulk notifications to multiple users, the api will not allow more than 30 messages per second or so consider spreading out notifications over large intervals of 8—12 hours for best results also note that your bot will not be able to send more than 20 messages per minute to the same group (source https //core telegram org/bots/faq#my bot is hitting limits how do i avoid this )