def note_handler(data, bot, chats):
    """
    Defines the handler for a note (create or update) on commit, merge request, issue or snippet
    """
    message = 'New note on '
    if 'commit' in data:
        message += 'commit '
        info = '\nCommit : ' + data['commit']['url']
    elif 'merge_request' in data:
        message += 'merge request '
        info = '\nMerge request : ' + data['merge_request']['title']
    elif 'issue' in data:
        message += 'issue '
        info = '\nIssue : ' + data['issue']['title']
    else:
        message += 'snippet '
        ifno = '\nSnippet : ' + data['snippet']['title']
    message += 'on project ' + data['project']['name']
    message += info
    message += '\nNote : ' + data['object_attributes']['note']
    message += '\nURL : ' + data['object_attributes']['url']
    bot.send_message_to_list(chats, message)
