Skip to content

Instantly share code, notes, and snippets.

@ejnshtein
Last active November 24, 2018 18:47
Show Gist options
  • Save ejnshtein/a6dd749de9937487c854bc529ef52e67 to your computer and use it in GitHub Desktop.
Save ejnshtein/a6dd749de9937487c854bc529ef52e67 to your computer and use it in GitHub Desktop.
const Telegraf = require('./telegraf')
const { bottoken } = require('./conf.json')
const bot = new Telegraf(bottoken)
const pics = [
'https://pp.userapi.com/c852032/v852032200/54df2/QYhx-gTOyHM.jpg',
'https://pp.userapi.com/c852032/v852032200/54e06/XthuKPlyWjY.jpg'
]
const chatId = 'put here chat id'
bot.telegram.sendMediaGroup(chatId, [
{
type: 'photo',
media: {
url: pics[0]
}
},
{
type: 'photo',
media: {
url: pics[0]
}
}
]).then(res => console.log('pic[0]:'+res)).catch(console.log)
bot.telegram.sendMediaGroup(chatId, [
{
type: 'photo',
media: {
url: pics[1]
}
},
{
type: 'photo',
media: {
url: pics[1]
}
}
]).then(res => console.log('pic[1]:'+res)).catch(console.log)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment