InviteMember-Telegram integration leverages Telegram Bot API.
- providing a robust and reliable backend for your membership bot;
- adding new members to your private channels and groups;
- removing members when their subscription is over.
Your Membership Bot
Telegram bots are small apps that live inside the Telegram ecosystem.
Your membership bot is the main interface your clients will use to:
- check out what plans you're offering;
- make one-time payments;
- start and stop recurring subscriptions;
- activate access codes;
- check their current subscription status at any time;
- get access to channels and groups they paid for;
- get renewal reminders;
- get removal notifications;
- receive your broadcasts;
- communicate with you or your team through the built-in support system.
Luckily, you don't have to write any code for all these features, we already did it.
Only two actions are required from you:
After that, InviteMember will register itself as a backend for your membership bot and start making/answering requests.
We're using invite links for granting access to private channels and groups. Currently, it's the only method that is available for Telegram Bot developers.
Key facts about invite links
- You and bots can create invite links for private Telegram channels and groups;
- Other users can use your invite links to join your private channel or group;
- Invite links look like this: https://t.me/joinchat/AAAAAE59ckPCJh9InRSlgA;
- Only one invite link for the channel/group can be valid at the moment;
- You can find current invite link in your channel/group settings in your Telegram app;
- An invite link can be used many times by different users until it's revoked;
- You can revoke current invite link at any time, it will be replaced with a new one;
- It's possible to change invite link via Telegram Bot API (that's how InviteMember does that).
Known limitations of invite links
Telegram Bot API was, probably, not designed with membership management in mind.
There are some limitations that InviteMember has to deal with:
- It's not possible to add a user to a channel without invite link;
- it's not possible to create a single-use invite link;
- It's not possible to create a personal invite link (that only one user can use);
- Invite links are cached on Telegram servers and become unstable if you reset them too fast (try resetting a link 2-3 times in 10 seconds using your Telegram app — you'll understand what we mean).
How does InviteMember show invite links?
Since invite links must be kept secure and only customers should receive them, we:
- always show invite links hidden behind inline buttons (your users will see a CLICK HERE button, not an actual link);
- show invite links for 3 seconds only;
- revoke links immediately after showing them (so invite link's lifetime interval is very short, and it's quite hard to share it with someone else).
"Sorry, this group doesn't seem to exist."
It means that the invite link to your channel/group is unstable at the moment. It usually happens after clicking Join several times in row OR if multiple users are trying to join at the same time.
Solution: ask the user to try again (usually, it won't take more than 10 clicks to get in). If it won't help — he should wait about one minute (let invite link become stable) and try again.
"Too many attempts, please try again later"
It means that the user has clicked on too many invalid invite links recently. Most likely, he had a lot of messages "Sorry, this group doesn't seem to exist" right before this one or joined too many channels/groups in a row.
Solution: ask the user to wait several hours (maybe, even a day) and try again. Power users can try checking the exact time to wait using web.telegram.org.
In the following cases, InviteMember will check if a user has to be removed from your channels and groups:
- a subscription (or a free trial) is over;
- a recurring subscription has been cancelled;
- a user has joined your group;
- InviteMember has run a check on its own (we may run such checks randomly).
InviteMember may check all your bot users, not only those who made any payments or started any subscriptions.
To remove members, we simply call an API method that bans the user from your channel/group.
If you'll decide to grant access to someone for free — you have three options:
- issue an access code and let him join through your membership bot;
- whitelist him and then send him an invite link manually;
- make him an administrator of the channel/group (InviteMember doesn't kick administrators).
The bot will never kick whitelisted members and administrators from your channels and groups (even if they don't have active payments/subscriptions).
You can ban someone from using your bot completely. The bot will simply ignore all the messages from the banned user.