This bot can shorten your links.
Bot name: ShortenLink
Link for bot: t.me/ShortenLinksManagerBot
It has options:
/help
- see commands./last
- 10 last links.{url}
- url to shorten./start
- first command to start using bot.
If your url is valid bot return error. Otherwise it return warning.
All links` and users` data save in database.Structure your can see in models.py
-
You need mysql docker image, for downloading it execute:
docker pull mysql
-
Clone the project.
-
Change config.py: PUT BOT`s TOKEN
DB = "db" # Name mysql docker service, bot connect with it. DB_USER = 'root' # User. DB_PASSWORD = 'root' # Password for user. DB_NAME = 'bot' # Name of database with bot data. # PUT TOKEN FOR BOT TOKEN = {TOKEM} # Bot token, example: TOKEN = '78362876ablabla3829'
-
Build the project with:
docker-compose build
-
First launch with:
docker-compose up
docker-compose start
docker-compose stop
-
Clone the Project.
-
Setup Environment.
pip install pipenv
-
Install dependencies.
pip install -r requirements.txt
-
You need mysql server on your desktop. Download from https://dev.mysql.com/downloads/mysql/ and install it.
-
Create database
mysql -u{DB_USER} -p{DB_PASSWORD}
.
CREATE DATABASE DB_NAME;
. -
Change config.py for your settings.
DB = "127.0.0.1" # '127.0.0.1' for local database DB_USER = 'root' # Check for your user DB_PASSWORD = 'root' # Check for your password DB_NAME = 'bot' # Check for your database #PUT TOKEN FOR BOT TOKEN = {TOKEM} # Bot token, example: TOKEN = '78362876ablabla3829'
-
Run server
python bot.py