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 https //desktop telegram org 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 docid\ ztpidhox u5qdloxeaeqm docid\ ztpidhox u5qdloxeaeqm configure the telegram bot go to 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 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 docid\ ztpidhox u5qdloxeaeqm 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 189left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type edit a text message edits text or game messages 190left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type forward a message forwards messages of any kind this module can be used to forward messages only within telegram 184left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type 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 179left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type pin a message pins a message 178left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type unpin a message unpins a message 179left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type media send an audio file sends an audio file to your telegram desktop application 177left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type send a document or an image sends a document or an image to your telegram desktop application 182left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type send an album sends a group of photos or videos as an album 187left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type send a photo sends a photo to your telegram desktop application 191left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type send a sticker sends a webp sticker to your telegram desktop application 194left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type send a video sends a video file to your telegram desktop application 194left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type 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 195left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type send a voice message send a voice message 195left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type edit a media message edits photo or video messages 204left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type edit a message caption edits a caption of a message 207left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type send an invoice sends an invoice 206left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type 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 209left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type download a file downloads a file from the telegram server 209left unhandled content type left unhandled content type left unhandled content type left unhandled content type 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 https //www make com/en/templates , 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 docid\ ztpidhox u5qdloxeaeqm 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, https //my 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 )