run.py
def login(update, context):
    """Command handler: /login <username> <password> - save login to database."""
    logging.info(f"Command: /login triggered by {update.effective_chat.id}")
    if len(context.args) != 2:
        context.bot.send_message(
            chat_id=update.effective_chat.id,
            text="Not enough or too many parameters, I need both usernamae and password.",
        )
    else:
        ses = apollodb.UserQuery(apollodb.Session())
        u = ses.get_user(update.effective_chat.id)
        if u:
            context.bot.send_message(
                chat_id=update.effective_chat.id,
                text="Your user already exists, I'm going to delete it and create a new one.",
            )
            ses.delete(update.effective_chat.id)
        new_user = apollodb.User(
            userid=update.effective_chat.id,
            apollo_user=context.args[0],
            apollo_password=context.args[1],
        )
        ses.add_user(new_user)
        context.bot.send_message(
            chat_id=update.effective_chat.id,
            text="Your login information is now saved.",
        )
        ses.close()
Command handler: /login <username> <password> - save login to database.
Command handler: /login   - save login to database.
Command handler : / login - save login to database .
def login(update, context):
    logging.info(f"Command: /login triggered by {update.effective_chat.id}")
    if len(context.args) != 2:
        context.bot.send_message(
            chat_id=update.effective_chat.id,
            text="Not enough or too many parameters, I need both usernamae and password.",
        )
    else:
        ses = apollodb.UserQuery(apollodb.Session())
        u = ses.get_user(update.effective_chat.id)
        if u:
            context.bot.send_message(
                chat_id=update.effective_chat.id,
                text="Your user already exists, I'm going to delete it and create a new one.",
            )
            ses.delete(update.effective_chat.id)
        new_user = apollodb.User(
            userid=update.effective_chat.id,
            apollo_user=context.args[0],
            apollo_password=context.args[1],
        )
        ses.add_user(new_user)
        context.bot.send_message(
            chat_id=update.effective_chat.id,
            text="Your login information is now saved.",
        )
        ses.close()
def login ( update , context ) : logging . info ( f"Command: /login triggered by {update.effective_chat.id}" ) if len ( context . args ) != 2 : context . bot . send_message ( chat_id = update . effective_chat . id , text = "Not enough or too many parameters, I need both usernamae and password." , ) else : ses = apollodb . UserQuery ( apollodb . Session ( ) ) u = ses . get_user ( update . effective_chat . id ) if u : context . bot . send_message ( chat_id = update . effective_chat . id , text = "Your user already exists, I'm going to delete it and create a new one." , ) ses . delete ( update . effective_chat . id ) new_user = apollodb . User ( userid = update . effective_chat . id , apollo_user = context . args [ 0 ] , apollo_password = context . args [ 1 ] , ) ses . add_user ( new_user ) context . bot . send_message ( chat_id = update . effective_chat . id , text = "Your login information is now saved." , ) ses . close ( )
Command handler: /login <username> <password> - save login to database.
Command handler : / login <username > <password > - save login to database .
"""Command handler: /login <username> <password> - save login to database."""
update
context