GithubHelp home page GithubHelp logo

vputite-bot's Introduction

vputite-bot

Suggestion's bot for #vputite telegram channel

Vputite Suggestions Telegram Bot - Telegram ๐Ÿ‡ฌ๐Ÿ‡ง

Bot was created originally for IASA Student Council to handle suggestions, questions and requests. However, you can freely fork this repository and create your own bot.

How bot works

  1. User sends a message to the bot
  2. Bot forwards the message to the chat, configured by administrator
  3. One of the chat participants with the administrator permissions approve or reject the forwarded message
  4. Bot send it to the channel

Features

  • Text, Photos, Videos, Documents, GIFs, Voice Messages and Geolocation are supported
  • Customisable messages for bot to answer
  • Bot is stateless, no database is required for operation
  • Docker files for docker-compose for easy testing/development/deployment

โ— Note: changing pictures/videos is not possible, only their captions

Config

To setup a bot for your own usage, you should specify those variables in .env.

# Bot Data
TOKEN = # your bot's token
CHAT_ID = # chat id where the bot will forward users' messages
CHANNEL_NAME = # name of the channel to publish suggested post


To change default text to your custom, redefine values of the dictionary for each phrase in 
[`config.py`](https://github.com/dimaplel/telegram-suggestions-bot/blob/main/config.py).

``` bash
# Predefined text to send
TEXT_MESSAGES = {
    'start': 'Welcome to Suggestions Bot ๐Ÿ‘‹ \n\n Please, send your message and we will process your request.',
    'message_template': '<i>Message from: <b>@{0}</b>.</i>\n\n{1}<b>id: {2}</b>',
    'is_banned': 'โŒ User is banned!', 'has_banned': 'โœ… User has been successfully banned!',
    'already_banned': 'โŒ User is already banned!', 'has_unbanned': 'โœ… User has been successfully un-banned!',
    'not_banned': 'โŒ There is no such user in the ban list!',
    'user_banned': '๐Ÿšซ You cannot send messages to this bot!',
    'user_unbanned': '๐Ÿฅณ You have proven your innocence, and now you can write to this bot again!',
    'user_reason_banned': '๐Ÿšซ You cannot send messages to this bot due to the reason: <i>{}</i>.',
    'pending': 'Thank you for your request! We are already into processing it.',
    'unsupported_format': 'โŒ Format of your message is not supported and it will not be forwarded.',
    'message_not_found': 'โŒ It looks like your message was sent more that a day ago. Message to edit was not found!',
    'message_was_not_edited': 'โŒ Unfortunately you cannot edit images/videos themselves.'
                              'Please, send a new message.',
    'reply_error': 'โŒ Please, reply with /ban or /unban only on forwarded from user messages!'
}

Installation guide

  1. Clone this repository using terminal or tools in your IDE: git clone https://github.com/dimaplel/telegram-suggestions-bot.git
  2. Change directory in terminal cd $repository-direcory
  3. Download requirements pip install -r requirements.txt
  4. Edit and update config.py
  5. Create a new routine operator in your SQL database and insert script from sql_script.txt so that database could delete rows by itself after some time. By the way, don't forget to configure SQL user instead of <user> tag
  6. Run the bot python bot.py or by deploying it to Heroku

Authors

vputite-bot's People

Contributors

ehorohorin avatar mur4enka avatar vsamoylov avatar

Watchers

 avatar  avatar

vputite-bot's Issues

Multiple constants choice

To be able put more the one option of the constant per variable.

Can be used for more polite or human like communication

Text messages

Communication of the bot-users should be a more polite (contains the configurable text messages)

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.