def dispatch(bot: Bot, update: Update): bot.edit_message_text( chat_id=update.callback_query.message.chat_id, parse_mode=ParseMode.HTML, text=texts.admin_dispatch, message_id=update.callback_query.message.message_id, reply_markup=keyboards.back('admin') ) return TEXT
def wallet_history(bot: Bot, update: Update, user): """ """ wallets = user.partner.wallets output = format_events(wallets) bot.edit_message_text(chat_id=user.telegram_id, parse_mode=ParseMode.HTML, message_id=update.callback_query.message.message_id, reply_markup=keyboards.back('personal_wallet'), text=texts.area_wallet_history.format(**output))
def settings(bot: Bot, update: Update, user): """ Здесь выводим доступные для редактирования данные о партнере, Настройку кошелька """ output = {} bot.edit_message_text(chat_id=user.telegram_id, parse_mode=ParseMode.HTML, message_id=update.callback_query.message.message_id, text=''.format(**output), reply_markup=keyboards.back('personal'))
def referral(bot: Bot, update: Update, user): """ Хендлер инлайн-кнопки "Реферальная программа" в личном кабинете :param bot: telegram bot :param update: incoming update :param user: instance of the current bot user """ output = {'ref_code': user.partner.id, 'bot_name': cfg.BOT} bot.edit_message_text(chat_id=user.telegram_id, parse_mode=ParseMode.HTML, message_id=update.callback_query.message.message_id, text=texts.area_bounty.format(**output), reply_markup=keyboards.back('personal'))
def wallet_history(bot: Bot, update: Update, user): """ Хендлер кнопки инлайн-клавиатуры "История" в личном кабинете :param bot: telegram bot :param update: incoming update :param user: instance of the current bot user """ partners_events = db.session.query(db.PartnerEvents).\ filter_by(partner_id=user.partner.id).all() if partners_events: output = {**format_events(partners_events)} bot.edit_message_text( chat_id=user.telegram_id, parse_mode=ParseMode.HTML, message_id=update.callback_query.message.message_id, text=texts.area_hist.format(**output), reply_markup=keyboards.back('personal')) else: bot.answer_callback_query( callback_query_id=update.callback_query.id, text='Вы еще не совершили ни одного пополнения', show_alert=True)
def development(bot: Bot, update: Update, **kwargs): bot.edit_message_text(chat_id=update.callback_query.message.chat_id, parse_mode=ParseMode.HTML, text=texts.about_development, message_id=update.callback_query.message.message_id, reply_markup=keyboards.back('about'))