asafespace/logic.py
def register_user(bot, chat_id, nusnetid):
    """
    Registers a user into the database. Also assigns a username to the user.

    Parameters
    ----------
    bot: Telegram both object
    chat_id: int
    nusnetid: str
    """

    try:
        # try adding user to DynamoDB
        username = get_random_username()
        insert_user(chat_id, nusnetid, username)
        bot.send_message(chat_id=chat_id, text=REGISTRATION_SUCCESS_MESSAGE + username)
        logger.info("New user " + username + " has been successfully added.")
    except Exception as error:
        # if there is an error with adding a user to DynamoDB
        bot.send_message(chat_id=chat_id, text=REGISTRATION_FAILURE_MESSAGE)
        logger.error("User was not added due to an error. " + str(error))

    Registers a user into the database. Also assigns a username to the user.

    Parameters
    ----------
    bot: Telegram both object
    chat_id: int
    nusnetid: str
    
Registers a user into the database. Also assigns a username to the user.
Parameters

Telegram both object
chat_id: int
nusnetid: str
Registers a user into the database . Also assigns a username to the user . Parameters Telegram both object chat_id : int nusnetid : str
def register_user(bot, chat_id, nusnetid):
    try:
        username = get_random_username()
        insert_user(chat_id, nusnetid, username)
        bot.send_message(chat_id=chat_id, text=REGISTRATION_SUCCESS_MESSAGE + username)
        logger.info("New user " + username + " has been successfully added.")
    except Exception as error:
        bot.send_message(chat_id=chat_id, text=REGISTRATION_FAILURE_MESSAGE)
        logger.error("User was not added due to an error. " + str(error))
def register_user ( bot , chat_id , nusnetid ) : try : username = get_random_username ( ) insert_user ( chat_id , nusnetid , username ) bot . send_message ( chat_id = chat_id , text = REGISTRATION_SUCCESS_MESSAGE + username ) logger . info ( "New user " + username + " has been successfully added." ) except Exception as error : bot . send_message ( chat_id = chat_id , text = REGISTRATION_FAILURE_MESSAGE ) logger . error ( "User was not added due to an error. " + str ( error ) )
Registers a user into the database.
Registers a user into the database .
"""
    Registers a user into the database. Also assigns a username to the user.

    Parameters
    ----------
    bot: Telegram both object
    chat_id: int
    nusnetid: str
    """ # try adding user to DynamoDB # if there is an error with adding a user to DynamoDB
bot
chat_id
nusnetid