GithubHelp home page GithubHelp logo

fakhruddinabdi / telegraf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from telegraf/telegraf

1.0 2.0 0.0 730 KB

馃摗Telegram bot framework for Node.js

Home Page: https://telegraf.js.org

License: MIT License

JavaScript 99.22% TypeScript 0.78%

telegraf's Introduction

telegraf.js

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.

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

Features

Installation

$ npm install telegraf

or using yarn:

$ yarn add telegraf

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.hears(/buy/i, (ctx) => ctx.reply('Buy-buy'))

bot.startPolling()
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.startPolling()

There's some cool examples too.

Documentation

Telegraf developer docs

telegraf's People

Contributors

bestulo avatar dark-dao avatar delvedor avatar denisx avatar dinoleung avatar dotcypress avatar fabnicolas avatar fiblan avatar firguy avatar greenkeeperio-bot avatar jt3k avatar kylmakalle avatar leodj avatar mcrunix avatar mickethespike avatar monrus avatar olimsaidov avatar piterden avatar poeti8 avatar runegan avatar sergeysova avatar smartynov avatar smaznet avatar suciptoid avatar temasm avatar timvdlippe avatar verget avatar whoozle avatar wojpawlik avatar xfree avatar

Stargazers

 avatar

Watchers

 avatar  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.