Install dependencies using requirements.txt
pip install --user -r requirements.txtInstall node.js development dependencies
yarn installCopy .env.example to .env
The clients implementation try to use BOT_SESSION and USER_SESSION variables, otherwise, it use API_ID, API_HASH, and BOT_TOKEN variables.
I recomend use session string in production. To get the current bot and user session string, first configure in the .env the API_ID, API_HASH, and BOT_TOKEN and run the command below, it start both clients and save the session string in the .env automatically.
python session.pyRemember only push to production the .env file with API_ID, API_HASH, and BOT_TOKEN empty and remove bot.session and user.session. You can use the command below
python clean.pyStart the bot
python main.pyIn dev mode, I recommend use nodemon to restart the command automatically
Start dev bot
yarn nodemon main.pyWatch prisma schema and regenerate if it change. Tthis prisma executable was installed by python pip
prisma generate --watchOpen prisma studio. Using prisma installed by node.js (npm, yarn, pnpm, ...)
yarn prisma studioIf the schema change, update the database with the current schema. Tthis prisma executable was installed by python pip
prisma db pushGet the API_ID and API_HASH at https://my.telegram.org/apps
Get the BOT_TOKEN at https://t.me/BotFather
| Variable | Description |
|---|---|
| API_ID | Telegram api id |
| API_HASH | Telegram api hash |
| BOT_TOKEN | Token of you bot |
| BOT_SESSION | Bot session string to use in production |
| USER_SESSION | User session string to use in production |
- Multi languages
- Configuration per user
- Each user can:
- Get all channels
- Add channels to watch
- Delete channels
- Get all filters
- Get all filters per channel
- Add filters or keyword to a specific channel
- Delete filters
- Admin can:
- List invited users
- Invite a new user using username
- Delete a user invitation using username
- List accepted users
- List users registered
- Delete a user registered using ID
All users
- Help (help)
- Get all channels (list_channels)
- Add channel (add_channel)
- Delete channel (delete_channel)
- Get all filters (list_filters)
- Get all filters per channel (list_channel_filters)
- Add filter (add_filter)
- Delete filter (delete_filter)
Admins
- List invited (invited)
- Invite (invite <username>)
- Delete invitation (uninvite <username>)
- List acceted (accepted)
- List users (list_users)
- Delete user (delete_user <id>)
- Join to channels configured per user
- Leave of channels that dont have users watching
- Watch channels configured and send messages that match with its filters to user that configured it