YouTube Channel - haachama #TG #Cron
@calpa
code:
data:privatelast updated:11 months ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 200,000+ developers using the Pipedream platform
steps.
trigger
New Videos in Channel
last updated:last year
steps.
nodejs
auth
to use OAuth tokens and API keys in code via theauths object
(auths.telegram_bot_api)
params
Chat id
string ·params.chat_id
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across invocations with$checkpoint.
async (event, steps, params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
}
22
const axios = require('axios');

const { get } = require('lodash');

const text = 
`
${get(steps, 'trigger.event.snippet.title')} - ${get(steps, 'trigger.event.snippet.channelTitle')}
https://www.youtube.com/watch?v=${get(steps, 'trigger.event.id.videoId')}
`

const url = `https://api.telegram.org/bot${auths.telegram_bot_api.token}/sendMessage`;

const object = {
  chat_id: params.chat_id,
  text,
}

const { data } = await axios.post(url, object);

return data;