import telebot
from telebot.types import InlineKeyboardMarkup, InlineKeyboardButton
from datetime import datetime, timedelta
import random
if random.random() < 0.85:
random_number = round(random.uniform(0.01, 10.45), 2)
else:
random_number = round(random.uniform(10.46, 55.23), 2)
print(random_number)
bot = telebot.TeleBot("")
@bot.message_handler(commands=['start'])
def handle_start(message):
markup = InlineKeyboardMarkup()
markup.row(InlineKeyboardButton("Регистрация", url=""))
markup.row(InlineKeyboardButton("Зарегестрировался", callback_data='reg_user'))
bot.send_message(message.chat.id,
f"Перед началом зарегестрируйся нажав кнопку Регистрация, после вернись в бота и нажми кнопку Зарегестрировался", parse_mode="Markdown", reply_markup=markup)
@bot.callback_query_handler(func=lambda call: True)
def callback_inline(call):
current_datetime = datetime.now()
new_datetime = current_datetime + timedelta(minutes=3)
new_datetime_str = new_datetime.strftime("%Y-%m-%d %H:%M:%S")
if call.data == "reg_user":
markup = InlineKeyboardMarkup()
markup.row(InlineKeyboardButton("", callback_data='nextkef'))
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id,
text="",
reply_markup=markup)
elif call.data == "next":
markup = InlineKeyboardMarkup()
markup.row(InlineKeyboardButton("", callback_data='next'))
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id,
text=f"", reply_markup=markup)
bot.polling()