pizda-bot/main.py
2022-12-15 18:59:59 +03:00

23 lines
567 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 = "йцукенгшщзхъёфывапролджэячсмитьбюЙЦУКЕНГШЩЗХЪЁФЫВАПРОЛДЖЭЯЧСМИТЬБЮAa "
answers = {"да", "дa"}
@bot.message_handler()
def do_action(message: Message):
convert_text = ''.join([letter for letter in message.text if letter in all_letters]).lower().split()[-1]
if convert_text in answers:
bot.reply_to(message, "Пизда!")
bot.polling()