def currency(call): current_currency = call.data[4:] # Выбранная валюта chat = call.message.chat bot.edit_message_text(base.get_text(chat.id, 'operations'), chat.id, call.message.message_id, reply_markup=markups.menu())
def my_requests(call): text = base.get_text(call.message.chat.id, 'no_req') bot.edit_message_text(text, call.message.chat.id, call.message.message_id) bot.edit_message_reply_markup(call.message.chat.id, call.message.message_id, reply_markup=markups.add_request( call.message.chat.id))
def exchange(msg): bot.send_message(msg.chat.id, "Купить/Продать", reply_markup=markups.exchangeR()) bot.send_message(msg.chat.id, base.get_text(msg.chat.id, "exchamge"), reply_markup=markups.exchangeI())
def back(msg): bot.send_message(msg.chat.id, "Операции покупки или продажи", reply_markup=markups.addWelcome()) bot.send_message(msg.chat.id, base.get_text(msg.chat.id, "operations"), reply_markup=markups.menu())
def welcome(msg): bot.send_message(msg.chat.id, "Чат-поддержка", reply_markup=markups.addWelcome()) bot.send_message(msg.chat.id, base.get_text(msg.chat.id, 'welcome_inf') % msg.from_user.first_name, reply_markup=markups.welcome(), parse_mode='html')
def llanguage(msg): chat = msg.chat base.create_user(msg.chat.id, msg.text) markup = telebot.types.ReplyKeyboardMarkup(True, True) markup.row("ok") str = bot.send_message(msg.chat.id, base.get_text(msg.chat.id, "confirm"), reply_markup=markup) bot.register_next_step_handler(str, welcome)
def main_menu(): return make_markup(1, 2,True, base.get_text((12))[-1][0], base.get_text((13))[-1][0])
def select_currency(msg): chat = msg.chat bot.send_message(chat.id, base.get_text(chat.id, 'currency'), reply_markup=markups.currency())
def select_currency(call): chat = call.message.chat bot.edit_message_text(base.get_text(chat.id, 'currency'), chat.id, call.message.message_id, reply_markup=markups.currency())
def currency(call): chat = call.message.chat bot.edit_message_text(base.get_text(chat.id, 'operations'), chat.id, call.message.message_id, reply_markup=markups.menu())
def settings(msg): bot.send_message(msg.chat.id, base.get_text(msg.chat.id, 'settings'), reply_markup=markups.settings())
def wallet(msg): bot.send_message(msg.chat.id, "Кошелёк", reply_markup=markups.exchangeR()) bot.send_message(msg.chat.id, base.get_text(msg.chat.id, 'wallet'), reply_markup=markups.wallet())
def sell(call): chat = call.message.chat bot.send_message(chat.id, "Продажа", reply_markup=markups.exchangeR()) bot.send_message(chat.id, base.get_text(chat.id, 'sellcur'), reply_markup=markups.buyI_sellI())
def buy(call): chat = call.message.chat bot.send_message(chat.id, "Покупка", reply_markup=markups.exchangeR()) bot.send_message(chat.id, base.get_text(chat.id, 'buycur'), reply_markup=markups.buyI_sellI())
def start_dia(): return make_inline_markup(1, 1, base.get_text((12))[-1][0], 1)
def setings(call): msg = call.message bot.edit_message_text(base.get_text(msg.chat.id, 'settings'), msg.chat.id, msg.message_id, reply_markup=markups.settings())
def end_markup(user_id): return make_markup(1, 1, True, base.get_text((14))[-1][0])
def add_request(cid): markup = telebot.types.InlineKeyboardMarkup() text = base.get_text(cid, 'add_req') btn = telebot.types.InlineKeyboardButton(text=text, callback_data='add request') markup.row(btn) return markup