[go: up one dir, main page]

regraf
TypeScript icon, indicating that this package has built-in type declarations

1.1.7 • Public • Published

Bot API Version NPM Version node 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.

Regraf is a continuation of the Telegraf@3.

Features

Installation

npm install regraf

or using yarn:

yarn add regraf

Documentation

Regraf developer docs in development.

Examples

const { Regraf } = require('regraf')

const bot = new Regraf(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 { Regraf } = require('regraf')

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

There's some cool examples too.

/regraf/

    Package Sidebar

    Install

    npm i regraf

    Weekly Downloads

    4

    Version

    1.1.7

    License

    MIT

    Unpacked Size

    307 kB

    Total Files

    33

    Last publish

    Collaborators

    • redguys