soatok / headless-lounge-bot
Telegram bot for ensuring group access is limited to e.g. Twitch subscribers and/or Patreon supporters.
Requires
- php: ^7.3
- ext-json: *
- ext-pdo: *
- ezyang/htmlpurifier: ^4
- guzzlehttp/guzzle: ^6
- slim/slim: ^3.1
- soatok/anthrokit: ^0|^1
- soatok/patreon: ^0|^1
Requires (Dev)
- phpunit/phpunit: ^8
- vimeo/psalm: ^3
This package is auto-updated.
Last update: 2024-11-18 15:49:52 UTC
README
Telegram bot for ensuring group access is limited to e.g. Twitch subscribers and/or Patreon supporters.
Using the Bot to Protect Your Groups
The bot operated by Soatok (
@HeadlessLounge_Bot
) is only available if you're one of Soatok's patrons at the Dhole's Delight ($3/month) tier or higher.
Setup is straightforward:
- Talk to
@HeadlessLounge_Bot
. Make sure to link your own third-party accounts. (Twitch, Patreon, etc.) - Invite
@HeadlessLounge_Bot
to your group. (Make sure you're an admin.) - Type
/enforce [service] [minimum]
/enforce Twitch
for Tier 1+ Twitch subs./enforce Twitch 2
for Tier 2+ Twitch subs./enforce Patreon 5
for $5/mo. or more pledge./enforce Patreon 10
for $10/mo. or more pledge.
Anyone who joins the group will be auto-kicked unless...
- They have linked their own third-party accounts by talking to the bot directly.
- They have met your enforcement requirements.
Administrators can allow exceptions to this rule on a case-by-case basis by
typing /permit @Telegram_Username
.
Note: If you choose to add multiple enforcements (i.e. Twitch and Patreon),
satisfying any of the requirements will avoid being auto-kicked.
(Logically: It's an OR
not an AND
operation.)
Setting up and Deploying Your own Bot
After cloning this repository and setting up your webserver with HTTPS, get an
API key from BotFather. Stick that in local/telegram-token.php
like so:
<?php return 'your-token-here';
Do the same with your bot's Telegram username (local/telegram-username.php
)
and User ID (local/telegram-user-id.php
).
You can also configure your own local settings inside local/settings.php
(see
src/settings.php
for more details).
Once your configuration is complete, make sure you run composer install
in
the project's root directory.
Next, run bin/keygen.php
and bin/setup-webhook.php
.
Finally, run the .sql
files inside the sql/
directory to setup the database
tables.