Git Product home page Git Product logo

telegraf's Introduction

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

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

or using yarn:

$ yarn add telegraf

Documentation

Telegraf developer docs

Examples

const Telegraf = require('telegraf')

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')

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.

telegraf's People

Contributors

dotcypress avatar piterden avatar greenkeeperio-bot avatar ejnshtein avatar edjopato avatar khuzha avatar sergeysova avatar backmeupplz avatar sjinks avatar vrumger avatar vlakam avatar smaznet avatar mcrunix avatar fazendaaa avatar zfeed avatar kavayzin avatar denisx avatar timvdlippe avatar tiagodanin avatar fcfn avatar loskir avatar leodj avatar wojpawlik avatar fiblan avatar dmbaranov avatar dzamataev avatar deniscarriere avatar weijunyu avatar kraftwerk28 avatar tvolodimir avatar

Stargazers

Jeremy Randolph avatar

Watchers

James Cloos avatar Jeremy Randolph avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    馃枛 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 馃搳馃搱馃帀

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google 鉂わ笍 Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.