Пример #1
0
def get_qiwi_num_withdraw(message, bot, sum_withdraw):
    try:
        chat_id = message.chat.id
        qiwi_num = int(message.text)
        func.withdraw_sum_from_balanse(chat_id, sum_withdraw / 100 * (100 + config.withdraw_comission))
        func.create_withdraw(chat_id, sum_withdraw, qiwi_num, 1)
        bot.send_message(chat_id, "Выплата принята в обработку ожидайте подтверждения")
    except:
        error_message(message, bot)
Пример #2
0
def create_dice_game_step2(message, bot):
    try:
        chat_id = message.chat.id
        user_balanse = func.get_user_information(chat_id)[1]
        sum_bet = float(message.text)
        if sum_bet / 100 * (100 + config.games_comission) <= user_balanse:
            if sum_bet >= config.min_sum_bet and sum_bet <= config.max_sum_bet:
                func.withdraw_sum_from_balanse(chat_id, sum_bet / 100 * (100 + config.games_comission))
                mes = bot.send_message(chat_id, "Выберите тип игры", reply_markup = menu.gen_dice_step3_kb(sum_bet))
            else:
                bot.send_message(chat_id, f"Минимальная сумма ставки - {config.min_sum_bet}\n\nМаксимальная сумма ставки - {config.max_sum_bet}")
        else:
            not_enough_money(message, bot, sum_bet)
    except:
        error_message(message, bot)
Пример #3
0
def play_non_true_user(chat_id, bot, game_hash, value_non_true_user):
    player_value = value_non_true_user
    game = func.get_dice_by_hash(game_hash)
    func.withdraw_sum_from_balanse(chat_id, game[1] / 100 * (config.games_comission))
    if game[4] > player_value:
        winner_message(game[2], game[1], game[4], player_value, game[6], game_hash, bot)
        lose_message(chat_id, game[1], player_value, game[4], game[6], game_hash, bot)
    elif game[4] < player_value:
        lose_message(game[2], game[1], game[4], player_value, game[6], game_hash, bot)
        winner_message(chat_id, game[1], player_value, game[4], game[6], game_hash, bot)
    elif game[4] == player_value:
        func.popoln_user_balanse(chat_id, game[1])
        func.popoln_user_balanse(game[2], game[1])
        bot.send_message(chat_id, f"{game[6]} Dice #{game[0]}\n\n Ничья")
        bot.send_message(game[2], f"{game[6]} Dice #{game[0]}\n\n Ничья")
    func.delete_dice_game_by_hash(game_hash)
Пример #4
0
def get_second_player_value_dice_game(message, bot, game_hash, value):
    chat_id = message.chat.id
    player_value = message.dice.value + value
    game = func.get_dice_by_hash(game_hash)
    func.withdraw_sum_from_balanse(chat_id, game[1] / 100 * (100 + config.games_comission))
    if game[4] > player_value:
        winner_message(game[2], game[1], game[4], player_value, game[6], game_hash, bot)
        lose_message(chat_id, game[1], player_value, game[4], game[6], game_hash, bot)
    elif game[4] < player_value:
        lose_message(game[2], game[1], game[4], player_value, game[6], game_hash, bot)
        winner_message(chat_id, game[1], player_value, game[4], game[6], game_hash, bot)
    elif game[4] == player_value:
        func.popoln_user_balanse(chat_id, game[1])
        func.popoln_user_balanse(game[2], game[1])
        bot.send_message(chat_id, f"{game[6]} Dice #{game[0]}\n\n Ничья")
        bot.send_message(game[2], f"{game[6]} Dice #{game[0]}\n\n Ничья")
    func.delete_dice_game_by_hash(game_hash)
Пример #5
0
def get_btc_num_withdraw(message, bot, sum_withdraw):
    chat_id = message.chat.id
    btc_num = message.text
    func.withdraw_sum_from_balanse(chat_id, sum_withdraw / 100 * (100 + config.withdraw_comission))
    func.create_withdraw(chat_id, sum_withdraw, btc_num, 2)