Coder Social home page Coder Social logo

randomchat-bot's Introduction

RandomChat-Bot

A Telegram bot which is able to connect randomly multiple users creating anonimous chats

Features

Each user (ID and name) is saved in a database at first /start

Connect virtually two users anonymously. When user1 send the /join command his ID is assigned to a free room. If user2 is assigned to the same room all messages sent by user1 is routed to user2

Only text and photo can be sent to another users and neither is saved in the database

Rooms are numbered automatically from 0 to 20

Only one ID can be admin of the bot: it is specifed in the config.py file

Public commands:

  • /join a room
  • /leave the actual room
  • /skip leave the actual room and join another automatically
  • /report send a message directly to the admin

Admin commands:

  • /help list all admin command
  • /alluser list of all users registered
  • /sendmessage <id> <text> send a message to a specific ID
  • /bad <id> ban a specific user by his ID
  • /unban <id> unban a specific user by his ID
  • /log get the entire log file of the bot

Setup and run

Create a bot using Bot Father and get the Token

Modify config.py with the admin ID and the Token. You can also modify the default name and password of the database in the file db.py

Install the last version of docker and docker-compose than build and run the application:

sudo docker-compose up --build

You can access the postgres database with

sudo docker exec -it my_container psql -U admin -W botDb /bin/bash

my_container is the container ID

TODO

  • Enable other types of messages
  • Inline keyboard
  • Multi language
  • Rooms can support more than two partecipants
  • Set name/avar for each user

....what else?

Thanks to vishnubob for wait-for-it script

randomchat-bot's People

Contributors

dadigno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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