npm.io
5.1.3 • Published 4 years agoCLI

telegraf-develop

Licence
MIT
Version
5.1.3
Deps
6
Size
229 kB
Vulns
0
Weekly
0
Stars
9.2K

Telegraf Bot API Version NPM Version node Build Status js-standard-style Community Chat

Introduction

Bots are special Telegram accounts designed to handle messages automatically. Users can interact with bots by sending them command messages in private or group chats. These accounts serve as an interface for code running somewhere on your server.

Features

Installation
npm install telegraf-develop

or using yarn:

yarn add telegraf-develop
Documentation

Telegraf developer docs

Examples
const { Telegraf } = require('telegraf-develop')

const bot = new Telegraf(process.env.BOT_TOKEN)
bot.start((ctx) => ctx.reply('Welcome!'))
bot.help((ctx) => ctx.reply('Send me a sticker'))
bot.on('sticker', (ctx) => ctx.reply('👍'))
bot.hears('hi', (ctx) => ctx.reply('Hey there'))
bot.launch()
const { Telegraf } = require('telegraf-develop')

const bot = new Telegraf(process.env.BOT_TOKEN)
bot.command('oldschool', (ctx) => ctx.reply('Hello'))
bot.command('modern', ({ reply }) => reply('Yo'))
bot.command('hipster', Telegraf.reply('Îť'))
bot.launch()

There's some cool examples too.

Keywords