https://github.com/rigwild/telegram-history-clean-bot
Automatically clear old Telegram messages
https://github.com/rigwild/telegram-history-clean-bot
telegram-bot
Last synced: over 1 year ago
JSON representation
Automatically clear old Telegram messages
- Host: GitHub
- URL: https://github.com/rigwild/telegram-history-clean-bot
- Owner: rigwild
- License: mit
- Created: 2021-10-31T15:55:36.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-03T23:32:01.000Z (over 4 years ago)
- Last Synced: 2025-02-18T19:50:11.639Z (over 1 year ago)
- Topics: telegram-bot
- Language: TypeScript
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Telegram history clean bot
Telegram does not offer a bulk message delete for groups. This bot will delete messages after some time.
## Install
```sh
pnpm install
```
## Build
```sh
pnpm build
```
## Run
You can pass the time as a [ms](https://github.com/vercel/ms) string.
**Note:** A bot can't delete a message that is older than 48 hours.
```sh
TG_TOKEN= DELETE_AFTER_TIME=30h DELETE_AFTER_MESSAGES_COUNT=3500 node dist/index.js
```
Using [PM2](https://pm2.keymetrics.io/).
```sh
TG_TOKEN= \
DELETE_AFTER_TIME=30h \
DELETE_AFTER_MESSAGES_COUNT=3500 \
DELETE_AFTER=30h \
NODE_ENV=production \
pm2 start --max-memory-restart 150M --time --name "telegram-history-clean-bot" dist/index.js
```
## License
[The MIT License](./LICENSE)