Python:
import datetime
import config
import zakaz
import telebot
from telebot import types
bot = telebot.TeleBot(config.token)
@bot.message_handler(content_types=['text'])
#Создание кнопок
def get_text_messages(message):
keyboard = telebot.types.InlineKeyboardMarkup()
button1 = telebot.types.InlineKeyboardButton(text="Принять", callback_data="pr_zk")
button2 = telebot.types.InlineKeyboardButton(text="Отклонить", callback_data="okl_zk")
keyboard.row(button1, button2)
msg = bot.send_message(message.from_user.id, zakaz.opisanie, reply_markup=keyboard)
#Ответ на принять заказ
@bot.callback_query_handler(func=lambda call: call.data == "pr_zk")
def callback_function1(callback_obj):
keyboard = telebot.types.InlineKeyboardMarkup()
button1 = telebot.types.InlineKeyboardButton(text="Водитель", callback_data="vd")
button2 = telebot.types.InlineKeyboardButton(text="Водитель с грузчиками", callback_data="vd_gr")
keyboard.row(button1, button2)
msg1 = bot.send_message(callback_obj.from_user.id, "Выберете", reply_markup=keyboard)
bot.delete_message(message.chat.id, msg.message_id)
................
@bot.callback_query_handler(func=lambda call: call.data == "okl_zk")
def callback_function2(callback_obj):
bot.send_message(callback_obj.from_user.id, "Позвоните мне по номеру: ")
bot.answer_callback_query(callback_query_id=callback_obj.id)
bot.polling()
Последнее редактирование: