Telegram Bot to send Calendar events

(Clemerson Campos) #1

I’m trying to make somenthing work with telegram.
I have a Telegram Group, and we wait some events to start to execute some actions.

I’m trying to make a BOT to send the event TITLE to the group when the GOOGLE CALENDAR event starts;
My Flow is to EVENT START - SEND MSG

But in the interactions log all actions are failed and the cause is a WRONG RESPONSE PATH.

First. What I’m trying is possible?
How to solve the RESPONSE PATH problem ?

(Daniel Beckett) #2

@Clemerson_Campos

You may want to use the Broadcast service for this instead. You can just have the bot added to the group and then it can broadcast whenever there is a new event.

For example, you could have the Broadcast triggered from a webhook that is sent from your Event Started Flow.

If you still want to know how the response paths work then I’d suggest the tutorial for Using Response Paths in Flow XO which has some useful information :slight_smile:

(Clemerson Campos) #3

I really did not get how to to create the Broadcast baseade on the google calendar.

(Sarah Palombo) #4

@Clemerson_Campos hello :wave:

With Google Calendar, are you thinking of broadcasting based on certain dates / certain frequency (i.e monthly)
Or are you thinking of broadcasting to your Google Contacts :bulb:

Let me know a little more what you’re hoping for we can give you some pointers

Sarah :slight_smile:

(Clemerson Campos) #5

Hello @sarahpalombo! You are correct!

I Have a remote team and we comunicate trough Telegram. We use an shared google calendar to remember of daily stuffs, like meetings, milestones and other things.

As we are always connected to telegram, receive the notification on the chat via bot is the best way to keep everyone up to date!

(Karen Barker) #6

Hi @Clemerson_Campos, :wave:

To set up using the Broadcast service, you will need a couple of flows set up.

Calendar Event Trigger Flow
The first flow will be set to Trigger on the Google Calendar event either being started or the event being created. You will then need to fire a Webhook action in this flow, which will then Trigger the Broadcast Flow.

Broadcast Flow
This Flow needs to have a Webhook Broadcast Trigger. When you set this up you’re given a Webhook URL. This is the URL you will need to use for the webhook action in the Calendar Event Flow. Your 2nd action in this flow will then send a message to all bot users.

To pass the event information across to use in the Broadcast flow you could add the title of the event (or any other details you want passing across) as a query string when firing the webhook in the Calendar event flow. If you do this, make sure when you’re setting up the Broadcast trigger and testing the trigger you include the query string at this point too or you’ll not get any information passed.

We do have a couple of tutorials that may be useful for you to read over too:

I hope this helps :thumbsup:

(Clemerson Campos) #7

I Tried this! My problem is that i really did not get what to put on the Webhook field’s, as output neither as trigger.

(Karen Barker) #8

Hi @Clemerson_Campos,

The webhook trigger will provide you with a URL that needs to be hit for the flow to trigger. Copy and paste this URL as the URL required in the Make an HTTP Request in the other flow.

If you do want to pass further information along the URL you will need to add it as follows:

https://TriggerURL?title=EventTitle&time=EventTime&date=EventDate

(Clemerson Campos) #9

Sorry… but this is a bit complex… let me show how I’m doing it:

FLOW 01
Trigger:
Event Started
Google Calendar > Event Started

Action:
WEBHOOK & HTTP > Make a HTTP Request

OUTPUT
Status Code
200
Body
[200] success

FLOW 01
Trigger
Receive a Webhook
Broadcast Receive a Webhook

  • Webhook URL : URL (no change)

Action
Send a Message
Interact > Send a Message

  • Message : {{receive_a_webhook.attributes__title}}
    Error : Message can’t be blank
(Karen Barker) #10

Hi @Clemerson_Campos,

Everything looks spot on until the Send a Message action in Flow 01.

The query string that you are sending in needs accessing using {{receive_a_webhook.title}} for example. The values that you are sending in are accessible directly off the trigger, rather than being stored as an attribute. :thumbsup:

Hope this helps. :slight_smile:

(Clemerson Campos) #11

Still didn’t get it.
Can be more specific ? What i Put and which field i put the data?

(Daniel Beckett) #12

@Clemerson_Campos

It looks like Karen’s example of {{receive_a_webhook.title}} is what you’d need to use in the message.

When you have an incoming webhook for a broadcast you aren’t setting an attribute for the data and instead are just pulling the data directly from the trigger (first action that starts the flow). You can click on the ‘xo’ icon to see a list of available outputs in the flow. For example:

The above webhook trigger received two inputs, one for ‘Title’ and one for ‘Content’ so both are available as an output.

Hopefully that clarifies what you need to do :slight_smile: