Update 'dogetipbot_telegram.py'
This commit is contained in:
parent
9fa9fd3215
commit
e1b7b838a2
@ -229,12 +229,12 @@ async def dogetip(update: Update, context: CallbackContext):
|
|||||||
async def register(update: Update, context: CallbackContext):
|
async def register(update: Update, context: CallbackContext):
|
||||||
query = SESSION.query(User).filter_by(name=update.message.from_user.username)
|
query = SESSION.query(User).filter_by(name=update.message.from_user.username)
|
||||||
if query.count() > 0:
|
if query.count() > 0:
|
||||||
update.message.reply_text("Vous avez déjà un compte")
|
await update.message.reply_text("Vous avez déjà un compte")
|
||||||
else:
|
else:
|
||||||
user = User(name=update.message.from_user.username)
|
user = User(name=update.message.from_user.username)
|
||||||
SESSION.add(user)
|
SESSION.add(user)
|
||||||
SESSION.commit()
|
SESSION.commit()
|
||||||
update.message.reply_text(get_user(update.message.from_user.username).address)
|
await update.message.reply_text(get_user(update.message.from_user.username).address)
|
||||||
|
|
||||||
|
|
||||||
async def infos(update: Update, context: CallbackContext):
|
async def infos(update: Update, context: CallbackContext):
|
||||||
@ -244,14 +244,14 @@ async def infos(update: Update, context: CallbackContext):
|
|||||||
update.message.from_user.username
|
update.message.from_user.username
|
||||||
).balance
|
).balance
|
||||||
except NoAccountError as e:
|
except NoAccountError as e:
|
||||||
update.message.reply_text(
|
await update.message.reply_text(
|
||||||
"Vous n'avez pas de compte @"
|
"Vous n'avez pas de compte @"
|
||||||
+ str(e)
|
+ str(e)
|
||||||
+ "\n\n"
|
+ "\n\n"
|
||||||
+ "Utilisez /register pour démarrer"
|
+ "Utilisez /register pour démarrer"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
update.message.reply_text(
|
await update.message.reply_text(
|
||||||
address
|
address
|
||||||
+ "\n\n"
|
+ "\n\n"
|
||||||
+ str(balance / 100000000)
|
+ str(balance / 100000000)
|
||||||
@ -294,7 +294,7 @@ async def users(update: Update, context: CallbackContext):
|
|||||||
reply += (
|
reply += (
|
||||||
f"\n{repr(user)}\thttps://blockchair.com/dogecoin/address/{user.address}"
|
f"\n{repr(user)}\thttps://blockchair.com/dogecoin/address/{user.address}"
|
||||||
)
|
)
|
||||||
update.message.reply_text(reply)
|
await update.message.reply_text(reply)
|
||||||
|
|
||||||
|
|
||||||
# Telegram initialisation
|
# Telegram initialisation
|
||||||
|
Loading…
Reference in New Issue
Block a user