Exemplo n.º 1
0
def ask_confirm_delete_with_files_cb(_, update, groups):
    logger.info('delete with files inline button')

    torrent_hash = groups[0]
    logger.info('torrent hash: %s', torrent_hash)

    torrent = qb.torrent(torrent_hash)
    # torrent.delete(with_files=True)

    update.callback_query.edit_message_text(
        '你确定要删除吗 {}, <b>连同文件一起删除</b>?'.format(u.html_escape(torrent.name)),
        reply_markup=kb.confirm_delete(torrent.hash),
        parse_mode=ParseMode.HTML)
    update.callback_query.answer('请再次确认')
Exemplo n.º 2
0
def ask_confirm_delete_with_files_cb(update: Update, context: CallbackContext):
    logger.info('delete with files inline button')

    torrent_hash = context.match[1]
    logger.info('torrent hash: %s', torrent_hash)

    torrent = qb.torrent(torrent_hash, get_torrent_generic_properties=False)
    # torrent.delete(with_files=True)

    update.callback_query.edit_message_text(
        f'Are you sure you want to delete {torrent.name_escaped}, <b>with all the connected files included</b>?',
        reply_markup=kb.confirm_delete(torrent.hash),
        parse_mode=ParseMode.HTML)
    update.callback_query.answer('Confirmation needed')
Exemplo n.º 3
0
def ask_confirm_delete_with_files_cb(_, update, groups):
    logger.info('delete with files inline button')

    torrent_hash = groups[0]
    logger.info('torrent hash: %s', torrent_hash)

    torrent = qb.torrent(torrent_hash)
    # torrent.delete(with_files=True)

    update.callback_query.edit_message_text(
        'Are you sure you want to delete {}, <b>with all the connected files included</b>?'
        .format(u.html_escape(torrent.name)),
        reply_markup=kb.confirm_delete(torrent.hash),
        parse_mode=ParseMode.HTML)
    update.callback_query.answer('Confirmation needed')