def extract_chat_id(body):
    """
    Obtains the chat ID from the event body

    Parameters
    ----------
    body: dic
        Body of webhook event
    
    Returns
    -------
    int
        Chat ID of user
    """

    if "edited_message" in body.keys():
        chat_id = body["edited_message"]["chat"]["id"]
    else:
        chat_id = body["message"]["chat"]["id"]
    return chat_id