Skip to content

smoothapps/telegram-support-bot

 
 

Repository files navigation

Bot API Version NPM Version node js-standard-style

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

Documentation

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

Telegraf documentation.

Installation

Install Node ( > 8 ) and npm ( > 3.38.0 ).

Run it

git clone https://github.com/bostrot/telegram-support-bot.git
cd telegram-support-bot
npm i
cp config/config-sample.js config/config.js
npm run start

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",
    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 - returns your telegram id and the group chat id (1234567 -1234567890)
  • /ban - ban a person from writing to your chat

User commands:

  • /start - tells the user how to use this bot
  • /help - an overview over the commands or some explanation for the user
  • /faq - shows the FAQ

Features:

  • File forwarding from and to user
  • Database for handling open and closed tickets
  • Restrict users
  • Simple anti spam system

Docker

via docker-compose:

docker-compose up -d

or build:

docker build -t bostrot/telegram-support-bot .
docker run bostrot/telegram-support-bot -v /path/to/config_dir:/telegram-support-bot/config

Update to v1.0.1

Backup and delete the database file (src/support.db) and move config.js to folder config. Then just start it normally.

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 are welcome to contribute with pull requests, bug reports, ideas and donations. Join the forum if you have any general purpose questions: bostrot.com

Hit me up for a custom hosting solution or other help on Telegram @bostrot_bot

About

Telegram support bot using the Telegraf framework.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 98.5%
  • Dockerfile 1.5%