This project is a simple Telegram bot built with the telebot library that detects the language of incoming messages and modifies them by inserting special Unicode characters. The bot also responds with a sticker when a specific command is received.
- Language Detection: The bot uses the
langdetectlibrary to identify the language of the incoming message. - Message Modification: Depending on the detected language, the bot modifies the message by inserting special Unicode characters.
- Sticker Response: The bot sends a specific sticker when the
/hoholcommand is received.
- Python 3.x
pyTelegramBotAPIlibrarylangdetectlibrary
-
Clone the repository:
git clone https://github.com/yourusername/yourproject.git cd yourproject -
Install the required libraries:
pip install pyTelegramBotAPI langdetect
-
Add your Telegram bot token in the script:
bot = telebot.TeleBot("YOUR_TELEGRAM_BOT_TOKEN")
-
Run the bot:
python bot.py
-
Send a message with the
/tprefix to see the modified message. -
Send the
/hoholcommand to receive a sticker.
- The bot listens for text messages and detects their language.
- Depending on the language, it modifies the message by adding special Unicode characters.
- The modified message is then sent back to the user.
- If the
/hoholcommand is received, the bot sends a sticker.
- Sending the message:
/t Hello World! - Receiving the message:
Hello World!
This project is licensed under the MIT License.
Этот проект представляет собой простой телеграм-бот, созданный с использованием библиотеки telebot, который определяет язык входящих сообщений и модифицирует их, вставляя специальные символы Unicode. Бот также отправляет стикер при получении определенной команды.
- Обнаружение языка: Бот использует библиотеку
langdetectдля определения языка входящего сообщения. - Модификация сообщения: В зависимости от обнаруженного языка бот модифицирует сообщение, вставляя специальные символы Unicode.
- Ответ со стикером: Бот отправляет определенный стикер при получении команды
/hohol.
- Python 3.x
- Библиотека
pyTelegramBotAPI - Библиотека
langdetect
-
Клонируйте репозиторий:
git clone https://github.com/yourusername/yourproject.git cd yourproject -
Установите необходимые библиотеки:
pip install pyTelegramBotAPI langdetect
-
Добавьте токен вашего телеграм-бота в скрипт:
bot = telebot.TeleBot("YOUR_TELEGRAM_BOT_TOKEN")
-
Запустите бота:
python bot.py
-
Отправьте сообщение с префиксом
/t, чтобы увидеть модифицированное сообщение. -
Отправьте команду
/hohol, чтобы получить стикер.
- Бот прослушивает текстовые сообщения и определяет их язык.
- В зависимости от языка, он модифицирует сообщение, добавляя специальные символы Unicode.
- Модифицированное сообщение отправляется обратно пользователю.
- При получении команды
/hohol, бот отправляет стикер.
- Отправка сообщения:
/t Привет, мир! - Получение сообщения:
Привет, мир!