GithubHelp home page GithubHelp logo

giat2153 / telegram-support-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bostrot/telegram-support-bot

0.0 0.0 0.0 177 KB

Telegram support bot using the Telegraf framework.

License: GNU General Public License v3.0

JavaScript 96.96% Shell 3.04%

telegram-support-bot's Introduction

is a support bot for telegram bots, using the Telegraf framework (by @dotcypress). It let users create tickets which will be send to a staff group and can be answered by a reply.

Bot API Version NPM Version node js-standard-style

Documentation

telegram-support-bot was built on top of Telegraf libary.

Telegraf documentation.

Installation

Install Node ( > 6.2 ) and npm ( > 5 ).

Run it

git clone https://github.com/bostrot/telegram-support-bot.git
cd telegram-support-bot
npm i
node bin/support.js

Or: via install script (this will create two autostart files for systemctl (bot and supported bot) and enable both):

git clone https://github.com/bostrot/telegram-support-bot.git
cd telegram-support-bot
sudo bash setup
sudo systemctl start YOUR_SUPPORT_BOT_SERVICE_NAME

Enter the bot location (ex. /home/bots/mybot.js) when asked and then your bot name (ex. mybot) setup will create two systemctl links in order that your bot will be automatically restarted when it crashes and runs in the background.

Configuration

You can get your ID with /id. The first number will be yours the second the one from the group you are in (if you are in one; including the minus).

You need to set your bot token and chat ids in config.js:

module.exports = {
    bot_token: "YOUR_BOT_TOKEN", // support bot token
    staffchat_id: "SUPERGROUP_CHAT_ID",  // telegram staff group chat id eg. -123456789
    owner_id: "YOUR_TELEGRAM_ID",
    supported_bot: "service_name", // service name of the supported bot leave empty if you don't have one
    startCommandText: "Welcome in our support chat! Ask your question here.",
    faqCommandText: "Check out our FAQ here: Address to your FAQ",
};

Features

When a user sends a message to the support chat it will create a ticket which will be forwarded to the staff group. Any admin in the staff group may answer that ticket by just replying to it. Salutation is added automatically. Photos will be forwared too.

Currently the support chat offers these commands (staff commands):

  • /open - lists all open tickets (messages where noone has replied yet)
  • /close - close a ticket manually (in case someone writes 'thank you')
  • /id (userid) - lists some stuff from the database about the user
  • /ban - ban a person from writing to your chat

User commands:

  • /start - tells the user how to use this bot
  • /faq - shows the FAQ

This you should only care about when you intend to "support" another bot e.g. salesbot with this. This would enable "ANTI-CRASH" and commands like start and stop. Remember to use this only when you have two bots.

Admin/Owner commands:

  • /root - Starts the listener and prevents the bot from crashing (restarts it and sends the log into the staff chat); Also this will open up a dashboard where the admin/owner can control the bot with following Update, Restart, Log, Stop.

Telegram token

To use the Telegram Bot API, you first have to get a bot account by chatting with BotFather.

BotFather will give you a token, something like 123456789:AbCdfGhIJKlmNoQQRsTUVwxyZ.

Creating a bot

Telegraf bot framework for building a bot

Help

You can also ask this bot on Telegram: @bostrot_bot

You are welcome to contribute with pull requests, bug reports, ideas and donations. Join the forum if you have any general purpose questions: bostrot.com

Bitcoin: 1ECPWeTCq93F68BmgYjUgGSV11XuzSPSeM

PayPal: paypal.me/bostrot

Hosting: Get $50 free VPS credit on Vultr

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.