https://github.com/dmytro-varich/character-ai-telegram-bot
This project demonstrates interaction with the API of the Character AI web application, as well as the structure and principles of Telegram bot development. It allows users to chat with a Character AI persona in Telegram by sending and receiving messages via the API.
https://github.com/dmytro-varich/character-ai-telegram-bot
aiogram3 character-ai-api python sqlite telegram telegram-bot
Last synced: 5 months ago
JSON representation
This project demonstrates interaction with the API of the Character AI web application, as well as the structure and principles of Telegram bot development. It allows users to chat with a Character AI persona in Telegram by sending and receiving messages via the API.
- Host: GitHub
- URL: https://github.com/dmytro-varich/character-ai-telegram-bot
- Owner: dmytro-varich
- Created: 2024-11-26T22:15:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-30T08:42:11.000Z (about 1 year ago)
- Last Synced: 2025-04-30T09:25:47.664Z (about 1 year ago)
- Topics: aiogram3, character-ai-api, python, sqlite, telegram, telegram-bot
- Language: Python
- Homepage:
- Size: 31.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# πΎ Character AI Telegram Bot
This project demonstrates interaction with the API of the [Character AI](https://character.ai/) web application, as well as the structure and principles of Telegram bot development. It allows users to chat with a Character AI persona in [Telegram](https://web.telegram.org/) by sending and receiving messages via the API. The project is built using the [Unofficial Python API for Character.AI](https://github.com/kramcat/CharacterAI) and can serve as a foundation for developing custom bots that integrate AI characters into the messenger.

# ποΈ Project Structure
```
character-ai-telegram-bot/
βββ config/
β βββ config.py # Environment variable storage
βββ databases/
β βββ database.py # Database module
βββ filters/
β βββ chat_type.py # Filter to determine the type of chat (group or private)
βββ handlers/
β βββ conversation_filter.py # Dialog filtering logic
β βββ help_handler.py # Handler for the /help command
β βββ start_handler.py # Handler for the /start command
βββ states/
β βββ states.py # State detection for dialog management with the user
βββ texts/
β βββ texts.py # Stores text messages
βββ requirements.txt # List of project dependencies
βββ README.md # Project documentation
```
# π» Usage
1. Clone this project to your computer using the following command:
```bash
git clone https://github.com/dmytro-varich/Character-AI-Telegram-Bot.git
```
2. Create a `.env` file and update the configuration in the `config` folder by adding the necessary variables or replacing placeholder tokens with your own.
3. Navigate to the projectβs root directory using the command:
```bash
cd Character-AI-Telegram-Bot
```
4. Start the Telegram bot by running the following command in the terminal:
```bash
python main.py
```
5. Open the Telegram messenger and find your bot. Click **Start** to begin.
6. To activate the bot, you will need to send it the email address associated with your **Character.AI** account. You will receive an email containing your API key. After that, send the link to the chat with the character in **Character.AI**, and you will be able to start chatting in Telegram.
# π More Info
The author of this project is Dmytro Varich. You can find more information about him and his projects on his Telegram channel [@varich_channel](https://t.me/varich_channel). For collaboration inquiries, feel free to contact him via LinkedIn ([dmytro-varich](https://www.linkedin.com/in/dmytro-varich/)) or email at varich.it@gmail.com.
This Telegram bot [@babyfooji_character_ai_bot](https://t.me/babyfooji_character_ai_bot) was created as a test bot and is accessible only to the project creator. This limitation exists because the current version allows the bot to interact with only one chat. However, the project can be adapted to enable a single bot to communicate with multiple users, where each user would have their own individual conversation with a specific character.