Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashokshau/force-sub-bot
A Telegram Bot to force users to join a specific channel before sending messages in a group.
https://github.com/ashokshau/force-sub-bot
fast force-sub-bot force-subscribe fsub go gobot gotgbot redis telegram telegram-bot vercel vercel-template
Last synced: 28 days ago
JSON representation
A Telegram Bot to force users to join a specific channel before sending messages in a group.
- Host: GitHub
- URL: https://github.com/ashokshau/force-sub-bot
- Owner: AshokShau
- License: mit
- Created: 2024-07-21T07:57:58.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-28T16:01:06.000Z (2 months ago)
- Last Synced: 2024-09-27T17:22:00.074Z (about 1 month ago)
- Topics: fast, force-sub-bot, force-subscribe, fsub, go, gobot, gotgbot, redis, telegram, telegram-bot, vercel, vercel-template
- Language: Go
- Homepage: https://FallenFSubBot.t.me
- Size: 42 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Force Sub Bot
This project includes a Telegram bot designed to enforce subscription to a specific channel before allowing users to interact in a group chat. It's built using Go and integrates with the Telegram Bot API using gotgbot.
Installation Instructions
Install Go
```shell
git clone https://github.com/udhos/update-golang dlgo && cd dlgo && sudo ./update-golang.sh && source /etc/profile.d/golang_path.sh
```- Exit and reopen your terminal, then verify the installation with
go version
.Set Up the Project
- Clone the repository:
git clone https://github.com/Abishnoi69/Force-Sub-Bot fSub && cd fSub
- Prepare the environment file:
- Copy the sample environment file:
cp sample.env .env
- Open env:
vi .env
- Edit the
.env
file with your preferred editor. Instructions for editing invi
:
- Press
ɪ
to start editing.- Press
Ctrl + C
once editing is complete, then type:wq
to save and exit, or:qa
to exit without saving.- Start a new
tmux
session:sudo apt install tmux && tmux
- Run the bot:
go run .
Deploy to Vercel
- Fork this repository 🍴
- Login your Vercel account
- Go to your Add New Project
- Choose the repository you forked
- Configure the environment variables:
DB_URI
Redis- Tap on Deploy
Usage
Once the bot is running, it will enforce subscription to a specific channel before allowing users to interact in the group chat. Users not subscribed to the channel will be prompted to do so.
Commands
-
/start
- Start the bot. -
/fsub
- Set the channel for force subscription. Reply to a forwarded message from the channel you wish to set. -
/fsub on
- Enable force subscription mode. -
/fsub off
- Disable force subscription mode. -
/fsub
- Get the current force subscription status. -
/getChats
- Get all chats. -
/getUsers
- Get all users who started in private. -
/getAllBots
- Get all bots running on webhook.
Owner Only Commands
License
Feel free to visit LICENSE for more details.
Contributing Guidelines
Contributions are welcome! For bug reports, feature requests, or pull requests, please open an issue or submit your changes directly.
Support
For any questions or concerns, please contact me at Telegram.