Git Product home page Git Product logo

telegrambot-go's Introduction

Build Status codecov Go Report Card

TelegramBot-Go

This is a Telegram bot which receives information from user which he want found in Wikipedia and return information which he found in Wikipedia.

example work of bot

Getting Started

Available environment variable:

TOKEN

DB_SWITCH

LANGUAGE

CREATE_TABLE

HOST

PORT

USER

PASSWORD

DBNAME

SSLMODE

Telegram

If you want to use /number_of_users command your need to connect bot to database and add this command to your bot using BotFather: number_of_users - number of users who used bot

/number_of_users command sending message to user which contain number of users who used bot

Docker Hub

https://hub.docker.com/r/trigun117/wikipedia-telegram-bot/

Docker

Language

You can specify language

-e LANGUAGE=search_language
Examples: 
Russian: docker run -e LANGUAGE=ru -e TOKEN=set_your_bot_token -d trigun117/wikipedia-telegram-bot
France: docker run -e LANGUAGE=fr -e TOKEN=set_your_bot_token -d trigun117/wikipedia-telegram-bot

Default is English

Image

If you dont want to use databse run:

docker run -e TOKEN=set_your_bot_token -d trigun117/wikipedia-telegram-bot

If you want to use database run:

docker run \
-e DB_SWITCH=on \
-e TOKEN=set_your_bot_token \
-e HOST=set_your_database_host \
-e PORT=set_your_database_port \
-e USER=set_your_database_user \
-e PASSWORD=set_your_database_password \
-e DBNAME=set_your_database_name \
-e SSLMODE=set_your_database_sslmode(disable or enable, default disable) \
-d trigun117/wikipedia-telegram-bot

if you need to create table add

-e CREATE_TABLE=yes

Docker-Compose

Set environment variables in docker-compose.yml

services:

  db:
    image: postgres
    environment:
      POSTGRES_PASSWORD: test

  bot:
    image: trigun117/wikipedia-telegram-bot
    environment:
      CREATE_TABLE: "yes"
      DB_SWITCH: "on"
      TOKEN: set_your_bot_token
      HOST: db
      PORT: 5432
      USER: postgres
      PASSWORD: test
      DBNAME: postgres
      SSLMODE: disable

Than move to /docker-compose folder and run:

docker-compose up --build

License

This project is licensed under the MIT License - see the LICENSE file for details

telegrambot-go's People

Contributors

squaredice 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.