auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps, params, auths) => {
}
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;