Telegram Business Bot error | Questions on Scenario Operations

Above is my current scenario, which I’ve also unlink first as it is not working.

1st Question:
Telegram Bot waits for User to message me (Telegram Business Bot - link to question 2 later on)
Message received > Trigger the flow > Go to Google Sheets to gather data.

Google Sheets:
HTML Link 1-6 in Column A1:A6

Send link address to HTML then Text Parse the information from the links… then All information to be consolidate into one piece of information (variable) so that OpenAi can send an answer to Telegram Bot to reply ON MY BEHALF.

1st issue i faced is that the links are being scanned one by one and sending over to the bot 6 different times which in turn send the replies SIX times.

What is needed is for these links to be consolidate into together into one variable/operation then OpenAi to get information from here instead instead of running the replies 6 times.

2nd Issue faced is that telegram bot cannot reply on my behalf. Kept saying like Cannot intiated users with customers, message not found etc…

When we tested the bot, by changing to Chat ID, it was working alright but it’s replying 6 times due to Issue #1, and it was the bot replying to me…

I hope someone can guide me on getting this automation working. Thank you

Hello! Welcome to the Make community.

For your first question, your aggregator is not configured correctly, you have to set the source module to the Google Sheets module (it will also be greyed-out).
But, I would recommend you use a Text Aggregator instead. With a new line separator between each parsed text.

For OpenAI be careful of the limits of tokens, which depends on your plan and the model version.

For your second question I don’t know, I always used it answering as the bot.
I think that you should also have a user connection and use it for the answer to the user. But I’m not sure you can contact the user like that without having invited him before… to be tested.

Benjamin

Thank you so much for your prompt reply. Really appreciate it.

I like how you recommended me in Text Aggregator.


Now the Text Aggregator is compiling and giving 6 bundles which still had my ChatGPT to run size times (operation)…

Issue 1: The ChatGPT output 6 replies as it has 6 bundles.

Issue 2: The ChatGPT settings i have a feeling im confused regarding the SYSTEM/USER/ASSISTANT function… It doesn’t seems to gather information from the information from the links.


This is the Message Content:
Role:
You are a professional and experienced real estate agent.

Tone:
Maintain a friendly, engaging, and conversational tone throughout the interaction.

Key Guidelines:
Information Gathering: Focus on gathering relevant information from the customer regarding their real estate needs. Ask open-ended questions to understand their preferences, budget, timeline, and any specific requirements.

Customer-Centric Responses: It’s ok for you to have a conversation with the customer but when providing data or information, you can only provide information based on the information provided. Avoid making assumptions or pushing for sales.

Comfort and Trust: Ensure the customer feels comfortable and confident in asking questions. Aim to build trust and rapport through thoughtful and considerate responses.

Non-Desperate Approach: Do not sound desperate to sell, rent, or make an appointment. Instead, provide value through informative and helpful responses.

Engagement and Education: Engage the customer with relevant information about properties, the market, and any other inquiries they might have. Educate them to make informed decisions.

Encouraging Viewings: Subtly guide the conversation towards agreeing on viewing the property, highlighting benefits and addressing concerns without pressure.

Example Phrases:
“Could you share more about what you’re looking for in a property?”
“What features are most important to you in your new home?”
“I understand your preference for [specific requirement], could you tell me more about your budget range?”
“Feel free to ask any questions you might have about the property or the buying process.”
“This property has some great features that match what you’re looking for. Would you like to schedule a viewing to see it in person?”
Additional Notes:
Be patient and attentive to the customer’s needs.
Ensure all responses are personalized based on the customer’s inputs.
Keep interactions professional yet warm to foster a positive customer experience.

If there is any uncertainty of the questions asked, you will reply “Give me a minute.” instead.

Based on the information provided, you can reply to the user message: {{29.business_message.text}}

Issue 3: Telegram Bot not sending reply. This one i’ll work on that later… Trying to understanding Issue 1 & 2 first.

Thank you

Hey!

I think you use the “group by” field in the Text Aggregator. This is used to group with a key the texts, which generates a bundle per key (it’s used when you want to generate a different text for different users for instance). Remove any thing that you mapped in the “group by”, and it will generate the full text in one bundle (making ChatGPT execute only once).

For the configuration of ChatGPT, as a summary:

  • System can be used to let AI know the context of the conversation. in your example, I would put almost everything until “Give me a minute Instead
  • Assistant: is used to “simulate” the conversation from the perspective of the AI; you don’t need it here I believe.
  • User: is your question: I would put Based on the information provided, you can reply to the user message: {{29.business_message.text}}

Your configuration could look like this (I extracted a part of your promtp):

Give it a try. But I’m still concerned by the maximum number of Tokens. If it fails because you used too many, we can still let ChatGPT execute 6 times, and then use the Text Aggregator after ChatGPT to group the 6 results into one single message. It will consume more operations, but you will not go above the limit of ChatGPT.

Benjamin

Hi Benjamin, thank you for your reply… clear understanding on your explanation. Appreciate it.

I’ve tried and yes, it did produce a single bundle which is good… I noticed my output from the Text Aggregator still contains alot of [https://ww…/…/…/] etc… which then I tried using Text Parser with the below settings hoping to remove all the links that is in between the square brackets ‘[ ]’.

Like expected from me, failed… i still do see all these links codings in it… how do I actually remove all these links as its increase unnecessary tokens for ChatGPT.

As for the ChatGPt module, I got a feeling my flow is wrong because … when I tried to start the message for example: “What units are out for rent?” the reply from chatgpt will be "Hi, could you let me know your requirements… we have blah blah blah… etc… " Then my following question like “Any areas available in the west?” ChatGPT treat this like a new conversation and reply like “Hi, my name is xxx… thank you for your interest… etc…” It doesn’t engaged and talk like how we use ChatGPT… it’s treating every message/text like new… not conversational.

Which makes me think, am I using the module in the wrong way? or my flow is wrong? Or should I use Assistant instead of System?

Current Flow:

Updates to my previous queries:

I can confirmed that the conversation with the bot isn’t recorded… or remembered. I ask regarding property listing etc… schedule a meeting… then i asked again if it remembered which listing i wanted to view… and the bot couldn’t answer.

and it seems that every message being sent in, it process all the link information again… making each message sent as brand new… and also… Lots of Tokens is going to be spend running every links everytime a message is being conversed. Woooo… :money_with_wings: :rofl:

Hey!

yes, I think the only way to keep a conversation is to use “Message an Assistant” where you can add a ThreadID. But in that case, you will have to keep track of all the Ids from all the conversations you initiate with users. But first, you could give a try to Message an Assistant.

for the removal of the links, I didn’t check your regular expression, but I can see that 2 things have to be changed. You have to set “Global” to Yes, and you have to use “emptystring” for the result of the replace.

Like this

Benjamin

Hello! Have you or @Benjamin_from_Make already solved this issue?

Having the same problem right now.

I have a Telegram Business Account and the setting “Reply to Messages” is turned on. However, it still doesn`t allow my bot to reply.

Make issue or Telegram issue?

image

Hey!

I already had this type of issues. It’s a policy of Telegram that doesn’t allow bots to directly contact users. The user has to do a initial contact to the bot first.

I’m not expert in messenger apps but I think it’s to avoid anyone from spamming users.

For instance, if you find your bot in Telegram and add him (with the user you are testing), you should then be able to send this user a message from Make.

Benjamin

1 Like

Thank you for the response, Benjamin!

We are continuing our research here :point_down:

Telegram Bot Error “bot can’t initiate conversation with a user”