https://github.com/shnwazdeveloper/sayaspambot
Safe opt-in Telegram bot deployable on Railway
https://github.com/shnwazdeveloper/sayaspambot
Last synced: 17 days ago
JSON representation
Safe opt-in Telegram bot deployable on Railway
- Host: GitHub
- URL: https://github.com/shnwazdeveloper/sayaspambot
- Owner: shnwazdeveloper
- License: gpl-3.0
- Created: 2026-05-06T11:36:55.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-05-06T12:13:31.000Z (about 1 month ago)
- Last Synced: 2026-05-06T13:42:31.304Z (about 1 month ago)
- Language: Python
- Size: 44.9 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SayASpamBot
SayASpamBot is a safe, opt-in Telegram bot that can be deployed on Railway.
This repository was cleaned up from the original spam-bot codebase. Mass spam,
raid, adult-file spam, hidden invite joins, multi-token blasting, Heroku control
code, and hardcoded privileged user IDs have been removed.
## Commands
- `/start` - show the bot intro
- `/help` - show available commands
- `/ping` - check bot latency
- `/id` - show the current user and chat IDs
- `/gc ` - change the current group name
- `/lineadd ` - privately save one owner-only line
- `/lineupload` - reply to text or a `.txt` file to save owner-only lines
- `/linecount` - show saved owner-only line count
- `/lineclear` - clear saved owner-only lines
- `/myline` - show one private owner-only saved line
- `/say ` - send one user-requested message in the current chat
The `/say` command is rate-limited and sends only one message per command.
The `/gc` command works only in groups, can only be used by group admins, and
requires the bot to have permission to change group info.
The `/myline` command works only in a private chat with the configured owner.
It reads one line from `owner_lines.txt`, which is ignored by git and should be
used only for non-abusive personal saved text.
The `/lineadd`, `/lineupload`, `/linecount`, and `/lineclear` commands also
work only in private chat with the configured owner. Uploaded `.txt` files are
limited to 64 KB, and one upload saves at most 200 valid lines.
## Required environment variables
- `API_ID` - Telegram API ID from my.telegram.org
- `API_HASH` - Telegram API hash from my.telegram.org
- `BOT_TOKEN` - bot token from BotFather
Optional variables:
- `CMD_HNDLR` - command prefix, defaults to `/`
- `OWNER_ID` - your Telegram numeric user ID
- `SAY_COOLDOWN_SECONDS` - per-user cooldown for `/say`, defaults to `10`
- `MAX_SAY_LENGTH` - maximum `/say` message length, defaults to `300`
- `OWNER_LINES_PATH` - private saved-lines file path, defaults to `owner_lines.txt`
## Run locally
```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m sayaspambot
```
On Windows PowerShell:
```powershell
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
python -m sayaspambot
```
## Deploy on Railway
1. Create a new Railway project from this GitHub repository.
2. Add `API_ID`, `API_HASH`, and `BOT_TOKEN` in Railway Variables.
3. Deploy the service.
Railway will use the included Dockerfile and `railway.json` start command.