Giter VIP home page Giter VIP logo

links_helper_bot's Introduction

TELEGRAM LINK BOT

About

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

Build and launch the bot

Токен для бота присылался отдельно в сообщении с ссылкой на проект!

Using Docker

The first build
  1. You need mysql docker image, for downloading it execute:
    docker pull mysql

  2. Clone the project.

  3. 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'
  4. Build the project with:
    docker-compose build

  5. First launch with:
    docker-compose up

To start and stop the app later
  • docker-compose start
  • docker-compose stop

From sources

  1. Clone the Project.

  2. Setup Environment.
    pip install pipenv

  3. Install dependencies.
    pip install -r requirements.txt

  4. You need mysql server on your desktop. Download from https://dev.mysql.com/downloads/mysql/ and install it.

  5. Create database
    mysql -u{DB_USER} -p{DB_PASSWORD}.
    CREATE DATABASE DB_NAME;.

  6. 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'
  7. Run server
    python bot.py

links_helper_bot's People

Contributors

crashcumber avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.