pizda-bot/main.py
Administrator 38bc08d88d hotfix
2022-12-15 19:12:44 +03:00

30 lines
819 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import os
import string
import telebot
from telebot.types import Message
bot = telebot.TeleBot(os.getenv("TELEGRAM_TOKEN"))
all_letters = "йцукенгшщзхъёфывапролджэячсмитьбюЙЦУКЕНГШЩЗХЪЁФЫВАПРОЛДЖЭЯЧСМИТЬБЮQWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm "
answers_rus = {"да", "дa"}
answers_eng = {"da", "dа"}
@bot.message_handler()
def do_action(message: Message):
convert_text = ''.join([letter for letter in message.text if letter in all_letters]).lower().split()
if len(convert_text) > 0:
convert_text = convert_text[0]
else:
return
if convert_text in answers_rus:
bot.reply_to(message, "Пизда!")
if convert_text in answers_eng:
bot.reply_to(message, "Pizda!")
bot.polling()