<filename>WTFAU_bot/utils.py<gh_stars>1-10
# --------------------------------------------------------------------------- #
# Author/Co-authors:
# - <NAME>
# - <NAME> (<EMAIL>)
# - Ytturi (<EMAIL>)
# Purpose:
#   Contains utils methods
# --------------------------------------------------------------------------- #


def get_player_from_update(update):
    player = update.effective_user.username
    if player is None:
        player = update.effective_user.full_name
    return player


def get_town_from_update(update):
    return ' '.join(update.callback_query.data.split()[1:])


def get_data_from_update(update):
    return get_player_from_update(update), get_town_from_update(update)
