예제 #1
0
def deposit(account_from_user):
    amount_to_deposit = int(input("How much would you like to deposit: \n >"))
    balance = sql.get_balance(account_from_user)
    new_balance = amount_to_deposit + balance
    sql.update_balance(account_from_user, new_balance)
    print(f"Your new balance is: {new_balance}")
    print("Deposited...")
예제 #2
0
파일: home.py 프로젝트: 4anky/growbot
def balance(update, _):
    (money, high,
     chip) = sql.get_balance(telegram_id=update.message.from_user.id)
    update.message.reply_markdown(text=text.BALANCE.format(
        money=text.three_digits(n=money),
        high=text.three_digits(n=high),
        chip=text.three_digits(n=chip)),
                                  reply_markup=menu.show(menu=text.HOME))
    return state.HOME
예제 #3
0
    def withdraw(self, amount):

        original_balance = sql.get_balance(self.logged_user)[0]['balance']

        bal = int(original_balance) - amount

        sql.alter_balance(self.logged_user, bal)

        print("Deposit Successfull...!")
예제 #4
0
def withdraw(account_from_user):
    amount_to_withdraw = int(input("How much would you like to withdraw: \n >"))
    balance = sql.get_balance(account_from_user)
    if balance >= amount_to_withdraw:
        new_balance = balance - amount_to_withdraw
        print(f"Your new balance is: {new_balance}")
        sql.update_balance(account_from_user, new_balance)
    else:
        print("Insufficient Balance")
예제 #5
0
    def deposit(self, amount, name="self"):

        target_name = name if name != "self" else self.logged_user
        print(target_name)

        original_balance = sql.get_balance(target_name)[0]['balance']

        bal = int(original_balance) + amount

        sql.alter_balance(target_name, bal)

        print("Deposit Successfull...!")
예제 #6
0
def street_enter_high(update, _):
    (money, high, _) = sql.get_balance(telegram_id=update.message.from_user.id)
    update.message.reply_markdown(
        text=text.STREET_ENTER_HIGH_TEXT.format(money=text.three_digits(n=money), high=text.three_digits(n=high)),
        reply_markup=menu.show(menu=text.BACK))
    return state.STREET_ENTER_HIGH
예제 #7
0
def dealer(update, _):
    (_, high, _) = sql.get_balance(telegram_id=update.message.from_user.id)
    update.message.reply_markdown(text=text.DEALER_DESC.format(high=text.three_digits(n=high)),
                                  reply_markup=menu.show(menu=text.BACK))
    return state.DEALER