def onCommand(game, commandClass, username, args):
    """
    Event Hook: onCommand
    Extend the default behaviour for some commands
    """
    if commandClass.__name__ == 'MessageCommand':
        message = ' '.join(args[1:])
        modInstance = game.getModInstance('ClientMod')
        modInstance.chatMessages[args[0]] = modInstance.chatMessages.get(args
            [0], []) + [message]
        if args[0] not in ['global', 'local']:
            gui = game.getGUIState()
            chatOverlay = game.getModInstance('ClientMod').chatOverlay
            if gui:
                if gui.isOverlayOpen(chatOverlay) and gui.getOverlay(
                    chatOverlay).tab == args[0]:
                    return
                gui.gui[1].notifications.append(args[0])
