https://github.com/samislam/telegram-invite-links-cleaner-bot
Clean telegram join links, remove duplicates, remove text
https://github.com/samislam/telegram-invite-links-cleaner-bot
telegram telegram-bot
Last synced: 28 days ago
JSON representation
Clean telegram join links, remove duplicates, remove text
- Host: GitHub
- URL: https://github.com/samislam/telegram-invite-links-cleaner-bot
- Owner: samislam
- License: mit
- Created: 2025-01-03T05:31:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-17T00:22:32.000Z (about 1 year ago)
- Last Synced: 2025-05-17T01:19:13.071Z (about 1 year ago)
- Topics: telegram, telegram-bot
- Language: TypeScript
- Homepage:
- Size: 138 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# telegram-invite-links-cleaner-bot
A simple and powerful bot that can clean all your duplicated invite links and store them in one chat. Supports multi users.
# Setup
1. Rename the file `.env.example` to `.env.local`.
2. Obtain a bot token from the **telegram bot father**.
3. Paste your token in the `TELEGRAM_BOT_TOKEN` environment variable field in the `.env.local` file.
4. Paste your bot username in the `TELEGRAM_BOT_USERNAME`.
5. You'll need to setup MongoDB, follow guides online on how to run MongoDB on your machine, then paste your MongoDB connection URL in the `DATABASE_URL` field of the `.env.local` file.
6. Run the following commands in your terminal:
```bash
$ bun install
$ bun start
```
> This bot requires bun to be installed, if you don't have bun, download it from [it's website](https://bun.sh/).
> Bun is faster than Nodejs.
# Guide
Chat with the bot, tap "start" to start the chat, the bot includes information on how to get started, it's easy, just send the bot any URL and see how it functions.
For example, try to send the bot the following URL:
`https://example.com`, it's going to delete your message and send you the URL in a message like `https://example.com`. If you tried to send `https://example.com` again, it's going to drop your message. Try to send `Hello`, and it's going to delete your message. Try to send
```
Hello
https://google.com
```
and it's going to drop your message, and send you back `https://google.com`
The resulting chat would be
```
@bot: https://example.com
@bot: https://google.com
```
So you'll have clean links base.
Now, you might wonder why the bot is accepting any URL and not only telegram invitation links. This behaviour can be changed easily by changing the environment variable `ONLY_JOIN_LINKS=false` to `ONLY_JOIN_LINKS=true` in your `.env.local` file.
Rembmer that after changing any file, if you want to see the results, you have to restart your running service by stopping the process and rerunning the command `bun start`.