Skip to content
Snippets Groups Projects
Commit bfd7caaf authored by Dylan Janssen's avatar Dylan Janssen
Browse files

Clean up of the code

parent 3f8c69f2
No related branches found
No related tags found
1 merge request!2Draft: initial user flow for creating a wallet
This commit is part of merge request !2. Comments created here will be created in the context of that merge request.
......@@ -43,10 +43,8 @@ def start(update: Update, context: CallbackContext):
else:
update.effective_message.reply_text("You cannot join a wallet twice")
# TODO. when the last one is added send mnemonics to users
user.set_state(1)
# TODO: clear variables
user.set_variable({})
reply_msg, reply_markup = generate_message(1)
update.effective_message.reply_text(reply_msg, reply_markup=reply_markup)
......@@ -90,8 +88,8 @@ def choose_wallet(update: Update, context: CallbackContext):
def wallet_options(update: Update, context: CallbackContext, user: AppUser):
query = update.callback_query.data
print("We are in the wallet options: " + query)
wallet_name = update.callback_query.data
user.set_variable("wallet_name", wallet_name)
next_state = user.next_state()
reply_msg, reply_markup = generate_message(next_state)
update.effective_message.reply_text(reply_msg, reply_markup=reply_markup)
......@@ -146,7 +144,7 @@ def name_wallet(update: Update, context: CallbackContext, user: AppUser):
for request in wallet_requests:
update.effective_message.reply_text("Hi, please join this wallet as co-signer.\n"
"Wallet name= {}\n"
"https://t.me/BitcoinLibTestbot&start={}".format(variables['wallet_name'], request["token"]))
"https://t.me/BitcoinLibTestbot?start={}".format(variables['wallet_name'], request["token"]))
next_state = user.next_state()
reply_msg, reply_markup = generate_message(next_state)
......
......@@ -22,6 +22,7 @@ class TelegramWrapper:
def start_polling(self):
self._updater.start_polling()
self._updater.idle()
def connect_database(self):
connect(True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment