Ejemplo n.º 1
0
def check_Spotify_Login(user_Telegram_ID):
    """
    Check if a user is logged in to Spotify
    """
    logger.info(f"Check Spotify Login For User {user_Telegram_ID}")
    return search_In_Database(get_User_UniqueID(user_Telegram_ID),
                              "spotify_Users", "user_Unique_ID")
Ejemplo n.º 2
0
def get_User_UniqueID(user_Telegram_ID):
    """
    Get a unique user ID from the database
    """
    search_Data = search_In_Database(user_Telegram_ID, "bot_Users",
                                     "telegram_ID")

    if search_Data:
        user_UniqueID = search_Data[0][1]
        logger.info(f"Get User Unique ID For User {user_Telegram_ID}")
        return user_UniqueID

    else:
        logger.error(f"CANNOT Get User Unique ID For User {user_Telegram_ID}")
        return None
Ejemplo n.º 3
0
def get_User_BotVersion(user_Telegram_ID):
    """
    Get the bot version from the user
    """
    search_Data = search_In_Database(user_Telegram_ID, "bot_Users",
                                     "telegram_ID")

    try:
        bot_Version = search_Data[0][3]

    except:
        logger.info(
            f"Cannot Get User Bot Version, Sending Standart Value For User {user_Telegram_ID}"
        )
        return 0

    else:
        logger.info(f"User {user_Telegram_ID} Bot Version: {bot_Version}")
        return bot_Version
Ejemplo n.º 4
0
def get_User_Language(user_Telegram_ID):
    """
    Get user language from database
    """
    search_Data = search_In_Database(user_Telegram_ID, "bot_Users",
                                     "telegram_ID")

    try:
        user_Language = search_Data[0][2]

    except:
        logger.info(
            f"Cannot Get User Language, Sending Standart Value For User {user_Telegram_ID}"
        )
        return "ENG"

    else:
        logger.info(f"Get User Language For User {user_Telegram_ID}")
        return user_Language
Ejemplo n.º 5
0
def get_User_Position(user_Telegram_ID):
    """
    Get user position from database
    """
    search_Data = search_In_Database(user_Telegram_ID, "bot_Users",
                                     "telegram_ID")

    try:
        user_Position = search_Data[0][4]

    except:
        logger.info(
            f"CANNOT Get User Position For User {user_Telegram_ID}, sending value 'undefined_Position'"
        )
        return "undefined_Position"

    else:
        logger.info(f"Get User Position For User {user_Telegram_ID}")
        return user_Position
Ejemplo n.º 6
0
def check_Bot_Reg(user_Telegram_ID):
    """
    Check registration in the bot
    """
    logger.info(f"Check Bot Reg For User {user_Telegram_ID}")
    return search_In_Database(user_Telegram_ID, "bot_Users", "telegram_ID")