The bot for assigning tasks for users with internal points awards and verifying their completion by admins
- Create
.env
file for bot (based on ./.env.example) and fill it - Create
.env
file for admin-panel (based on./AdminPanel/inc/.env.example
) in ./AdminPanel/inc/ and fill it - Comment/Uncomment DB data in docker-compose (Line 14 - Line 18)
- Run
docker-compose up --build
- Create DB
- Import sql template ./database/bot-database.sql
- Create
.env
file (based on.env.example
) and fill it - Install packages:
pip install -r requirements.txt
- Run
main.py
- Create
.env
for admin-panel (based on./AdminPanel/inc/.env.example
) in ./AdminPanel/inc/ and fill it - Run
composer install
in ./AdminPanel - Create admin-user for login to AdminPanel in
panel_accounts
DB table (passwords must be hashed by https://phppasswordhash.com/)
Admin Menu in Telegram:
Admin Panel (php+bootstrap):
users_bot
- table for every users, who interacted with bot.tasks_bot
- table with each created task for execution by users. Accessible only for bot-admins (command: /admin) or from admin panel.task_tracker_2
- table with tasks that after creation are assigned to each user in the bot (One-To-Many relationship).bundle_shop
- table for creating bundles that users can buy to get more internal points.payment_logs
- table with logs of bundle purchases that can be seen and used by administrators who have access to the admin panel.panel_accounts
- table for creating an admin panel user (passwords must be hashed by https://phppasswordhash.com/).
contracts
- ERC-20 transactions for bot paymentsdatabase
- bot database requests (without ORM)handlers
- Guide(Registration)/User/Admin functionskeyboards
- inline bot keyboardstranslations
- RU/ENG localizations
- The user goes through 5 steps of registration:
- Captcha (Select Language -> "Join" button -> Captcha)
- Balance
- Reaction (Join related channel)
- Invite_Friend (Bot referral system; 3 negative bot-checks proceed user to the next stage)
- Wallet (Enter your crypto wallet address)
- Done (Completed registration/guide stage)
- After registration user has functionality:
- Profile
- Active tasks
- Buy tokens/points
- Admin creates new task in admin menu
- User goes to "My Tasks" and can complete the task by providing a link as the proof of completion
- Admin verifies the completion of the task and if the task is confirmed, the user receives points
- Verify submitted tasks
- View history of tasks completion
- Add/Edit/Delete Tasks
- Add/Edit/Delete Users
- Add/Edit/Delete Token Bundles
- View logs of bundle purchases
- (Admin-Panel on pure PHP with Bootstrap)
- (Admin-Panel UI has only RU localization)
- User has a "My Profile" button
- User internal points(tokens)
- User wallet address
- User referral link
- User number of invited referrals
- User has a "Active Tasks" button
- Task name
- Task reward amount
- "Submit" button
- User has a "Buy bundle" button
- Bundle name
- Amount of real currency conversion to internal points (Example: "1000 Tokens for 50$")
- [WIP] "Buy" button
- Admin has a "Show Tasks" button
- Task name
- Task assigned user
- Task user answer (proof)
- Task status (Not Completed/Verify/Completed)
- Admin has a "To Verify" button
- Task name
- Task assigned user
- Task user answer (proof)
- Task status (Not Completed/Verify/Completed)
- "Approve" and "Cancel" button
- Admin has a "Create Task" button
- Input Task name (string)
- How many times to complete the task (int)
- Task reward (int)
- Admin has a "Return to Main Menu" button.
- User initiates the first communication with bot by command: /start.
- Bot recognizes in what language to communicate with the user [
RU/ENG
]. - Bot greets the user and sends a "
Join
" button which will start the registration stage. - User clicks "
Join
" button. - Bot sends the user a generated captcha to verify the user's humanity.
- User must enter the correct captcha otherwise the bot will generate a new one and wait for the user to respond.
- User enters the correct captcha
- Bot sends a balance message
- User clicks the "
Balance
" button
- Bot sends a link to the channel user need to subscribe to
- User clicks on the "
Subscribed
" button - Bot verifies through the admin access in this channel if the user is in this telegram channel
- Bot sends the user a link with their referral link (
?start=referral_id
) - User has to click the "Invited a friend" button himself, then the user will run the bot remind scheduler to verify the friend invitation in the bot
- If user receives a negative check 3 times, the user will be skipped to the next registration steps
- User is asked to input address of his crypto wallet for withdrawal of funds
- User proceed to the main menu of the bot
- Telegram payment
- Smart contracts payment
- Smart contracts transactions from Owner-Wallet to Receiver-Wallet on Testnet
- Create ERC-20 Token on Testnet
- Download and place ABI file in .json format to ./contracts
- Set path to your ABI file in: ./contracts/token_transactions.py
- In .env file:
- Set
PRIVATE_KEY_COIN
- your private key for created Token - Set
COIN_API
- your API for ERC-20 Testnet
- Set