Code Monkey home page Code Monkey logo

multitran-telegram-bot's Introduction

Multitran-telegram-bot

A translator bot that uses Multitran online dictionary.

Deployment

Run setup.sh. Docker image will be built.

Run docker_run_multitran_bot.sh to run the actual bot.

TODO: Old readme below, perform cleanup

Overview

Deployment

Make sure Python 3 and virtualenv are installed.

First, run sudo apt-get install libfreetype6-dev libpng12-dev

I also needed to do ln -s /usr/include/freetype2/ft2build.h /usr/include/ because certain libraries did not compile without that.

Then, run setup.sh. This will install dependencies.

To run the bot, simply run run.sh.

Deploying with webhooks and nginx

Install nginx using apt-get install nginx Go to /etc/nginx/sites-enabled and create new file with the following contents.

server {
    listen              443 ssl;
    server_name         111.111.111.111; #IP address of your server
    ssl_certificate     /somepath/certs/cert.pem; #path to your ssl certificate file
    ssl_certificate_key /somepath/certs/private.key; #path to your ssl private key file


location /BOT_TOKEN {
    proxy_pass http://127.0.0.1:33333; #port is arbitrary, the one you set upon launching the bot
        }
}

Go to /etc/nginx/sites-enabled and delete the default cube link. Create a link to your settings file. ln -s /etc/nginx/sites-enabled/your_config /etc/nginx/sites-enabled

Perform nginx -s reload to reload the configuration.

Modify your run.sh so it would be something like this, replacing the values with your values, of course. env/picbot_env/bin/python3 multitran_bot.py --server-ip="111.111.111.111" -m "webhook_nginx" -p 33333 -c "/somepath/certs/cert.pem"

Dependencies

This program uses Python 3

This program relies on python-telegram-bot.

Tested systems

Ubuntu 14.04 Ubuntu 20.04

multitran-telegram-bot's People

Contributors

az09 avatar highstaker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

multitran-telegram-bot's Issues

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.