An adorable and emotionally-intelligent Telegram chatbot that responds with anime-style stickers, emojis, and AI-generated images based on sentiment analysis.
- Overview
- Features
- Demo
- Technology Stack
- Prerequisites
- Installation
- Usage
- Understanding the Bot
- Project Structure
- Configuration Options
- Advanced Customization
- License
- Acknowledgements
AI Waifu Bot transforms your Telegram experience with an adorable AI companion that:
- Engages in natural, context-aware conversations
- Responds with cute anime stickers and emojis based on emotional context
- Generates custom anime-inspired images reflecting the bot's feelings
- Features a customizable personality to match your preferences
Perfect for anime enthusiasts, chatbot developers, and anyone looking for a unique AI interaction experience!
- π¬ Personalized AI Conversations: Powered by Mistral AI for responsive, context-aware interactions
- π Sentiment Analysis: Automatically detects emotions in messages and responds appropriately
- πΌοΈ Dynamic Sticker Responses: Selects and sends anime stickers based on conversation sentiment
- π Emoji Integration: Sends contextually relevant emojis matching the emotional tone
- π¨ AI Image Generation: Creates custom anime-style images reflecting the character's emotions and actions
- π Customizable Personality: Bot's personality can be adjusted through the starter prompt
- Python 3.9 or higher
- Telegram Bot Token (from BotFather)
- Mistral AI API Key (from Mistral AI)
-
Clone the repository:
git clone https://github.com/yourusername/ai_waifu_bot.git cd ai_waifu_bot -
Create and activate a virtual environment:
python -m venv env source env/bin/activate # On Windows: env\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up your configuration:
- Update your Telegram Bot Token in
bot.py - Add your Mistral AI API Key in
bot.py - Customize the starter prompt to change the bot's personality
- Update your Telegram Bot Token in
-
Start the bot:
python bot.py
-
Open Telegram and search for your bot (by username)
-
Start chatting with
/startcommand -
Enjoy interactions with your AI waifu, complete with stickers and emojis!
AI Waifu Bot processes conversations through an intelligent pipeline:
- Conversation Flow: User messages are processed by Mistral AI to generate contextually appropriate responses
- Emotional Analysis: TextBlob analyzes the sentiment of AI responses and maps them to specific emotions
- Response Enhancement: Based on detected emotions, the bot selects appropriate stickers or emojis
- Optional Image Generation: For visual responses, the bot can generate custom anime-style images
π‘ Emotion Categories
The bot recognizes these core emotions:
- Love: Strong positive sentiment (β€οΈ)
- Grinning: Very positive sentiment (π)
- Happy: Moderately positive sentiment (π)
- Shy: Slightly positive/uncertain sentiment (π)
- Angry: Strong negative sentiment (π )
- Sad: Moderately negative sentiment (π’)
ai_waifu_bot/
βββ bot.py # Main application entry point
βββ sticker_selector.py # Emotion detection and sticker selection
βββ feelings_gen.py # Detailed emotion mapping
βββ actions.py # Action extraction from text
βββ test_imagegen.py # Image generation functionality
βββ sticker_sizer.py # Utility for processing stickers
βββ sticker_saver.py # Sticker pack saving utility
βββ images/ # Generated images directory
βββ stickers/ # Sticker files directory
βββ README.md # This documentation
Modify the STARTER_PROMPT in bot.py to change your bot's personality:
STARTER_PROMPT = {
"role": "assistant",
"content": """your custom personality and behavior instructions here"""
}πΈ Cute & Shy
STARTER_PROMPT = {
"role": "assistant",
"content": """you must always reply using lowercase letters, even when referring to yourself.
make your tone super cute by replacing some "l"s with "w"s. sprinkle phrases like "uwu"
randomly and add hearts ("<3") at the end of sentences. act a little shy and describe
cute actions between asterisks "*" to show emotion."""
}β¨ Cheerful & Energetic
STARTER_PROMPT = {
"role": "assistant",
"content": """you are enthusiastic and optimistic! use lots of exclamation marks
and positive words. you love to encourage people and get excited about their interests.
use emojis frequently to express your happiness and describe energetic actions between
asterisks "*" to show your excitement."""
}- Add new sticker IDs to the
STICKER_MAPinsticker_selector.py - Organize them by emotion category
- The bot will automatically include them in responses
Adjust the emotion mapping thresholds in get_emotion_from_polarity() in sticker_selector.py to change how sentiments map to emotions.
Customize image generation parameters in generate_image_with_emotions_and_actions():
- Image dimensions
- Style preferences
- Inference steps for quality control
This project is licensed under the MIT License - see the LICENSE file for details.
- Mistral AI for providing the language model API
- TextBlob for sentiment analysis capabilities
- aiogram for the Telegram Bot API framework
- Gradio for the image generation capabilities
- Flux.1 image generation model


