Coder Social home page Coder Social logo

alb-24 / telegramchatbot Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 3.0 24 KB

A simple, yet completely functional ChatBot for Telegram! It can handle anonymous chat between two users ๐Ÿค

License: GNU General Public License v3.0

Python 100.00%
chatbot chatbot-telegram telegram telegram-bot telegram-bots telegram-userbot

telegramchatbot's Introduction

Telegram Anonymous ChatBot

Welcome to this example of ChatBot, a Telegram bot that connects users for random anonymous chats!

Table of Contents

Introduction

This is an example of a Telegram bot that allows users to connect with random partners for chats while ensuring anonymity between users. This project was born out of my curiosity to understand how a generic ChatBot works on Telegram. As a result, I created this bot from scratch! All of this is made possible thanks to this interface for the Telegram Bot API python-telegram-bot.

Features

  • Randomly pairs users for one-on-one chats.
  • Ensures anonymity between users.
  • Offers an easy-to-use Telegram interface.
  • Gracefully handles partner exits and chat interruptions.
  • New feature implementations are possible, such as adding states for settings, blocked users, special commands for admins, and more.

How It Works

Prerequisites

  • Python (3.8 or higher)
  • Telegram Bot API token (obtain it from @BotFather on Telegram, see here)
  • python-telegram-bot installed (see here)

Installation

  1. Clone the repository:
    git clone https://github.com/Alb-24/TelegramChatBot
    
  2. Create a file config.py with your own user_id as ADMIN_ID and Telegram Bot API Token as BOT_TOKEN.
    # config.py
    
    BOT_TOKEN = "YOUR_BOT_TOKEN_HERE"
    ADMIN_ID = "YOUR_ADMIN_USER_ID"
  3. Make any modifications you desire to bot.py and my_data.py (feel free to explore possible improvements!)
  4. Run bot.py and have fun with your bot:
    python bot.py
    

List of Commands

These are the supported commands, for now:

/start - ๐Ÿค– Starts the bot
/chat -  ๐Ÿ’ฌ Start searching for a partner
/exit - ๐Ÿ”š Exit from the chat
/newchat - โญ Exit from the chat and open a new one
/stats - ๐Ÿ“Š Show bot statistics (only for admin)

Contributing

Contributions are highly welcome! I'm new to the world of Telegram bots, so I've likely only scratched the surface of all possibilities. There could be countless functionalities unknown to me, but this is just a starting point.

If you have any suggestions, bug reports, or feature requests, please open an issue or a discussion and share your thoughts! Anything is appreciated ๐Ÿ˜„.

Feel free to use or modify this version as needed!

telegramchatbot's People

Contributors

alb-24 avatar

Stargazers

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