Skip to content

A simple, yet completely functional ChatBot for Telegram! It can handle anonymous chat between two users 🤐

License

Notifications You must be signed in to change notification settings

pabel172/TelegramChatBot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Telegram ChatBot ⚠️ Work in Progress! ⚠️

Welcome to 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
/cerca -  💬 Start searching for a partner
/exit - 🔚 Exit from the chat
/newchat - ⏭ Exit from the chat and open a new one
/stats - Display the number of active and paired users, only to admins

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!

About

A simple, yet completely functional ChatBot for Telegram! It can handle anonymous chat between two users 🤐

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%