GithubHelp home page GithubHelp logo

botkit-telegram's Introduction

botkit-telegram

๐Ÿค–๐Ÿ‘พ A Botkit connector for Telegram with support for text.

Highly based on Brandon Him / brh55 work

This Botkit platform connector is intended to be used for Telegram. It was develop for a simple need to reply to users. Functionnality are limited...

Install

Note: Minimum Node Requirement 8+, Recommended 10, and >=10.10.0 if you use audio.

$ npm install botkit-telegram

Basic Usage

const BotkitTelegram = require('botkit-telegram');
const config = {
    token: '**' // Telegram bot token
}

const telegramBot = BotkitTelegram(config);

telegramBot.hears('hello','direct_message',(bot, message) => {
    bot.reply(message, 'how goes there :)!');
});

telegramBot.hears('.*', 'direct_mention', (bot, message) => {
    bot.reply(message, 'leave me to be please.');
});

Events

When you want your bot to respond to particular events that may be relevant, you can use the .on method.

discordBot.on(EVENT_NAME, event => {
    // do stuff
});

Incoming Events

Event Description
ambient a channel the bot is in has a new message
direct_message the bot received a direct message from a user
direct_mention the bot was addressed directly in a channel ("@bot hello")
mention the bot was mentioned by someone in a message ("hello @bot")

License

โ’ธ MIT Matthieu Derasse

Please let me know if you plan on forking or would like professional support. Open-source is a hobby, but it would be great as a full-time gig :)

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.