๐ A simple URL shortener, controlled via a Telegram bot.
mhr = mihir, but shortened (*_*).
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.
Make sure to take note of the token received! It should look like this: 3141592653:KAS_JFD04YEGFxbQV4FTPetQpZefUhr37HC
.
The chat_id
identifies you on Telegram. You can get it by /start
ing a chat with @RawDataBot or some other ways. It can be a positive or negative number.
- Clone this repo:
git clone https://github.com/plibither8/mhr
- Install dependencies:
npm install
- Create
config.ts
file fromconfig.example.ts
file:cp config.example.ts config.ts
- Edit the
config.ts
file with your values - Start up the server and use the bot:
npm start
- Party hard.
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. |