Beispiel #1
0
                        break

                    # 保持コインの確認
                    balance = w_client.getbalance(sender_user_id_str)
                    if amount + fee < balance:
                        t_client.reply(
                            "@" + sender_user_screen_name +
                            " 出荷待ちのもやしが不足しています。", tweet_id_str)
                        break

                    # 個人のwalletから共有walletにコインを移す
                    w_client.deposit(sender_user_id_str, amount)
                    # 移した分だけDBの栽培中のコインを増やす
                    before_cultivation_coins = user[2]
                    update_cultivation_coins = before_cultivation_coins + amount
                    d_client.updateUserCultivationCoins(
                        sender_user_id_str, update_cultivation_coins)

                    msg = "@{screen_name} {amount}もやし種まきしました!\n" \
                          + "🛒 出荷待ち:{balance}もやし\n" \
                          + "🌱 栽培中 : {cultivation_coins}もやし\n"

                    formatted_msg = msg.format(
                        screen_name=sender_user_screen_name,
                        amount=amount,
                        balance=str(balance - amount),
                        cultivation_coins=str(update_cultivation_coins),
                    )

                    # 結果をリプライ
                    t_client.reply(formatted_msg, tweet_id_str)
                except: