https://github.com/plibither8/mhr
🔗 A simple URL shortener, controlled via a Telegram bot
https://github.com/plibither8/mhr
lowdb telegram telegram-bot url-shortener
Last synced: about 1 year ago
JSON representation
🔗 A simple URL shortener, controlled via a Telegram bot
- Host: GitHub
- URL: https://github.com/plibither8/mhr
- Owner: plibither8
- License: mit
- Created: 2021-02-09T15:14:15.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-26T09:11:48.000Z (almost 4 years ago)
- Last Synced: 2025-04-12T23:35:10.898Z (about 1 year ago)
- Topics: lowdb, telegram, telegram-bot, url-shortener
- Language: TypeScript
- Homepage: https://mhr.cx
- Size: 331 KB
- Stars: 7
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mhr
> 🔗 A simple URL shortener, controlled via a Telegram bot.
mhr = mihir, but shortened (\*_\*).
## Setup
### Create a Telegram Bot
You would first need to create a Telegram bot and get the bot's access token. Fortunately, it's pretty simple and easy: you can create one with [@BotFather](https://t.me/BotFather).
Make sure to take note of the token received! It should look like this: `3141592653:KAS_JFD04YEGFxbQV4FTPetQpZefUhr37HC`.
### Get your Telegram Chat ID
The `chat_id` identifies you on Telegram. You can get it by `/start`ing a chat with [@RawDataBot](https://t.me/RawDataBot) or [some other ways](https://stackoverflow.com/questions/32423837/telegram-bot-how-to-get-a-group-chat-id). It can be a positive or negative number.
### Setup the Server
1. Clone this repo: `git clone https://github.com/plibither8/mhr`
2. Install dependencies: `npm install`
3. Create `config.ts` file from [`config.example.ts`](config.example.ts) file: `cp config.example.ts config.ts`
4. Edit the `config.ts` file with **your values**
5. Start up the server and use the bot: `npm start`
6. Party hard.
## Usage
Open the chat with your bot and `/start` it.
Interact with your Telegram bot to create, read, update or delete the aliases. Following are the available commands:
| Command | Description |
|---------------|-------------------------------------------------------|
| **`/help`** | Show list of commands and help information. |
| **`/cancel`** | Cancel the ongoing operation. |
| **`/urls`** | Show list of shortened URLs along with their aliases. |
| **`/new`** | Create a new alias for a URL. |
| **`/update`** | Update the target URL for an existing alias. |
| **`/delete`** | Delete an alias and redirection. |
## License
[MIT](LICENSE)