This is a simple bot that surveys the visitor with three questions and saves each response to a MySQL database. The bot admin can view the survey results for each user and approve them to join the group. Approved users will receive a message with a unique invite link to the group.
-
Bot welcomes the member on join with his survery results so all members see who they are talking to:
I built this bot because the standard approval workflow for Telegram groups is too simplistic. Most text variables are hardcoded; see the ./src/*
files. Pull requests are welcome!
- Clone this repository.
- Install dependencies:
npm install
. - Create a MySQL database and execute
npx knex migrate:up
. - Create a Telegram bot via BotFather and enter the token into
.env
. - Create a private Telegram group and enter the group ID into
.env
. Set up permissions for the group to prevent members from manually obtaining or sharing invite links. Direct everyone who wants to join the group to your gatekeeper bot. - Add the bot to the group as an admin.
- Run the bot:
npm start prod
.