Simple telegram bot invitation system. Written in python.
This code is a functional POC
The code is a modified version of echobot , with an invitation system added, so you cannot access the bot's functionality if you do not have an invitation.
The code has been tested in ython 3.9.2. We recommend the use of virtual environments. To install the dependencies, run in a terminal:
$ pip install -r requirements.txt
In the resources/config.json file we can configure the file where the database will be created
Once the dependencies have been installed, run the following line in a terminal:
$ python invitation_bot.py
Two different tables have been created, one to manage users and the other to manage invitations.
Field | Description |
---|---|
ID | Telegram User ID |
NAME | Telegram User First Name |
ROL | 0 (Super Admin), 1 (Admin), 2(user) |
TYPE | Descriptive field to describe different types of users (assistant, customer, ...). Not used |
REGISTRATION_DATE | Registration Date |
REGISTRATION_INVITATION | Invitation from INVITATIONS table |
CONVERSATION_STATUS | To maintain the conversation after an update. 0 by default. Also can be modified to 1 if /cancel. Not Used |
Field | Description |
---|---|
ID | Autoincrement PK |
INVITATION | Invitation |
INVITATING_USER_ID | User ID who is inviting someone |
INVITATION_USED | 0 if not, 1 if already used |