Telegram bot to send text for approval and re-write if not approved

Hi, dear makers! I am building a flow, where I receive a few words via a telegram bot, then those words go to GPT, GPT writes a short text inspired by that word/words and sends me back through the telegram bot with two buttons, “funny” and “not funny”. If a user presses “Funny”, that will cause the end of the flow, if “Not Funny”, I want GPT to rewrite it.

The problem is with the last part. As far as the answer comes through the same trigger (watch updates) and then goes to another branch through the router, I don’t know where to take the initial words for setting the task for GPT.

Feeling silly. I am sure that there is a simple way to build it, but can’t get it.

Thank you for the hints!

May peace be upon you @kaidano

The filters on the router seems fine and should according to your usecase. Can you clarify the problem?

3 Likes

Welcome to the Make community!

1. Screenshots of module fields and filters

Please share screenshots of relevant module fields and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:
Screenshot_2023-10-07_111039

2. Scenario blueprint

Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

Screenshot_2023-08-24_230826
(Note: Exporting your scenario will not include private information or keys to your connections)

Uploading it here will look like this:

blueprint.json (12.3 KB)

3. And most importantly, Output bundles

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module, save the bundle contents in your text editor as a bundle.json file, and upload it here into this discussion thread.
Screenshot_2023-10-06_141025

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

3 Likes

Hi, Rezwan! Sure. You’re right, those filters are set up fine and routing everything as needed, but … the last branch is not finished. Example:

  1. I tell the bot word “FISH” (1)
  2. Router sends the flow to the first ranch, where gpt (2) creates the text and sends the reply back, with the option to reply with 2 buttons (funny or not funny) (3)
  3. If I answer with the button Funny, the trigger webhook will catch it again and send it to the second branch, and I have the reply OK (10). If I answer with the button “not funny”, it will send the flow to the last branch, where the module (11) will send a reply “Next time”, and that’s it.

The problem I am struggling with is that I want the last branch to act different. I want to set GPT a task to rewrite text with the word “FISH”, which I’ve added on the very first step, but the problem is that module (1) already caught the press of my buttons (funny or not funny), and don’t remember the initial word FISH

Hi Samliew! cool automated reply :slight_smile: how did you do that here?

I think you can use the data stores to save the previous message ID in telegram and then retrive it and pass it to the last module.

You can also try to use webhooks.

1.create a new scenario with a watch webhook response and then process it accordingly

  1. add a webhook module at the end of the telegram response so that the word and other IDs are sent to that webhook.
2 Likes

Thank you, that is a good idea to use data store. Never used it earlier

3 Likes

It works :slight_smile: thank you!

3 Likes

That’s great! Best of luck with it.

If you need further help, feel free to contact