Services Plugins FAQs

Telegram - New Plugin from Zeroqode

  1. I have input my bots API key into these fields under Telegram Bot plugin:

  2. I have enabled both these checkpoints under API settings (as well as created a new data type ‘Telegram Users’. I have also ticked that checkbox.

  3. I have set up the backend workflow same as that shown in the demo page:


    image

  4. My backend workflow’s endpoint has these types + message text and message date:

  5. Under my telegram bot’s getWebhookInfo, I used the same URL i got from the ‘detect data’ button (without the ‘initialise’ and see this:

  6. I copied the telegram bot demo page into my app and I have this error that my element is not able to select “Get bot chat info result” as a ‘Type of Content’:

  7. The same error is highlighted in some other components:

Thanks for the additional info @zachary

The issue might be due to a couple of things, I would like to make sure you check the following:

  1. Make sure that the API Keys were copied correctly and without any spaces before/after the keys.
  2. The telegram bot’s get webhook info shows that it is not receiving the response, and it is probably the cause of the reason. Please try to repeat steps 7,8,9,10 in the documentation.
  3. Please screenshot the type of content available to you at this moment, is there any Telegram data calls there?
  4. In the 9th step, when you check the success confirmation, what’s the status there, is it “success”?

Please check the steps mentioned above and let me know if the issue still persists.

Looking forward to your reply.

Thanks Kirill!!
Here are the screenshots of the steps I retook:

  1. Postman success:

  2. I set the webhook of my Telegram Bot using this command:

https://api.telegram.org/bot5215351153:AAEHowfJNEtog1QFytiMSk48M1h-Gbq0Pqw/setWebhook?url=https://appedine2021june.bubbleapps.io/version-test/api/1.1/wf/telegrambotplugintest/

and the getWebhookInfo method gives this result:

  1. The available content type are shown here:

    But I still have this error:

The information is taken from the data call “get chatbot info” however, on our demo page the 5th step sends the data from the API that can be later used to display the user ID and other information in the repeating group, without this step you won’t be able to show the information from the telegram bot. It might be the reason for you not being able to set up the ‘type of content’. Also, you might be missing one of the custom states that are set up on the page, please see this: Screenshot by Lightshot

Can you please check if you have set up the update chat button and set a state with “Get the chatbot info result” in the value? Please see the screenshots for the visual demonstration of what you need to have to have the content type working. Please see the demo editor, and specifically, look into “Group Update chat button” button and its workflow.


Please let me know if it has fixed the problem.

Take care.

Hello thanks for the prompt reply. I have the custom states of the page set up same as the demo page:


But the update button cannot be the same:
I realised in your demo page, the plugins were still calling something called “Telegram (testing)” and since it is not in my page, I changed it to the installed plugin’s name called “Telegram - Get Bot Chat Info”.

However, as you may notice, the page does not allow me to fill in “Telegram - Get bot chat info result” the same way the demo page does. May I know if this is the step that is causing the problem?

EDIT: YES the fix was when you copy paste the page elements from the demo page, they are stil using the testing version of the plugin and the “get bot chat info” type was referring to the testing’s method. You have to change all instances of the “Get bot chat info” to the similarly-named option “Get bot chat info” even though no error highlights this.

New issue: I no longer have any error messages regarding the page itself but my data still does not show. However, after updating the API Key input with my own bot’s API, and after inputting manually my own UserID, messages DO send successfully. The issue is with the display of my data:

May I know if there is a simpler way to get any data to be reflected on the page without using repeating groups?

Also, with the telegram webhook set up (following the documentation’s instructions at step 10), I get this error message when I click update chat:


Do I have to delete the webhook or has my set up been incorrect? Because according to Telegram documentation, if the getUpdates method is being used, I cannot set up the webhook. If I AM supposed to set up the webhook, then do you know where the problem might occur? Because I am unable to “update chat” if the webhook is set on my telegram bot:

Glad to hear that some of the issues were resolved. As for the webhook setup, have you tried deleting the webhook and seeing if the issue still persists with the update chat button?

As far as I understood, the issue with the content type has been resolved? If you would like to show the chat info, there is no other way of displaying rather than in the repeating group. However, you can use the message chat id to show the ids of the users in a group, just like in our demo. Please note that the demo page it’s just an example of how the data can be displayed, the users can choose their own ways of displaying data through our actions and data calls, though we recommend to have at least beginner/intermediate Bubble skills to comfortably set up the plugin.

If you still experience issues displaying the data, please let me know the way you are trying to set it up, particularly the group settings(where you show the IDs). Also, if the update chat button does not work, the group will not display any data.

Looking forward to your reply.

Hello thanks so much for the prompt response!! It is very much appreciated.
The issue with the content type has been resolved :slight_smile:
The issue with the webhook goes away if I delete the Telegram bot’s webhook. Does this confirm that no webhook is required to be set up for the telegram bot plugin to work?

  1. I am trying to get my page to display to the user all the Telegram users who have started their telegram bot. I do not know how to communicate changes to the bot to my webpage in the background. I understand that a new user can be created using the “create a new thing” function in Bubble but it is not being reflected in my webpage. FYI, the webpage I tried this on was on a replicate of the demo page. I wish to achieve a function where when a user enters “/start” or starts a conversation with my bot, a new data entry under the type “Telegram User” is created with their userID, first name etc.

  2. I wish to display all the objects which are of the type ‘Telegram User’ on my webpage to show their userID, first name and last name. I just want to be able to receive information on users who have started my Telegram bot onto my bubble app.

The webhook is required and there should not be errors if it was set up correctly.

The 2 of your other questions are mostly related to the Bubble’s functionality rather than the work of the plugin. These two issues can be solved with the "Get chatbot info" data call. As an example for your use case, you can set up when the condition is true to add an entry to the database with the name of the user and their ID (see the screenshot). You can then display this information on your webpage like it is done on our demo page, using the same “Get chatbot info” and show the data in the repeating group or anywhere you require it to.

Please note that we can’t provide you the solutions which are related to Bubble’s functionality and we can only guide you in the right direction with the actions/data calls that are available in the plugin and fix the bugs if there are any. If you need help with setting up your use case and you are fairly new to Bubble, I would recommend taking some courses or hiring a Bubble developer to help you.

In case you have any other plugin related questions, let me know :slight_smile:

Have a great day.

Thanks so much for the help Kirill!! I have managed to get data to be reflected on my copy of the demo page just by editing all the “Type of Content” to the new/currently-installed version of the plugin’s “Get bot chat info”. However, I retested the webhook part of a new telegram bot and found that when I do not set up the webhook, the page still works fine (i.e. Still can receive data via the bot). However, when I set up the webhook on the telegram side (with the success message shown on the browser), the page no longer works and an error message is shown:


image
This shows that the plugin seems to be using the getUpdates method for the telegram bot and that the webhook indeed should not be set up for this to work. Can you confirm this again? I may have set up the webhook incorrectly, so should you feel that I have done so incorrectly, may you kindly show me how?
Originally, I entered this into my browser:

https://api.telegram.org/bot<token>/setWebhook?url=<url found under the detect data of my own app, same as the step shown in the documentation WITHOUT initialise>

Thanks for the additional information @zachary

Sorry for misunderstanding your question, indeed the webhook can’t be set up together with the chatbot info action according to the Telegram’s documentation.

There are two options, you can either get the information from the webhook or the action “get bot chat info”, The webhook works the following way, when the bot receives a message, an event is triggered and a message is sent to the specified endpoint with information on this message (who sent, what was sent and exactly when). While the get chat info action pulls out the last 100 messages, but (!) only those that were no later than 7 days. It means that you choose your own way of receiving and capturing the data.

In case you have any other questions, let me know :slight_smile:

Take care.

Thanks for clarifying this. So by default the “Get bot chat info” will use the ‘getUpdates’ method am I right to say this?

How do I set up the webhook and communicate changes to the bot without using the ‘Get bot chat info’ plugin action then?

Also, was the way I set up the webhook correct?

Thanks for the constant updates!! Very much appreciate it

Yes, that it is right.

The data is saved to the database when the webhook is set up, later on, you can show changes from the database by doing a search for the saved information, just like in the regular repeating group. For more information regarding the webhook you can check out here: Telegram Bot API

It is correct if you have followed the documentation and if you got notified that the webhook was successfully set up.

In case you have any other questions, please let me know :slight_smile:

Have a great weekend!

Hello,
does the plugin action “Send Photo” support the Bubble’s “Picture uploader” input? I tried to send a photo with “Photo Input’s value” but it doesnt work. I then tried to use “Photo Input’s value’s URL” because the demo uses a link rather than a photo file. But I still cannot get it to work. How do I get a valid link by using Bubble’s “Picture Uploader”?


EDIT: FOUND SOLUTION
The Bubble’s Picture Upload will evaluate to something like “//s3.amazonaws…” but the Telegram bot plugin requires a link that starts with “https:…” SO I just had to add “https:” to the front of my dynamic data “Picture Uploader’s value’s URL” and it works.

1 Like

Glad to hear that you found a solution @zachary

In case there are any other questions or issues, just let me know :slight_smile:

Take care.

Hi, I would like to know if it is possible to send a message requesting a Telegram user to share their mobile number via the bot and capture this mobile number via their response?

Example: I want to be able to achieve something like this with my bots

So when a Telegram user "/start"s the bot, they are greeted with a message that requests for their phone number. I am fine if they manually enter the phone number

Hi @zachary

Yes, it can definitely be done, you can use the action “Send Message” and use the only when field to specify when you would like to send a particular message. You can also set it to “update every 5 seconds” to check if the condition has been met. Please note that it is just an example of what can be done, and it can be customized and altered to your needs with Bubble’s built-in functionality.

When the message is received from the user, you can set a condition to save the phone number in the database by “Creating a new thing”.

Please let me know if you have any other questions.

Have a great day.

thanks for your help!
Right now I am currently facing another issue: I am able to get the User’s UserID/Username fairly easily with the “request data” action in the backend workflow. However, since my app will be managing multiple telegram bots, I wish to know exactly which telegram bot they are speaking to. i.e. which bot has received the “/start” command. Is there a way to do this? Based on the options provided at this step, I know that none provide me with a way of identifying which bot they are speaking to:
image

The API key of the particular bot can be specified in the “Get Bot Chat info” data call, and then can be used to receive data from this specific bot.

Hopefully it helps :slight_smile:

Have a great day.

But from what I have confirmed with you, this will not work if the bot has a webhook set. So instead of creating my “Telegram Users” data type via the “request data” action in the backend workflow, am I only able to do it at the frontend workflow via this method of “get bot chat info”? “Get bot chat info” does not work with a webhook setup.