Skip to content

allcodny/ai-character-telebot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Character Telegram Bot

eng rus

A Telegram bot with AI integration (via OpenRouter) for generating text responses in the persona of any character.

✨ Features:

  • Generating meaningful responses according to the character's personality defined in your prompt
  • Image recognition
  • Context understanding (private messages, comments, group chats, different reactions to specific users in chats)
  • Configurable response frequency/chance in different contexts
  • Whitelists for security and request economy

⚙️ Installation and Setup

Note: It's recommended to run the bot on hosting, as any Telegram bot requires continuously running code for constant operation.

  1. Prerequisites

  2. Clone repository
    git clone https://github.com/N0Fanru/ai-character-telebot
    or
    download as ZIP file and extract

  3. Install dependencies
    In command line: pip install -r requirements.txt

  4. Configuration setup
    Modify the contents of the bot_config.py file to suit your needs following the comments in the file.
    Note: You can find user or group IDs using various Telegram bots (e.g., Get Any ID)

  5. Create prompts
    Rename prompts_exaple.py file to prompts.py and modify its content according to your needs.
    Note: Experiment with prompts! In the main prompt, you can define everything you consider necessary. It's recommended to primarily include examples of the character's messages.

  6. Run the bot
    python bot.py

📋 Usage

  • For private messages: make sure you're in the whitelist or the whitelist is disabled. Send a message to the bot.
  • For comments/messages in chats: make sure the chat is in the whitelist or the whitelist is disabled. Ensure the bot's response chance is set correctly. Write a post or message in the chat.

About AI

The project uses free AI models that worked best in my case. You can choose any other AI model on OpenRouter and change to it in the .env file.

❗ Possible Issues:

🔮 Planned Future Features:

  1. Audio recognition
  2. Analysis of certain files
  3. Context memory with database

If you liked the project, don't forget to give it a ⭐ on GitHub!

About

A Telegram bot that leaves comments, responds in chat, and communicates on behalf of a character.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages