import telebot
import random
bot = telebot.TeleBot("(токен я убрал)")
class Games:
def game(call):
tmp = ["камень", "ножницы", "бумага"]
while True:
rnd = random.choice(tmp)
inline = telebot.types.InlineKeyboardMarkup()
k = telebot.types.InlineKeyboardButton("Камень", callback_data=10)
n = telebot.types.InlineKeyboardButton("Ножницы", callback_data=11)
b = telebot.types.InlineKeyboardButton("Бумага", callback_data=12)
inline.row(k, n)
inline.row(b)
bot.send_message(call.message.chat.id, text = "Выбирай:", reply_markup=inline)
if call.data == 10 and rnd == "камень":
bot.send_message(call.message.chat.id, text="ничья")
if call.data == 10 and rnd == "бумага":
bot.send_message(call.message.chat.id, text="вы проиграли")
if call.data == 11 and rnd == "камень":
bot.send_message(call.message.chat.id, text="вы проиграли")
if call.data == 11 and rnd == "ножницы":
bot.send_message(call.message.chat.id, text="ничья")
if call.data == 11 and rnd == "бумага":
bot.send_message(call.message.chat.id, text="вы победили")
if call.data == 12 and rnd == "камень":
bot.send_message(call.message.chat.id, text="вы победили")
if call.data == 12 and rnd == "ножницы":
bot.send_message(call.message.chat.id, text="вы проиграли")
if call.data == 12 and rnd == "бумага":
bot.send_message(call.message.chat.id, text="ничья")