1.1.1 • Published 2 years ago

telegraf-albums v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

telegraf-group-media for v4

Handle media groups (aka albums) easily with telegraf!

Usage

const Telegraf = require('telegraf')
const mediaGroup = require('telegraf-media-group')

const bot = new Telegraf(process.env.BOT_TOKEN)

bot.use(mediaGroup())

bot.on('message', (ctx) => {
  // ctx.mediaGroup — an array of album messages (including the last one)
  for (const message of ctx.mediaGroup) {
    console.log(message)
  }
  return ctx.reply(`total: ${ctx.mediaGroup.length}`)
})