A bot for anyone who is frustrated of group management bots
So much recursion, so much wow.
- Table of Contents
- What is it ?
- Disadvantages Of Group Management Bots
- What Is A Gateway Group ?
- What Is The Need Of A Bot In Gateway Group ?
- Features
- Quick Start
- Installation
Takshi is a Telegram bot to help you maintain gateway groups with peace of heart. It automatically removes unverified users, reminds unapproved users, generates and refreshes invite link automatically.
Normally, when you make a super-group in Telegram, you add a group-management bot to moderate the group. Most of such bots come with support for captcha and spam removal. But do they really work ?
- With a lot of members, there could be silent spammers.
- In a public group, anyone can read the messages and harvest members list.
- A lot of our users are stuck under spammers personally messaging them.
- You can't take a risk by allowing a random bot to moderate the group.
- Even if you have a moderator bot, it doesn't prevent spammers from stealing the group data or pinging members in personal message. (Remember, to see members list in a public group, you need not me it's member !)
Gateway group acts as a firewall to remove spammers. Only users who are verified from it can access original group. The working of a gateway group is simple.
- You make a super-group of the required name (gateway group).
- There you add only admins.
- The original group will be kept private (real group).
- Users who want to join the original group, has to message in the gateway group. Their message should convey admins that the person has real interest in joining the group and is not a spammer.
- If an admin finds the message legit, he or she approves the user and adds him / her to the private group.
The model of gateway group is unbeatable. The issue starts when admin needs to add a user to private group. let's see how.
- Not every user has a username or settings that allow them to be added to groups. So you need to ask them to change their privacy settings. This consumes time.
- A bad user (a rival from your past life), can prove they are legit, can prove they are legit. Then they may click on Report Spam and Leave. This reports your group and can end in serious trouble based on your luck.
- If your group is very popular, you may need to add a lot of members manually. This could hinder Telegram's flood limits and may get your account temporarily banned !
With these issues, the only good solution is giving the users an invite link of the private group. But you can't send the link in public group. So you need to personal message them the link. But when you do so, a bad user (a rival to your pet) can Report Spam and Block you.
To avoid this, you can ask the legit users to personal message you for an invite link. You send them the link and revoke it after the user joins.
Short and simple, Takshi automates the above task for you.
- Automatic reminders
Some users join the gateway group and just forget. The bot takes care of reminding them (without using water to wake them up). - Periodic removals
There are some good users who join the gateway group and just never care about any reminders. The bot automatically removes them. - Refreshes invite links
The bot refreshes the invite links to avoid being stolen. - Integrated network
The bot links its personal message, gateway group, real group and admins group. This offers additional facility in moderation, as you will see in later sections. - Written in Python, 100 % free and open source
You don't need to pay the developers, think of them or even thank them. Deploy the bot yourself, and enjoy life.
For you all, who are not ready to host the bot yourself, you can use the instance I host.
It is available under name @TakshiBot. Start the bot and type /create
.
Then the bot will tell you what to do.
Have a look at the Wiki for description of commands and extras.
Please be aware that this instance runs on a free plan in Heroku, so you know, anything unexpected may happen at expected times.
Deploying the bot is easy. Have some patience, a bottle of water, some good Internet connection. Keep any attacking items away to avoid hurting yourself.
- Python
The bot is written in Python, so install it if not done already. - Python Telegram Bot
The bot uses Python Telegram Bot package for interacting with Telegram API. - PSYCOPG
To acces PostgreSQL databases, we need this PSYCOPG. - A bot token
You can get this free of cost using Telegram's @BotFather. - A place to host your bot
This may cost you money. There are free solutions available too, for example Heroku. If you can keep your computer or laptop running for hours, you can host the bot yourself ! For more info, refer to Where to host bots ? - PostgreSQL
This a powerful free and open source database. There is 99.9% chance your hosting solution offers this database. If you go for personal hosting, then you can easily setup PostgreSQL in your system. Check out PostgreSQL website.
If you have managed to set up the required, deploying the bot can be a breeze.
- Clone this repository into your hosting space or personal computer if you are deploying.
- Add the bot to required groups (gateway, private group and admins group), then make it admin with full rights.
- Setup the database table and environment variables (explained below).
- Start the bot.
There is a good chance, PostgreSQL already made a database for you. If not, you need to create it.
After that, you need to create the table. Say you have cloned the repository to Downloads
directory, then open a terminal and type :
$ cd Takshi
$ psql -f data/init.sql
In short, you need to execute the file Takshi data/init.sql
(or it's contents) in PSQL
.
The way to modify the working of bot is through environment variables. Specifying them depends on your hosting solution and operating system.
Name | Description |
---|---|
ALLOW_CREATE |
If True , allows others to use your bot in their group. Only affects new groups. |
DATABASE_URL |
Database URL allows a connection to the database instance. |
PORT |
The port the server and connections should be handled on. |
TOKEN |
The token you obtained using Bot Father. |
URL |
URL of the hosted bot, not needed if hosted personally. |
- What is Database URL ? - Database URL
Wow, you managed to come till here ! Running the bot is just a command away. You need to open the terminal and set the directory to the cloned folder. In hosting solutions, it's quite a different way, look at the documentation of the hosting solution. If you are hosting on your own :
$ python3 -m Takshi -p
If you are hosting it in a dedicated solution :
$ python3 -m Takshi
After starting, open Telegram and message your bot. Send it a /create
and follow the steps. That's it !
If this didn't work, don't worry. Find what is causing the issue and try to tackle it. You may open an issue here if you want my help. Also, you can try the instance I host.
Please file an issue.
Everything should be working fine now. If not, tell me why.